• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using Ant with Websphere v6.0

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could anyone give me step by step instructions to create ant files for my dynamic web project. Right now I have only one jsp file in this study purpose project. I am using websphere version 6.0. my project structure is:
..+ StudyJsp
. |........JavaSource
. |.......+ JRE System Library[WebSphere v6 JRE]
. |.......+ WebShere v6.0 Runtime
. |.......+ WebContent
. |.....+ META-INF
. |.....+ WEB-INF
. | |...lib
. |
. |......example.jsp
.
.
+ StudyJspEAR
|......META-INF
|...application.xml

I pluged in jboss 4.0 and it is running without any problem. Only I need is how to create .EAR file with using Ant and then deploy it?

Thanks
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ant isn't all that magical. It essentially is a command-line tool based on XML similar in concept to what you might have created using a make file in java.

An EAR is identical to a JAR/ZIP file except that it has a .ear extension. If your directory structure is all ready defined such that just creating an EAR works fine, then all your ant script would have to do is a single store command which copies all the files/directories into a new ear file.

Deploying can vary. In JBoss and WebLogic for example, you can install a new EAR by copying the file into an applications folder, so ANT would just execute a copy command. In WebSphere, its not as easy since you need to integrate with the WSADMIN scripting tool. You might want to review this link for some guidance:

http://publib.boulder.ibm.com/infocenter/wasinfo/v5r1//index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/javadoc/ae/com/ibm/websphere/ant/tasks/InstallApplication.html

The real power of ANT is dynamic variable naming. So rarely in an ANT script to you put the hardcoded path or application name, most of the time you define everything in terms of variables and either put these at the beginning of the ANT file or define them as environment variables.
 
Scott Selikoff
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, I mentioned 'if your directory is set up as an EAR all ready', most people use ANT in such a way that this is not the case. For example, some libraries are on the network, others are local, some XML files need to be modified/created, etc. So more powerful scripts take loosely coupled sets of data and build them into single sets of files often using a temporary folder for intermediate steps.

Ant scripts don't need to be this powerful, its based more on your development strategy such as which IDE you are using, etc.
 
Never trust an airline that limits their passengers to one carry on iguana. Put this tiny ad in your shoe:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic