Class: Buildr::Packaging::Java::WarTask
- Inherits:
-
JarTask
- Object
- Rake::FileTask
- ArchiveTask
- ZipTask
- JarTask
- Buildr::Packaging::Java::WarTask
- Defined in:
- lib/buildr/java/packaging.rb
Overview
Extends the JarTask to create a WAR file.
Supports all the same options as JarTask, in additon to these two options:
-
:libs – An array of files, tasks, artifact specifications, etc that will be added to the WEB-INF/lib directory.
-
:classes – A directory containing class files for inclusion in the WEB-INF/classes directory.
For example:
package(:war).with(:libs=>'log4j:log4j:jar:1.1')
Instance Attribute Summary collapse
-
#classes ⇒ Object
Directories with class files to include under WEB-INF/classes.
-
#libs ⇒ Object
Artifacts to include under WEB-INF/libs.
Attributes inherited from ZipTask
Instance Method Summary collapse
-
#initialize(*args) ⇒ WarTask
constructor
:nodoc:.
Methods inherited from JarTask
Methods inherited from ZipTask
Methods inherited from ArchiveTask
#clean, #contain?, #empty?, #exclude, #include, #invoke_prerequisites, #merge, #needed?, #path, #root, #with
Methods inherited from Rake::FileTask
Constructor Details
#initialize(*args) ⇒ WarTask
:nodoc:
254 255 256 257 258 259 260 261 262 |
# File 'lib/buildr/java/packaging.rb', line 254 def initialize(*args) #:nodoc: super @classes = [] @libs = [] prepare do @classes.to_a.flatten.each { |classes| path('WEB-INF/classes').include classes, :as=>'.' } path('WEB-INF/lib').include Buildr.artifacts(@libs) unless @libs.nil? || @libs.empty? end end |
Instance Attribute Details
#classes ⇒ Object
Directories with class files to include under WEB-INF/classes.
249 250 251 |
# File 'lib/buildr/java/packaging.rb', line 249 def classes @classes end |
#libs ⇒ Object
Artifacts to include under WEB-INF/libs.
252 253 254 |
# File 'lib/buildr/java/packaging.rb', line 252 def libs @libs end |