Hi Chris, I was looking for copying jar files into war file using maven. Ur ant plugin helped me a lot to accomplish tht task.
Thank u very much Regards, Satheesh chris.r.grigg wrote: > > Hi, > > I have been scratching my head on this one for awhile. > > We have an applet which the class files are packaged up into a JAR file. > This JAR file is then packaged up inside a WAR file which then gets > packaged in an EAR file so that it can be deployed onto Websphere > Application Server 6.1 (our web app server). > Now in order for the JAR file to be seen on the clients end (not on the > web server we are deploying the war file to), the JAR file must not live > inside the "WEB-INF\lib" directory. The JAR file must sit inside the root > directory of the WAR. This allows the user to access the JAR file and > download it to their PC > instead of the JAR file being processed server sidedly so that they can > access the JAR that has the applet and run the applet client sidedly. > > It appears that something did exist for maven 1.0 in the WAR building > goal, but it was removed in maven 2.0. So now in order to manually put > this file, i have to do some ugly ant script in the artifact which builds > the WAR file, like this: > > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-antrun-plugin</artifactId> > <executions> > <execution> > <id>move-jars</id> > <phase>package</phase> > <configuration> > <tasks> > <echo message="***Unzipping > war***" /> > <unzip > src="${project.build.directory}/${artifactId}-${version}.war" > dest="${basedir}/tmp"> > > <patternset> > <include name="**" > /> > </patternset> > </unzip> > <echo message="***war unzipped***" > /> > <move > todir="${basedir}/tmp"> > <fileset > dir="${basedir}/tmp/WEB-INF/lib"> > <include > name="**/*.jar" /> > </fileset> > </move> > <echo message="***Deleting > old war***" /> > <delete > file="${project.build.directory}/${artifactId}-${version}.war" /> > <delete > includeEmptyDirs="true"> > <fileset > dir="${project.build.directory}/${artifactId}-${version}" /> > </delete> > <echo message="***Creating > new war***" /> > <zip > destfile="${project.build.directory}/${artifactId}-${version}.war" > basedir="${basedir}/tmp" update="true" /> > <echo > message="***Unzipping new war***" /> > > <unzip > src="${project.build.directory}/${artifactId}-${version}.war" > dest="${project.build.directory}/${artifactId}-${version}"> > <patternset> > <include > name="**" /> > </patternset> > </unzip> > <echo message="***Deleting > tmp dir***" /> > <delete > includeEmptyDirs="true"> > <fileset > dir="${basedir}/tmp" /> > </delete> > </tasks> > </configuration> > <goals> > <goal>run</goal> > </goals> > </execution> > </executions> > </plugin> > > > Does anyone know a more better solution to achieving this? > > *********************************************************************** > WARNING: This e-mail (including any attachments) may contain legally > privileged, confidential or private information and may be protected by > copyright. You may only use it if you are the person(s) it was intended > to be sent to and if you use it in an authorised way. No one is > allowed to use, review, alter, transmit, disclose, distribute, print > or copy this e-mail without appropriate authority. > > If this e-mail was not intended for you and was sent to you by mistake, > please telephone or e-mail me immediately, destroy any hardcopies of > this e-mail and delete it and any copies of it from your computer > system. Any right which the sender may have under copyright law, and > any legal privilege and confidentiality attached to this e-mail is not > waived or destroyed by that mistake. > > It is your responsibility to ensure that this e-mail does not contain > and is not affected by computer viruses, defects or interference by > third parties or replication problems (including incompatibility with > your computer system). > > Opinions contained in this e-mail do not necessarily reflect the > opinions of the Queensland Department of Main Roads, Queensland > Transport or Maritime Safety Queensland, or endorsed organisations > utilising the same infrastructure. > *********************************************************************** > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Building-Applet-JARS-inside-WAR-files-using-Maven-2.0-tp16268092s177p16930326.html Sent from the Maven Developers mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]