Skip to content
 

Deploying an app on Glassfish via Apache Ant

So you want to deploy onto Glassfish 3 using apache ant?

One very simple method to use is the following:

glassfish + ant(!)

<java jar=”${path.J2EE}/../modules/admin-cli.jar” fork=”true”>
<arg line=”deploy –force=true warnamehere.war”/>
</java>
Here ${path.J2EE} points to the app server’s library directory -> glassfish/lib


This simply invokes glassfish’s deployment mechanism using one of the glassfish admininstration jars. It is not quite as neat as using an Ant task, however I had trouble doing this with Glassfish 3 which is what I am running on my development machine.

Leave a Reply