I believe this one is now fixed....
--
dIon Gillard, Multitask Consulting
Work:      http://www.multitask.com.au
Developers: http://adslgateway.multitask.com.au/developers




Nathan Coast <[EMAIL PROTECTED]>
05/24/02 11:09 PM
Please respond to "Turbine Maven Developers List"

 
        To:     maven dev <[EMAIL PROTECTED]>
        cc: 
        Subject:        [patch] bug in j2ee/build.xml maven:ejb


Hi,

 >BUILD FAILED
 >D:\apache\maven\plugins\j2ee\build.xml:793: 
 >D:\projects\exampleejb\${maven.j2ee.ejb.meta-inf-includes} not found.

if the optional property maven.j2ee.ejb.meta-inf-includes is not set, the 
build 
fails.  The only solution I could think of is to have two targets, one 
with the 
  additional metainf tags and one without.  The target executed is 
determined by 
checking for the existence of maven.j2ee.ejb.meta-inf-includes during the 
ejb-init target.

Is there a more elegant solution? This feels ugly with the duplication of 
code 
in two targets.

Cheers
Nathan
Index: jakarta-turbine-maven/src/templates/build/plugins/j2ee/build.xml
===================================================================
RCS file: 
/home/cvspublic/jakarta-turbine-maven/src/templates/build/plugins/j2ee/build.xml,v
retrieving revision 1.4
diff -u -r1.4 build.xml
--- jakarta-turbine-maven/src/templates/build/plugins/j2ee/build.xml  23 
May 2002 09:02:24 -0000          1.4
+++ jakarta-turbine-maven/src/templates/build/plugins/j2ee/build.xml  24 
May 2002 13:08:16 -0000
@@ -228,13 +228,17 @@
         <dirname property="maven.j2ee.ejb.ejb-xml.dir" 
file="${maven.j2ee.ejb.ejb-xml}"/>
         <basename property="maven.j2ee.ejb.ejb-xml.file" 
file="${maven.j2ee.ejb.ejb-xml}"/>
         <property name="maven.j2ee.ejb.target-base" 
value="${maven.build.dir}/ejb/"/>
+        <available property="maven.j2ee.ejb.with-meta-inf-includes" 
file="${maven.j2ee.ejb.meta-inf-includes}"/>
     </target>
 
     <target name="ejb-build" depends="ejb-jar, ejb-remote, ejb-local" 
if="maven.j2ee.ejb.ready"/>
 
-    <target name="ejb-jar" if="maven.j2ee.ejb.ready">
+ 
+    <target name="ejb-jar" if="maven.j2ee.ejb.ready" 
+ depends="ejb-jar-with-meta-inf-includes,ejb-jar-no-meta-inf-includes"/>
+ 
+    <target name="ejb-jar-with-meta-inf-includes" 
if="maven.j2ee.ejb.with-meta-inf-includes">
 
-        <!-- ejb jar is always built -->
         <echo>Building EJB jar for ${maven.j2ee.ejb.name}</echo>
 
 
@@ -258,6 +262,41 @@
             <metainf dir="${maven.j2ee.ejb.meta-inf-includes}">
                 <include name="**/*/"/>
                 <exclude name="ejb-jar.xml"/>
+            </metainf>
+
+            <manifest>
+                <attribute name="Built-By" value="${user.name}" />
+                <section name="${maven.package}">
+                    <attribute name="Specification-Title" 
value="${maven.id}" />
+                    <attribute name="Specification-Version" 
value="${maven.currentVersion}" />
+                    <attribute name="Specification-Vendor" 
value="${maven.organization}" />
+                    <attribute name="Implementation-Title" 
value="${maven.package}" />
+                    <attribute name="Implementation-Version" 
value="${maven.currentVersion}" />
+                    <attribute name="Implementation-Vendor" 
value="${maven.organization}" />
+                </section>
+            </manifest>
+        </jar>
+    </target>
+
+ 
+    <target name="ejb-jar-no-meta-inf-includes" 
unless="maven.j2ee.ejb.with-meta-inf-includes">
+ 
+        <echo>Building EJB jar for ${maven.j2ee.ejb.name}</echo>
+ 
+
+        <mkdir dir="${maven.j2ee.ejb.target-base}"/>
+
+        <jar 
jarfile="${maven.j2ee.ejb.target-base}/${maven.j2ee.ejb.name}.jar" 
index="true">
+            <fileset dir="${maven.build.dir}/classes"
+                includes="${maven.j2ee.ejb.includes}"
+                excludes="${maven.j2ee.ejb.excludes}" />
+
+            <metainf dir="${basedir}">
+                <include name="LICENSE.txt"/>
+            </metainf>
+ 
+            <metainf dir="${maven.j2ee.ejb.ejb-xml.dir}">
+                <include name="${maven.j2ee.ejb.ejb-xml.file}"/>
             </metainf>
 
             <manifest>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to