eskatos's thoughts

Posts Tagged ‘maven

Maven, help-plugin and continuous integration

without comments

MavenWhen a maven build fails in continuous integration you often end up reading the console output, sometimes browsing kilobytes of text (yes, maven outputs a lot and can seem chaotic). To ease build debugging you can tell maven to output some introspectional data.

The idea is to use the maven-help-plugin a lot but you can add others and home made ones to the mix. To quickly see what can easily get outputed my maven you can play with the following commands :


mvn help:system
mvn help:active-profiles
mvn help:effective-settings
mvn help:effective-pom

Here is a sample output of the active-profiles goal :

[INFO] ------------------------------------------------------------------------
[INFO] Building my-project
[INFO] task-segment: [help:active-profiles] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [help:active-profiles]
[INFO]
Active Profiles for Project 'myGroupId:myArtifactId:jar:0.1.0-SNAPSHOT':

The following profiles are active:

- continuous-integration (source: settings.xml)
- libs-daily (source: pom)

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------

Adding such output at the very start of builds is really handy when setting up a CI service or during build refactorings.

Note that if a profile is defined in a parent pom it won’t be shown as activated in submodules by help:active-profiles but if you read the help:effective-pom output on one of the modules you’ll see it’s effectively activated, see this comment in MNG-3228.

Hope this helps.

If you read this, you certainly want to read Maven Continuous Integration Best Practices.

Written by eskatos

October 28, 2009 at 9:57 pm

jaroverlay-maven-plugin is dead, long live truezip-maven-plugin

without comments

MavenI think I was the only humain being using my jaroverlay-maven-plugin.

Now that truezip-maven-plugin has been published I refactored my builds to use it. It is not only working but it’s both quicker and cleaner with this plugin.

As a consequence I discontinue jaroverlay-maven-plugin development.

Written by eskatos

April 23, 2009 at 9:07 am

Posted in Projects, Tools

Tagged with , ,

A maven plugin to repackage your java archives : jaroverlay-maven-plugin

with 2 comments

MavenIn the Java EE 5 TutorialDevelopment Roles” chapter we can see the following three roles, from the code to the deployment :

  • Application Component Provider: “The application component provider is the company or person who creates web components, enterprise beans, applets, or application clients for use in Java EE applications.”
  • Application Assembler: “The application assembler is the company or person who receives application modules from component providers and assembles them into a Java EE application EAR file.”
  • Application Deployer and Administrator: “The application deployer and administrator is the company or person who configures and deploys the Java EE application …”

This page says that this is the Application Assembler job to configure the deployment descriptor before packaging the EAR.

Beside that, artifact produced by mavenized enterprise projects are EARs, already packaged. Plus, it often is the developer (or Application Component Provider) that write the packaging configuration.

Next comes the “configuration for deployment” time. Here, if deployment dependant configuration is in deployment descriptors you would have to unpack the EAR and possibly nested java archives (WARs and/or JARs) to get a hand on all deployment descriptors.

This task can be quite cumbersome and time consuming (really dumb too). Read the rest of this entry »

Written by eskatos

August 3, 2008 at 6:32 pm

Posted in Projects

Tagged with ,

asadmin-maven-plugin-0.2 released

with 3 comments

GlassfishI released the second version of asadmin-maven-plugin today.

It added the following features :

  • Issue#1: support for maven projects with “ejb” packaging
  • support for (un)deploying to remote glassfish instance (thanks to Larry Sanderson that provided the patch)

The following issues were fixed :

  • Issue#2: asadmin is not found when only glassfishHome is specified and glassfishHome/bin not in PATH (thanks to streifi that provided a patch)
  • Issue#3: asadmin:start-domain hangs on windows (thanks again to streifi)

Go to the project’s page for more information.

Written by eskatos

July 20, 2008 at 5:45 pm

Posted in Projects

Tagged with , ,

Maven plugins for Glassfish ecosystem

with 7 comments

GlassfishThis post is only a snapshot of what is available at the time of writing to use Glassfish from maven., seen from the perspective of a simple maven plugin developer (simple plugin or simple developer ?).

Before beginning asadmin-maven-plugin, I searched and tried several ways to use Glassfish from maven. Main use case is simply deployment and undeployment of applications.

There are two ways to do this “programmatically” :

  • using the asadmin command, Glassfish specific,
  • and using the JSR-88 api, app-server agnostic

Read the rest of this entry »

Written by eskatos

March 28, 2008 at 12:31 am

Posted in Projects

Tagged with , , ,

A repository for asadmin-maven-plugin

without comments

GlassfishTo ease the use of asadmin-maven-plugin I have set up a public repository that you can add to your maven settings / poms / proxies for maven to be able to download the plugin automagically.

The repositories are :

Here is the xml snippet you could add to your pom.xml file :

    <pluginRepositories>
        <pluginRepository>
            <id>asadmin-maven-plugin-releases-repository</id>
            <name>asadmin-maven-plugin-releases-repository</name>
            <url>http://asadmin-maven-plugin.googlecode.com/svn/trunk/repository/releases</url>
            <releases><enabled>true</enabled></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>asadmin-maven-plugin-snapshots-repository</id>
            <name>asadmin-maven-plugin-snapshots-repository</name>
            <url>http://asadmin-maven-plugin.googlecode.com/svn/trunk/repository/snapshots</url>
            <releases><enabled>false</enabled></releases>
            <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
    </pluginRepositories>

Plus, if you browse the source tree you’ll find two exemple projects, a WAR and an EAR, that use this plugin.

Written by eskatos

March 26, 2008 at 12:30 am

Posted in Projects

Tagged with , , ,

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

with 2 comments

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 !
Read the rest of this entry »

Written by eskatos

March 24, 2008 at 4:30 pm

Posted in Projects

Tagged with , ,

Building an EJB3 app using GlassFish v2, Maven2 and NetBeans 6

without comments

In an article explicitly titled Building an EJB 3.0 application using GlassFish v2, Apache Maven 2 and NetBeans IDE 6.0, Jacek Laskowski explain in detail how Netbeans 6 can be used by maven users willing to use GlassFish as an EJB3 container.

I’m currently doing these type of things with Netbeans 6 but I didn’t know it was feasible with so few command line maven invocations.

Written by eskatos

October 10, 2007 at 11:41 pm

Posted in Tools

Tagged with , , , , ,