maven-par-plugin

OSGI, technology May 29th, 2008

Introduction
The maven-par-plugin was designed to allow developers create s2ap compliant par packages and deploy them to the platform. This plugin might not work for any other purpose.

Usage

A long howto is not required as the purpose of this plugin should be clear. Thus I will concentrate on the configuration and a simple usage pattern.

The infrastructure pom.xml acts as an example of how this plugin is used on our platform.
The initial directory structure looks like:

infrastructure
  | --> hsqldb
  | --> par

par/pom.xml

      

              4.0.0
              infrastructure-par
              ${service.version}
              S2AP Par bundle
par
              So long and thanks for all the fish
              
         
           steademy
           Staademy repository
           http://repo.steademy.com/beta/maven2
         
       

                com.steademy.service.infrastructure
                parent
                SNAPSHOT
              

              
                      
                              com.steademy.service.infrastructure
                              hsqldb
                              ${service.version}
                      
              

              


                    org.apache.maven.plugins
                    maven-par-plugin
                    0.2.0
                    
                       true
                       com.steademy.service.infrastructure
                       1.0.0
                       The db infrastructure
                       Application DB infrastructure
                   
                 
              
             
      

The repository

In order to properly use the maven-par-plugin, you have to pick it up from our repository.
The following repository entry must be added to your pom’s repository entries:

     
          
            steademy
            Steademy repository
            http://repo.steademy.com/beta/maven2
          
       

The packaging must be changed to par.

par

Dependencies
The par/pom.xml simply aggregates all direct dependencies it finds. It does neither care about scopes nor indirect dependencies.

Plugin configuration


        org.apache.maven.plugins
        maven-par-plugin
        0.2.0
        
             true
             com.steademy.service.infrastructure
             1.0.0
             The db infrastructure
             Application DB infrastructure
        
     

Explaining the tags in right order:

1. groupId -> We use the default maven groupId
2. artifactId -> Do I need to tell you about it ???
3. version -> latest “stable” version is 0.2.0

You will use the configuration in order to describe the final .par related META-INF/MANIFEST.MF file.
The tags applicationSymbolicName, applicationVersion, applicationDescription & applicationName have been defined and set mandatory by the springsource guys. Our plugin will pickup your personal settings and create the MANIFEST.MF file accordingly.

The fqn (fully qualified naming) allows to create artifact files using the pattern

${groupId}.${artifactId}

Example:
Our infrastructure par with fqn=true looks echos the following log entries:

[INFO] infrastructure-par
[INFO] artifact hsqldb is copied with fully qualified name com.steademy.service.infrastructure.hsqldb-SNAPSHOT
[INFO] added com.steademy.service.infrastructure.hsqldb-SNAPSHOT.jar
[INFO] [install:install]
[INFO] Installing /home/tmaus/workspaces/beta-01/infrastructure/par/target/infrastructure-par-SNAPSHOT.par to /home/tmaus/.m2/repository/com/steademy/service/infrastructure/infrastructure-par/SNAPSHOT/infrastructure-par-SNAPSHOT.par

The same maven build using fqn=false would produce the following log:

[INFO] infrastructure-par
[INFO] added hsqldb.jar
[INFO] [install:install]
[INFO] Installing /home/tmaus/workspaces/beta-01/infrastructure/par/target/infrastructure-par-SNAPSHOT.par to /home/tmaus/.m2/repository/com/steademy/service/infrastructure/infrastructure-par/SNAPSHOT/infrastructure-par-SNAPSHOT.par

Switching this tag to true increases the readability of the deployed bundles within your s2ap/admin extremely.

So long and thanks for all the fish

t.maus

Tags: