dion 02/05/05 04:47:23
Modified: src/templates/build j2ee.properties build-j2ee.xml
Log:
Initial EAR file support
Revision Changes Path
1.6 +8 -0 jakarta-turbine-maven/src/templates/build/j2ee.properties
Index: j2ee.properties
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/templates/build/j2ee.properties,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- j2ee.properties 5 May 2002 08:17:46 -0000 1.5
+++ j2ee.properties 5 May 2002 11:47:23 -0000 1.6
@@ -14,3 +14,11 @@
#maven.j2ee.war.prepareBuildTarget=maven:war:preProcess
#maven.j2ee.war.updateBuildFile=build.xml
#maven.j2ee.war.updateBuildTarget=maven:war:postProcess
+
+##
+# EAR Target properties
+##
+# maven.j2ee.ear.name
+maven.j2ee.ear.appxml=${conf.dir}/${maven.j2ee.ear.name}-application.xml
+maven.j2ee.ear.includes=*.jar, *.war
+maven.j2ee.ear.excludes=
\ No newline at end of file
1.6 +67 -0 jakarta-turbine-maven/src/templates/build/build-j2ee.xml
Index: build-j2ee.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/templates/build/build-j2ee.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- build-j2ee.xml 5 May 2002 08:17:46 -0000 1.5
+++ build-j2ee.xml 5 May 2002 11:47:23 -0000 1.6
@@ -26,6 +26,16 @@
<available file="${maven.j2ee.war.webxml}" type="file"/>
</and>
</condition>
+
+ <condition property="maven.j2ee.ear.ready">
+ <and>
+ <not>
+ <equals arg1="${maven.j2ee.ear.name}"
+ arg2="$${maven.j2ee.ear.name}" />
+ </not>
+ <available file="${maven.j2ee.ear.appxml}" type="file"/>
+ </and>
+ </condition>
</target>
<target name="war"
@@ -95,6 +105,63 @@
</section>
</manifest>
</war>
+ </target>
+
+ <!--
+ EAR processing
+ -->
+ <target name="ear"
+ depends="local-init,
+ ear-error,
+ war,
+ ear-init,
+ #callback("preprocess-ear"),
+ ear-build,
+ #callback("postprocess-ear")"
+ description="o Create an ear file" />
+
+ <target name="ear-error" unless="maven.j2ee.ear.ready">
+ <!-- extend this list with requirements as needed -->
+ <fail>
+ +------------------------------------------------------------------------------
+ |
+ | ERROR: One of the required properties for maven:ear was not provided.
+ |
+ | Please ensure that the property maven.j2ee.ear.name is defined:
+ |
+ | maven.j2ee.ear.name = ${maven.j2ee.ear.name}
+ |
+ | and the following files:
+ |
+ | ${maven.j2ee.ear.appxml}
+ +------------------------------------------------------------------------------
+ </fail>
+ </target>
+
+ <target name="ear-init" if="maven.j2ee.ear.ready">
+ <!-- nothing to do as of yet -->
+ </target>
+
+ <target name="ear-build" if="maven.j2ee.ear.ready">
+ <echo>Building EAR ${maven.j2ee.ear.name}</echo>
+ <ear earfile="${build.dir}/${maven.j2ee.ear.name}.ear"
+ appxml="${maven.j2ee.ear.appxml}">
+ <fileset dir="${build.dir}"
+ includes="${maven.j2ee.ear.includes}"
+ excludes="${maven.j2ee.ear.excludes}" />
+ <manifest>
+ <attribute name="Built-By" value="${user.name}" />
+ <section name="${package}">
+ <attribute name="Specification-Title" value="${id}" />
+ <attribute name="Specification-Version"
value="${currentVersion}" />
+ <attribute name="Specification-Vendor"
value="${maven.organization}" />
+ <attribute name="Implementation-Title" value="${package}" />
+ <attribute name="Implementation-Version"
value="${currentVersion}" />
+ <attribute name="Implementation-Vendor"
value="${maven.organization}" />
+ </section>
+ </manifest>
+ </ear>
+
</target>
</project>