Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreShortly after the introduction of SpringSource dm Server (Application Platform at the time), Thorsten Maus created a Maven plugin for creating PAR files. This was a great community contribution and we even used it in the Getting Started Guide for dm Server 1.0.x.
As dm Server's 2.0 milestones have progressed we've been adding new functionality to the PAR file. The most interesting feature is that now a PAR file can contain more than just JAR files. With the introduction of OSGi RFC 66, the dm Server has deprecated Web Modules in favor of the standard Web Container files using a .war extension. Because of this, the PAR plugin needed to be updated to support these different types as dependencies. Thorsten graciously agreed to donate his code to SpringSource and I'm pleased to announce the 1.0.0.M1 release of the Apache Licensed Maven PAR Plugin.
<pluginRepositories>
<pluginRepository>
<id>com.springsource.repository.bundles.milestone</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Milestones</name>
<url>http://repository.springsource.com/maven/bundles/milestone </url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-par-plugin</artifactId>
<version>1.0.0.M1</version>
</plugin>
</plugins>
</build>
By default all of the PAR manifest headers are populated using defaults from the POM but can be overridden with configuration.
Header | POM Element |
---|---|
Application-SymbolicName | ${project.artifactId} |
Application-Name | ${project.name} |
Application-Description | ${project.description} |
Application-Version | ${project.version} |
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-par-plugin</artifactId>
<version>1.0.0.M1</version>
<configuration>
<applicationSymbolicName>override.symbolic.name</applicationSymbolicName>
<applicationName>Override Name</applicationName>
<applicationDescription>Override Description</applicationDescription>
<applicationVersion>1000.0.0.override</applicationVersion>
</configuration>
</plugin>
</plugins>
</build>
There is also a <fullyQualifiedNames/> configuration tag that selects between ${groupId}.${artifactId}-${version}.${type} and ${artifactId}.${type} for the file names of the files contained within the PAR file. This value defaults to false.
<dependencies>
<dependency>
<groupId>com.springsource.dmserver</groupId>
<artifactId>greenpages.app-solution</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.springsource.dmserver</groupId>
<artifactId>greenpages.jpa-solution</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.springsource.dmserver</groupId>
<artifactId>greenpages.db-solution</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.springsource.dmserver</groupId>
<artifactId>greenpages.web-solution</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
</dependencies>
[INFO] [par:par]
[INFO] Assembling Artifacts for PAR 'solution/greenpages/target/greenpages-solution-1.0.0.SNAPSHOT.par'
[INFO] Added 'greenpages.app-solution.jar'
[INFO] Added 'greenpages.jpa-solution.jar'
[INFO] Added 'greenpages.db-solution.jar'
[INFO] Added 'greenpages.web-solution.war'