Build Struts 1.X project using Ant and Eclipse
I have a war (built using Struts 1.x drums) that was deployed to the server but has no corresponding source, so I basically extracted the .class files from the jar and decompiled them and tried to build the source (project) and commit to the repository.
So, I want to create a Struts 1.x project using the Ant tool , import it into the Eclipse IDE , and then create a war.
I tried the following:
1. Created a dynamic web project and added drums struts
New -> Other -> Web - >Dynamic Web Project
Updated web.xml & created struts-config.xml under WEB-INF
Then struts jars were added to build path
2. Created an Ant build file for an existing project
Select File > Export from main menu<br/>
In the Export dialog, select General > Ant Buildfilesas follows:
Click Next. In the Generate Ant Buildfilesscreen:
Check the project in list.
Uncheck the option "Create target to compile project using Eclipse compiler" because we want to create a build file which is independent of Eclipse.
Leave the Name for Ant buildfile as default: build.xml
Click Finish, Eclipse will generate the build.xmlfile
3. Run Ant build to build the war.
Is this the correct way to build a war with the Ant tool? Or is there another way?
source to share
You need to create Target for bulding war file:
see this link http://www.tutorialspoint.com/ant/ant_creating_war_files.htm
to create a target to create a war file.
source to share