• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Problems creating the Struts 2 application, with Ant to build the application.

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am a newbie to Struts and was following the Apache Struts 2 documentation. But my process of learning halted right at the Step 2 and cant proceed further. Apache Struts 2 documentation
If you follow the link, you will see that the Step 2 mentions about Running the Ant target that creates the WAR file. I have no idea how to run the Ant target and deploy.
Basically all I want to know is to deploy a struts application on to tomcat server using Ant and eclipse. How do I do that?
 
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch !

If you have "Ant" installed, use the following command where you have the "build.xml"

say your project build.xml is in C:\Documents and Settings\MyProject\
then open up the console and type ->


it should start building a "war/ear/jar" file at the given location inside your build.xml.

Hope that helps.

Happy Programming
 
Agooner kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Robin,
Thanks for the reply. I am using the build.xml file from the example project of Struts documentation. I was running the build.xml file as "Run As Ant Build" from Eclipse and I got the following error:

BUILD FAILED
C:\HeliosSpace\Basic_Struts2_Ant\build.xml:69: srcdir "C:\HeliosSpace\Basic_Struts2_Ant\${source.home}" does not exist!


Can you please tell me, what I am missing out here. Also it seems very few material is available on how we can deploy an application and WAR file. Any resources you can point me to would be helpful.

PS: Tried attaching the build.xml file, but I was unable to do so. Not even .txt extension.

Thanks,
AG.




 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well you can always copy / paste the contents of the xml file using Code tags in the forum if you cant attach the file.
The sample build.xml file should have all the contents that you need. The source.home property should be defined in a file called "build.properties".

and try using the command prompt instead of eclipse.. we can separate out the "ant" and "eclipse" related issues then..
 
No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic