org.apache.felix.bundleplugin
Class BundlePlugin

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.felix.bundleplugin.BundlePlugin
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
AntPlugin, ManifestPlugin

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

Create an OSGi bundle from Maven project


Field Summary
protected  java.lang.String classifier
          Classifier type of the bundle to be installed.
protected  java.lang.String excludeDependencies
          Comma separated list of artifactIds to exclude from the dependency classpath passed to BND (use "true" to exclude everything)
protected  java.io.File manifestLocation
          Directory where the manifest will be written
protected  boolean unpackBundle
          When true, unpack the bundle contents to the outputDirectory
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
BundlePlugin()
           
 
Method Summary
protected  aQute.lib.osgi.Builder buildOSGiBundle(org.apache.maven.project.MavenProject currentProject, java.util.Map originalInstructions, java.util.Properties properties, aQute.lib.osgi.Jar[] classpath)
           
protected  java.lang.String convertVersionToOsgi(java.lang.String version)
          Convert a Maven version into an OSGi compliant version
protected static void dumpClasspath(java.lang.String title, java.util.List classpath, org.apache.maven.plugin.logging.Log log)
           
protected static void dumpInstructions(java.lang.String title, java.util.Properties properties, org.apache.maven.plugin.logging.Log log)
           
protected static void dumpManifest(java.lang.String title, java.util.jar.Manifest manifest, org.apache.maven.plugin.logging.Log log)
           
 void execute()
           
protected  void execute(org.apache.maven.project.MavenProject currentProject, java.util.Map originalInstructions, java.util.Properties properties)
           
protected  void execute(org.apache.maven.project.MavenProject currentProject, java.util.Map originalInstructions, java.util.Properties properties, aQute.lib.osgi.Jar[] classpath)
           
protected  java.lang.String getBuildDirectory()
           
protected  java.lang.String getBundleName(org.apache.maven.project.MavenProject currentProject)
          TODO this should return getMaven2Osgi().getBundleFileName( project.getArtifact() )
protected  aQute.lib.osgi.Jar[] getClasspath(org.apache.maven.project.MavenProject currentProject)
           
protected  java.util.Properties getDefaultProperties(org.apache.maven.project.MavenProject currentProject)
           
protected static java.util.Collection getEmbeddableArtifacts(org.apache.maven.project.MavenProject project, aQute.lib.osgi.Analyzer analyzer)
           
protected  java.io.File getFile(org.apache.maven.artifact.Artifact artifact)
          Get the file for an Artifact
protected  org.apache.maven.shared.osgi.Maven2OsgiConverter getMaven2OsgiConverter()
           
protected  java.io.File getOutputDirectory()
           
protected  org.apache.maven.project.MavenProject getProject()
           
protected static void includeMavenResources(org.apache.maven.project.MavenProject currentProject, aQute.lib.osgi.Analyzer analyzer, org.apache.maven.plugin.logging.Log log)
           
protected  void mergeMavenManifest(org.apache.maven.project.MavenProject currentProject, aQute.lib.osgi.Jar jar, java.lang.String[] removeHeaders, org.apache.maven.plugin.logging.Log log)
           
protected static java.lang.String removeTagFromInstruction(java.lang.String instruction, java.lang.String tag)
           
protected  void setBasedir(java.io.File _basedir)
           
protected  void setBuildDirectory(java.lang.String _buildirectory)
           
protected  void setMaven2OsgiConverter(org.apache.maven.shared.osgi.Maven2OsgiConverter maven2OsgiConverter)
           
protected  void setOutputDirectory(java.io.File _outputDirectory)
           
protected static java.util.Map transformDirectives(java.util.Map originalInstructions)
           
 
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
 

Field Detail

manifestLocation

protected java.io.File manifestLocation
Directory where the manifest will be written


unpackBundle

protected boolean unpackBundle
When true, unpack the bundle contents to the outputDirectory


excludeDependencies

protected java.lang.String excludeDependencies
Comma separated list of artifactIds to exclude from the dependency classpath passed to BND (use "true" to exclude everything)


classifier

protected java.lang.String classifier
Classifier type of the bundle to be installed. For example, "jdk14". Defaults to none which means this is the project's main bundle.

Constructor Detail

BundlePlugin

public BundlePlugin()
Method Detail

getMaven2OsgiConverter

protected org.apache.maven.shared.osgi.Maven2OsgiConverter getMaven2OsgiConverter()

setMaven2OsgiConverter

protected void setMaven2OsgiConverter(org.apache.maven.shared.osgi.Maven2OsgiConverter maven2OsgiConverter)

getProject

protected org.apache.maven.project.MavenProject getProject()

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException
See Also:
Mojo.execute()

execute

protected void execute(org.apache.maven.project.MavenProject currentProject,
                       java.util.Map originalInstructions,
                       java.util.Properties properties)
                throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

transformDirectives

protected static java.util.Map transformDirectives(java.util.Map originalInstructions)

execute

protected void execute(org.apache.maven.project.MavenProject currentProject,
                       java.util.Map originalInstructions,
                       java.util.Properties properties,
                       aQute.lib.osgi.Jar[] classpath)
                throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

buildOSGiBundle

protected aQute.lib.osgi.Builder buildOSGiBundle(org.apache.maven.project.MavenProject currentProject,
                                                 java.util.Map originalInstructions,
                                                 java.util.Properties properties,
                                                 aQute.lib.osgi.Jar[] classpath)
                                          throws java.lang.Exception
Throws:
java.lang.Exception

dumpInstructions

protected static void dumpInstructions(java.lang.String title,
                                       java.util.Properties properties,
                                       org.apache.maven.plugin.logging.Log log)

dumpClasspath

protected static void dumpClasspath(java.lang.String title,
                                    java.util.List classpath,
                                    org.apache.maven.plugin.logging.Log log)

dumpManifest

protected static void dumpManifest(java.lang.String title,
                                   java.util.jar.Manifest manifest,
                                   org.apache.maven.plugin.logging.Log log)

includeMavenResources

protected static void includeMavenResources(org.apache.maven.project.MavenProject currentProject,
                                            aQute.lib.osgi.Analyzer analyzer,
                                            org.apache.maven.plugin.logging.Log log)

mergeMavenManifest

protected void mergeMavenManifest(org.apache.maven.project.MavenProject currentProject,
                                  aQute.lib.osgi.Jar jar,
                                  java.lang.String[] removeHeaders,
                                  org.apache.maven.plugin.logging.Log log)
                           throws java.io.IOException
Throws:
java.io.IOException

removeTagFromInstruction

protected static java.lang.String removeTagFromInstruction(java.lang.String instruction,
                                                           java.lang.String tag)

getClasspath

protected aQute.lib.osgi.Jar[] getClasspath(org.apache.maven.project.MavenProject currentProject)
                                     throws java.util.zip.ZipException,
                                            java.io.IOException
Returns:
Throws:
java.util.zip.ZipException
java.io.IOException

getFile

protected java.io.File getFile(org.apache.maven.artifact.Artifact artifact)
Get the file for an Artifact

Parameters:
artifact -

convertVersionToOsgi

protected java.lang.String convertVersionToOsgi(java.lang.String version)
Convert a Maven version into an OSGi compliant version

Parameters:
version - Maven version
Returns:
the OSGi version

getBundleName

protected java.lang.String getBundleName(org.apache.maven.project.MavenProject currentProject)
TODO this should return getMaven2Osgi().getBundleFileName( project.getArtifact() )


getBuildDirectory

protected java.lang.String getBuildDirectory()

setBuildDirectory

protected void setBuildDirectory(java.lang.String _buildirectory)

getDefaultProperties

protected java.util.Properties getDefaultProperties(org.apache.maven.project.MavenProject currentProject)

setBasedir

protected void setBasedir(java.io.File _basedir)

getOutputDirectory

protected java.io.File getOutputDirectory()

setOutputDirectory

protected void setOutputDirectory(java.io.File _outputDirectory)

getEmbeddableArtifacts

protected static java.util.Collection getEmbeddableArtifacts(org.apache.maven.project.MavenProject project,
                                                             aQute.lib.osgi.Analyzer analyzer)


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.