ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mattos, John" <>
Subject RE: Websphere (WAS) doesn't like my EAR file from ANT
Date Tue, 02 Sep 2003 20:48:15 GMT
Oh but as a side now, I've been very successful generating EAR files that
are deployable to WebSphere 4.0.3. I'm happy to share how I did it.

Essentially, I just use the JAR task to create the EAR file


Here is a snippet...

	<!-- Initialize -->
	<target name="init">
   		<!-- Create the build directory structure used by compile
    	<mkdir dir="${src}"/>
      		<format property="backup.dateTime" pattern="MMMM-dd-yyyy
hh-mm-ss aa"/>
	<!-- Get code from CVS -->
	<target name="cvsByTag" description="get a specific tag from CVS" >

		<copy file="./build.number" tofile="./build.details"/>
		<replace file="build.details" 
  			value="Tag= ${indab.label}; build.number="/>
		<echo message="Using cvsRoot	=${cvsRoot}"/>
		<echo message="Using cvsRsh		=${cvsRsh}"/>
		<echo message="Using Dest		=${src}"/>
		<echo message="Using passFile	=${passFile}"/>
		<echo message="Using Label		=${indab.label}"/>
     	<cvs command="checkout -N" cvsRoot="${cvsRoot}" cvsRsh="${cvsRsh}"
compressionlevel="9" tag="${indab.label}"
     		passfile="${passFile}" package="indabWeb" dest="${src}"/>
     	<cvs command="checkout -N" cvsRoot="${cvsRoot}" cvsRsh="${cvsRsh}"
compressionlevel="9" tag="${indab.label}"
     		passfile="${passFile}" package="indab" dest="${src}"/>
  	<!-- Compile -->
  	<target name="compile">
    	<mkdir dir="${build}"/>
    	<echo message="Classpath is :${classpath}"/>
    	<javac srcdir="${cvssrc}" destdir="${build}" 
    			classpath="${classpath}" failonerror="true"
compiler="modern" debug="on"/>
     	<copy file="${cvssrc}/log4j.lcf" todir="${WEB-INF}/classes"/>

	<!-- Jar -->
	<target name="jar">
		<jar destfile="${WEB-INF}/lib/indab.jar" 
	    	<fileset dir="${WEB-INF}/classes">
	       	<include name="**/*.class"/>
	<!-- War -->	
	<target name="war">
    	<mkdir dir="${dist}"/>
    	<!-- Place the classes in a jar in the lib directory -->
    	<antcall target="jar"/>
    	<jar destfile="${dist}/indabWeb.war" 
  	<!-- Ear -->
  	<target name="ear">
    <!-- Copy the xmi files -->
    	<mkdir dir="${eartemp}/applicationResources/"/>
    	<mkdir dir="${eartemp}/applicationResources/META-INF"/>
    	<move todir="${eartemp}/applicationResources/META-INF">
      		<fileset dir="${meta-inf}">
        		<include name="application.xml"/>
      			<include name="*.xmi"/>
      			<include name=".modulemaps"/>
      		<fileset dir=".">
        		<include name="build.details"/>
    	<!-- copy other files in the EAR file -->
    	<move todir="${eartemp}/applicationResources/">
      		<fileset dir="${src}/indab/">
      			<include name=".serverPreference"/>
      			<include name=".vcm_meta"/>
    	<copy file="${dist}/indabWeb.war"
    	<!-- Perform the jar (ear) command -->
    	<jar destfile="${dist}/indabEar.ear"
    	<!-- Delete the stuff we used to create it, may comment this out to
see the contents of the ear-->
   	 	<delete dir="${eartemp}"/>
-----Original Message-----
From: Lopez, William [] 
Sent: Tuesday, September 02, 2003 4:24 PM
To: Ant Users List
Subject: RE: Websphere (WAS) doesn't like my EAR file from ANT


If you want to go offline with this I'd be glad to share what we do, a hack
sort-of, to get around this...supposedly, this incompatibility will be
corrected in version 5 of WAS.


-----Original Message-----
From: Nick Neuberger [] 
Sent: Tuesday, September 02, 2003 2:54 PM
To: ''
Subject: Websphere (WAS) doesn't like my EAR file from ANT

For some reason, when I "install" an EAR file generated from ANT, websphere
Advanced Edition v4.0.3 doesn't like it when its installed. cannot save the ear file.

Has anyone else experienced problems creating an EAR file from ANT and
installing it into WebSphere?

I found a support article at that said the websphere application
assembly tool (AAT) is about the only way to properly generate an EAR file.
This would not be good.  PQ53148: J2EE EAR FILE DEPLOYMENT FAILURE

My EAR file consists of the standard stuff.  (about 28 jar files, and 1
*.war file).  If we generate the EAR file via AAT, then Websphere installs
the EAR just fine.

Any thoughts?


Nick Neuberger
Programmer / Analyst
IS Department
Safety National Casualty Corporation

- - - - - - 
This e-mail message is intended only for the use of the individual or entity
identified in the alias address of this message and may contain confidential
and privileged information. Any unauthorized review, use, disclosure or
distribution of this e-mail message is strictly prohibited. If you have
received this e-mail message in error, please notify the sender immediately
by reply e-mail and delete this message from your system. Thank you.

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message