I have the following folder structure:
project.ear
lib folder
ProjectEJBClient.jar
META-INF folder
projectEJB.jar
My build.xml
contains the following lines to create EAR package
<ear destfile="${build.dir}/myapp.ear" appxml="${src.dir}/metadata/application.xml">
<fileset dir="${build.dir}" includes="ProjectEJBClient.jar"/>
<fileset dir="${build.dir}" includes="projectEJB.jar"/>
</ear>
The above code can't create an EAR package with lib folder which includes the ProjectEJBClient.jar
file
I want to create a lib folder and copy ProjectEJBClient.jar
into that lib folder.
After this process I want to make an EAR project with this lib folder.
I don't know how to create lib folder and copy ProjectEJBClient.jar
into that folder and include this folder into project.ear.
To Build an EAR File Using the Ant Script:Generate the Ant script for each project in the EAR. Generate the Ant script for the EAR project. Change to the Eclipse directory for the EAR project.
Use a zipfileset:
<ear destfile="${build.dir}/myapp.ear" appxml="${src.dir}/metadata/application.xml">
<zipfileset dir="." prefix="lib">
<include name="ProjectEJBClient.jar"/>
</zipfileset>
<fileset dir="${build.dir}" includes="projectEJB.jar"/>
</ear>
The prefix="lib"
will make sure, that the jar will be under /lib
in your ear.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With