Class BundleDeployFileMojo

  extended by org.apache.maven.plugin.AbstractMojo
      extended by
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class BundleDeployFileMojo
extends org.apache.maven.plugin.AbstractMojo

Deploy a JAR representing an OSGi Bundle. This method posts the bundle built by maven to an OSGi Bundle Repository accepting the bundle. The plugin uses a multipart/format-data POST request to just post the file to the URL configured in the obr property.

Field Summary
Fields inherited from interface org.apache.maven.plugin.Mojo
Constructor Summary
Method Summary
protected changeVersion( file, java.lang.String oldVersion, java.lang.String newVersion)
          Change the version in jar
 void execute()
          Execute this Mojo
protected fixBundleVersion( jarFile)
          Optionally fixes up the version of the bundle given in the jar File.
protected  java.lang.String getBundleSymbolicName( jarFile)
          Returns the symbolic name of the given bundle.
protected  java.lang.String getJarFileName()
          Returns the path and name of the jar file containing the bundle to be uploaded.
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public BundleDeployFileMojo()
Method Detail


protected java.lang.String getJarFileName()
                                   throws org.apache.maven.plugin.MojoExecutionException
Returns the path and name of the jar file containing the bundle to be uploaded. This method always returns a non-null name but throws a MojoExecutionException if the name is not known.

The name of the file to be uploaded, this is never null.
org.apache.maven.plugin.MojoExecutionException - If the name of the file is not known because it might not have been configured.


protected fixBundleVersion( jarFile)
Optionally fixes up the version of the bundle given in the jar File. If no version fixup is required the jarFile may just be returned.

jarFile - The file whose bundle version should be fixed
The file containing the fixed version or jarFile if the version was not fixed.


public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Execute this Mojo



protected changeVersion( file,
                                     java.lang.String oldVersion,
                                     java.lang.String newVersion)
                              throws org.apache.maven.plugin.MojoExecutionException
Change the version in jar

newVersion -
file -


protected java.lang.String getBundleSymbolicName( jarFile)
Returns the symbolic name of the given bundle. If the jarFile does not contain a manifest with a Bundle-SymbolicName header null is returned. Otherwise the value of the Bundle-SymbolicName header is returned.

This method may also be used to check whether the file is a bundle at all as it is assumed, that only if the file contains an OSGi bundle will the Bundle-SymbolicName manifest header be set.

jarFile - The file providing the bundle whose symbolic name is requested.
The bundle's symbolic name from the Bundle-SymbolicName manifest header or null if no manifest exists in the file or the header is not contained in the manifest. However, if null is returned, the file may be assumed to not contain an OSGi bundle.

Copyright © 2007-2009. All Rights Reserved.