A simple maven plugin for Glassfish: asadmin-maven-plugin

GlassfishTo seamlessly use Glassfish from maven projects, JSR-88 seems to be answer. The cargo maven plugin has JSR-88 support planned but this will take time.

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.

Go to the Google Code page of asadmin-maven-plugin to download a preview version named asadmin-maven-plugin-0.1-SNAPSHOT : http://code.google.com/p/asadmin-maven-plugin/

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.

Advertisements

2 thoughts on “A simple maven plugin for Glassfish: asadmin-maven-plugin

  1. quote: Install the jar provided in the download section in your local repository

    I cannot find any docs about a download section in my repository. Can you point me to something, please?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s