Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #19789

problem creating WAR file with ant

From Laura Schmidt <ls@mailinator.com>
Newsgroups comp.lang.java.programmer
Subject problem creating WAR file with ant
Date 2012-11-18 17:53 +0100
Organization (posted via) M-net Telekommunikations GmbH
Message-ID <k8b3pr$7k7$1@news.m-online.net> (permalink)

Show all headers | View raw


Hello,

I have a web project W, which uses a java library L. This "usage" is 
based on the eclipse confguration: I just told eclipse that W uses L. 
Since then, the java compiler finds the source files of L when compiling W.

I delpoy the web project as a war file using ant:

  <target name="buildwar">
   <war basedir="war" destfile="myproject.war"
	webxml="war/WEB-INF/web.xml">
   </war>

When I deploy this war file to a tomcat server, the class files of L are 
missing.

I tried to resolve this by adding a symbolic link pointing from 
$W/WEB-INF/classes to $L/classes. This worked, but after some rebuilds 
this link was deleted somehow. I assume that the contents of 
$w/WEB-INF/classes is deleted sometimes by some build procedures.

Then, I tried to add the dependency in the ant file:

  <target name="buildwar">
   <war ...>
    <fileset dir="path/to/L/classes"/>
   </war>
  </target>

But this also didn't work.

Within the produced war file, the class files of L were in the root 
directory. I believe that the class files should be placed into the 
WEB-INF/classes directory of the war file.

However, this problem cannot be new and there must be a standard way to 
do it. I would be glad if someone can tell me how to do it right.

Thanks
Laura

Back to comp.lang.java.programmer | Previous | NextNext in thread | Find similar | Unroll thread


Thread

problem creating WAR file with ant Laura Schmidt <ls@mailinator.com> - 2012-11-18 17:53 +0100
  Re: problem creating WAR file with ant Arne Vajhøj <arne@vajhoej.dk> - 2012-11-18 12:01 -0500
    Re: problem creating WAR file with ant Laura Schmidt <ls@mailinator.com> - 2012-11-19 04:21 +0100
      Re: problem creating WAR file with ant Lew <lewbloch@gmail.com> - 2012-11-18 20:18 -0800
      Re: problem creating WAR file with ant Arne Vajhøj <arne@vajhoej.dk> - 2012-11-19 09:41 -0500

csiph-web