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: technology
About
thank you.
if found the plugin at http://repo.steademy.com/beta/maven2.
Moo
Can you elaborate on “All referenced jar dependencies will be picked up and aggregated.”? Does that mean all directly referenced dependencies (of any scope) in the POM? Presumably the transitive dependencies are not included?
P.S. I think there is a problem with your HTML formatting (the second POM example is not rendered in pre tags, the first one extends the pre too far and some HTML appears in it).
Thorsten, Thanks for the updates. I’d like to compare notes on how you are using Maven with S2AP. If you want to stay in touch on that fire me an e-mail.
Ill setup a s2ap goes maven within next 10 days. If you would like to have any further information simply send me a mail and ill keep you up-to-date
still not fully used to work with wordpress so pls excuse bad formatting
Hello,
I would be interested in using the maven-par-plugin for pakckaging also war archives together jar bundles.
According to SpringSource, the par format support this.
(cf. also
http://www.springsource.com/beta/applicationplatform/comments.php?DiscussionID=253&page=1#Item_3).
The idea behind this is to package a web application together with those services developed exclusively for that web application.
Best regards, Eric
PS: if the development of this maven plugin is not further pursued, is the source code available somewhere?
Hi westenb,
I will extend the plugin in the requested way.
However it will take a couple of days before I can have my hands on the code.
Ill consequently upload it and add a comment in the s2ap forum.
regards
thorsten
hi,
is there now the possibility to packaging also war archives together with jar’s? and how i ll include it? also over the dependency?
thx & regards
bill
Any chance the source could be made available?
we’ll find a way publishing sources soon …
[...] You probably need to configure a repository to find this plugin: http://repo.steademy.com/beta/maven2. You can find documentation of the maven-par-plugin here. [...]
Hi,
The configuration requires a tag but does not accept values 1.0-SNAPSHOT… why?
sorry .. cannot help on it anymore … maven-par-plugin is deprecated.
I reckon that the springsource guys provide a maven plugin on their own
[...] 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 [...]