dion        02/05/23 02:02:25

  Modified:    src/templates/build/plugins/j2ee build.xml Control.vm
                        default.properties
  Log:
  Patch applied for the J2EE Plug-in, supplied by Kevin O'Neill <[EMAIL PROTECTED]>
  Allows the creation of ejb jars, ejb remote jars and ejb local jars
  
  Revision  Changes    Path
  1.4       +162 -1    jakarta-turbine-maven/src/templates/build/plugins/j2ee/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/templates/build/plugins/j2ee/build.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- build.xml 15 May 2002 19:17:44 -0000      1.3
  +++ build.xml 23 May 2002 09:02:24 -0000      1.4
  @@ -34,6 +34,16 @@
                   <available file="${maven.j2ee.ear.appxml}" type="file"/>
               </and>
           </condition>
  +
  +        <condition property="maven.j2ee.ejb.ready">
  +            <and>
  +                <not>
  +                    <equals arg1="${maven.j2ee.ejb.name}"
  +                            arg2="$${maven.j2ee.ejb.name}" />
  +                </not>
  +                <available file="${maven.j2ee.ejb.ejb-xml}" type="file"/>
  +            </and>
  +        </condition>
       </target>
     
       <target name="war"
  @@ -178,7 +188,158 @@
                       <attribute name="Implementation-Vendor" 
value="${maven.organization}" />
                   </section>
               </manifest>
  -         </ear>
  +        </ear>
  +    </target>
  +    
  +
  +    <!-- 
  +        ejb processing 
  +    -->
  +    <target name="ejb"
  +        depends="local-init,
  +                 ejb-error,
  +                 ejb-init,
  +                 #callback("pre-ejb"),
  +                 ejb-build,
  +                 #callback("post-ejb")"
  +        description="Create an ejb file" />
  +
  +    <target name="ejb-error" unless="maven.j2ee.ejb.ready">
  +        <!-- extend this list with requirements as needed -->
  +        <fail>
  +    +------------------------------------------------------------------------------
  +    |
  +    | ERROR: One of the required properties for maven:ejb was not provided.
  +    |
  +    |        Please ensure that the property maven.j2ee.ejb.name is defined:
  +    |
  +    |        maven.j2ee.ejb.name = ${maven.j2ee.ejb.name}
  +    |
  +    |        and the following files exist:
  +    |
  +    |        ${maven.j2ee.ejb.ejb-xml}
  +    +------------------------------------------------------------------------------
  +        </fail>
  +    </target>
  +        
  +
  +
  +    <target name="ejb-init" if="maven.j2ee.ejb.ready">
  +        <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/"/>
  +    </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">
  +    
  +        <!-- ejb jar is always built -->
  +        <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>
  +      
  +
  +            <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-local" if="maven.j2ee.ejb.local.includes">
  +    
  +        <!-- ejb jar is always built -->
  +        <echo>Building EJB local interface jar for ${maven.j2ee.ejb.name}</echo>
  +        
  +        <!-- in case excludes hasn't been set -->
  +        <property name="maven.j2ee.ejb.local.excludes" value=""/>
  +
  +        <mkdir dir="${maven.j2ee.ejb.target-base}"/>
  +
  +        <jar 
jarfile="${maven.j2ee.ejb.target-base}/${maven.j2ee.ejb.name}-local.jar" index="true">
  +            <fileset dir="${maven.build.dir}/classes"
  +                includes="${maven.j2ee.ejb.local.includes}"
  +                excludes="${maven.j2ee.ejb.local.excludes}" />
  +
  +            <metainf dir="${basedir}">
  +                <include name="LICENSE.txt"/>
  +            </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-remote" if="maven.j2ee.ejb.remote.includes">
  +    
  +        <!-- ejb jar is always built -->
  +        <echo>Building EJB remote interface jar for ${maven.j2ee.ejb.name}</echo>
  +        
  +        <!-- in case excludes hasn't been set -->
  +        <property name="maven.j2ee.ejb.remote.excludes" value=""/>
  +
  +        <mkdir dir="${maven.j2ee.ejb.target-base}"/>
  +
  +        <jar 
jarfile="${maven.j2ee.ejb.target-base}/${maven.j2ee.ejb.name}-remote.jar" index="true">
  +            <fileset dir="${maven.build.dir}/classes"
  +                includes="${maven.j2ee.ejb.remote.includes}"
  +                excludes="${maven.j2ee.ejb.remote.excludes}" />
  +
  +            <metainf dir="${basedir}">
  +                <include name="LICENSE.txt"/>
  +            </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>
       
   </project>
  
  
  
  1.4       +2 -1      
jakarta-turbine-maven/src/templates/build/plugins/j2ee/Control.vm
  
  Index: Control.vm
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/templates/build/plugins/j2ee/Control.vm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Control.vm        22 May 2002 05:12:47 -0000      1.3
  +++ Control.vm        23 May 2002 09:02:24 -0000      1.4
  @@ -13,9 +13,10 @@
   ## -------------------------------------------------------
   $delegators.put("war",          "plugins/$plugin/build.xml")
   $delegators.put("validate-war", "plugins/$plugin/build.xml")
  +$delegators.put("ejb",          "plugins/$plugin/build.xml")
   $delegators.put("ear",          "plugins/$plugin/build.xml")
   
   ## -------------------------------------------------------
   ## Make the list of build-j2ee.xml callbacks
   ## -------------------------------------------------------
  -$callbacks.put( "$plugin", [ "pre-war", "post-war", "pre-validate-war", 
"post-validate-war", "pre-ear",  "post-ear" ] )
  +$callbacks.put( "$plugin", [ "pre-war", "post-war", "pre-ejb", "post-ejb", 
"pre-validate-war", "post-validate-war", "pre-ear",  "post-ear" ] )
  
  
  
  1.2       +28 -0     
jakarta-turbine-maven/src/templates/build/plugins/j2ee/default.properties
  
  Index: default.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-maven/src/templates/build/plugins/j2ee/default.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- default.properties        14 May 2002 17:59:42 -0000      1.1
  +++ default.properties        23 May 2002 09:02:24 -0000      1.2
  @@ -18,3 +18,31 @@
   maven.j2ee.ear.appxml=${maven.conf.dir}/${maven.j2ee.ear.name}-application.xml
   maven.j2ee.ear.includes=*.jar, *.war
   maven.j2ee.ear.excludes=
  +
  +######################
  +#EJB Target Properties
  +######################
  +
  +# Required
  +
  +#maven.j2ee.ejb.name
  +
  +# Defaulted
  +
  +maven.j2ee.ejb.ejb-xml=${maven.conf.dir}/${maven.j2ee.ejb.name}/ejb-jar.xml
  +maven.j2ee.ejb.includes=**
  +maven.j2ee.ejb.excludes=**/package.html
  +
  +# Optional
  +
  +# Include extra files in the ejb jar META-INF directory 
  +#maven.j2ee.ejb.meta-inf-includes=
  +
  +# Local Interfaces Jar
  +#maven.j2ee.ejb.local.includes=**/interfaces/*Local*.class
  +#maven.j2ee.ejb.local.excludes=**/package.html
  +
  +# Remote Interfaces Jar
  +#maven.j2ee.ejb.remote.includes=**/interfaces/*
  +#maven.j2ee.ejb.remote.excludes=**/interfaces/*Local*.class
  +
  
  
  

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

Reply via email to