Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ECLIPSE, ANT and generating WAR files...

Status
Not open for further replies.

robich74

Programmer
Jan 5, 2006
4
IT
Hi all.

I'm trying to configure my Eclipse Ant Builder, so that I can have the WAR of my web-app generated in a single task.

The "build.xml" that Eclipse generates as a result of the "Export" task does good (obviously!), but I'd like to add a "generate-war" task, which (depending on the "build" task) should also create the WAR, adding all the needed resources into it.

The problem I'm facing is about the external libraries that I want to be included in the "WEB-INF/lib" directory of the WAR.

Infact, I'd like them to be "loaded" directly from the classpath, that is directly from the "path" element created by eclipse during the Export task.

So, in "build.xml" I have:

Code:
    <path id="MyWebApp.classpath">
        <path refid="Database.userclasspath"/>
        <path refid="JavaHelp.userclasspath"/>
        ...
        ...
    </path>
where, for example:

Code:
    <path id="Database.userclasspath">
        <pathelement location="path-to-jar"/>
        <pathelement location="path-to-another-jar"/>
    </path>

And in "build-user.xml" I want to make a target capable of copying all the jars referenced by "MyWebApp.classpath", discovering them automatically.

The problem is that the "copy" tasks need a fileset or a dir, whereas what I have is a path reference...

Has anyone been involved in the same?
Thanks in advance for your help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top