A simple maven plugin for Glassfish: asadmin-maven-plugin
I published some days ago a maven plugin that simply wraps the asadmin command and aims to provide maven integration for starting, stopping glassfish and deploying and undeploying applications and modules.
The api is designed for easy extensibility so feel free to submit contributions !
Install the jar provided in the download section in your local repository and add this to your pom :
<build> <plugin> <groupId>org.n0pe.mojo</groupId> <artifactId>asadmin-maven-plugin</artifactId> <version>0.1-SNAPSHOT</version> </plugin> </build>
Check that either AS_HOME or GLASSFISH_HOME environment variables are set to your SJAS/Glassfish installation folder.
You can now use the following commands :
- mvn asadmin:start-database
- mvn asadmin:start-domain
- mvn asadmin:deploy
- mvn asadmin:undeploy
- mvn asadmin:stop-domain
- mvn asadmin:stop-database
By default the asadmin-maven-plugin use the following settings :
- user: admin
- password-file: ~/.asadmintruststore
- admin-host: localhost
- admin-port: 4848
- domain: domain1
You can override all theses settings in the plugin configuration section in your pom.xml. Full documentation will soon be provided but if you have a maven aware editor, you will get completion on available options.
By default again, the deploy and undeploy mojos use the archive (jar/war/ear) produced by your maven project and deploy it using your project’s artifactId as module name.
The next step is to provide user and developer documentation.