Package org.apache.felix.bundleplugin
Class ManifestPlugin
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.felix.bundleplugin.BundlePlugin
org.apache.felix.bundleplugin.ManifestPlugin
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
BundleAllPlugin
@Mojo(name="manifest",
requiresDependencyResolution=TEST,
threadSafe=true,
defaultPhase=PROCESS_CLASSES)
public class ManifestPlugin
extends BundlePlugin
Generate an OSGi manifest for this project
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.sonatype.plexus.build.incremental.BuildContext
protected boolean
When true, generate the manifest by rebuilding the full bundle in memoryprivate boolean
When true, manifest generation on incremental builds is supported in IDEs like Eclipse.Fields inherited from class org.apache.felix.bundleplugin.BundlePlugin
artifactFactory, artifactResolver, classifier, createDependencyReducedPom, dependencyGraphBuilder, dependencyReducedPomLocation, dumpClasspath, dumpInstructions, excludeDependencies, exportScr, localRepository, m_dependencyGraphBuilder, manifestLocation, mavenProjectBuilder, niceManifest, packaging, project, remoteArtifactRepositories, scrLocation, session, supportedProjectTypes, unpackBundle
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
Checks if any *.java file was added, updated or removed since last build in any source directory.static String
calculateExportsFromContents
(aQute.bnd.osgi.Jar bundle) private boolean
containsJavaFile
(org.codehaus.plexus.util.Scanner scanner) protected void
execute
(org.apache.maven.project.MavenProject project, org.apache.maven.shared.dependency.graph.DependencyNode dependencyGraph, Map<String, String> instructions, Properties properties, aQute.bnd.osgi.Jar[] classpath) private static void
exportScr
(aQute.bnd.osgi.Analyzer analyzer, aQute.bnd.osgi.Jar jar, File scrLocation, org.sonatype.plexus.build.incremental.BuildContext buildContext, org.apache.maven.plugin.logging.Log log) protected aQute.bnd.osgi.Analyzer
getAnalyzer
(org.apache.maven.project.MavenProject project, org.apache.maven.shared.dependency.graph.DependencyNode dependencyGraph, aQute.bnd.osgi.Jar[] classpath) protected aQute.bnd.osgi.Analyzer
getAnalyzer
(org.apache.maven.project.MavenProject project, org.apache.maven.shared.dependency.graph.DependencyNode dependencyGraph, Map<String, String> instructions, Properties properties, aQute.bnd.osgi.Jar[] classpath) getManifest
(org.apache.maven.project.MavenProject project, org.apache.maven.shared.dependency.graph.DependencyNode dependencyGraph, aQute.bnd.osgi.Jar[] classpath) getManifest
(org.apache.maven.project.MavenProject project, org.apache.maven.shared.dependency.graph.DependencyNode dependencyGraph, Map<String, String> instructions, Properties properties, aQute.bnd.osgi.Jar[] classpath, org.sonatype.plexus.build.incremental.BuildContext buildContext) static void
writeManifest
(aQute.bnd.osgi.Analyzer analyzer, File outputFile, boolean niceManifest, boolean exportScr, File scrLocation, org.sonatype.plexus.build.incremental.BuildContext buildContext, org.apache.maven.plugin.logging.Log log) static void
writeManifest
(Manifest manifest, File outputFile, boolean niceManifest, org.sonatype.plexus.build.incremental.BuildContext buildContext, org.apache.maven.plugin.logging.Log log) private static void
writeSCR
(aQute.bnd.osgi.Resource resource, File destination, org.sonatype.plexus.build.incremental.BuildContext buildContext, org.apache.maven.plugin.logging.Log log) Methods inherited from class org.apache.felix.bundleplugin.BundlePlugin
addMavenInstructions, addMavenSourcePath, buildDependencyGraph, buildOSGiBundle, convertVersionToOsgi, dumpClasspath, dumpInstructions, dumpManifest, execute, execute, getBase, getBuildDirectory, getBundleName, getClasspath, getDefaultProperties, getEmbeddableArtifacts, getFile, getMaven2OsgiConverter, getMavenResourcePaths, getOptionalPackages, getOSGiBuilder, getOutputDirectory, getProject, includeJava9Fixups, includeMavenResources, isTransitivelyOptional, mergeManifest, mergeMavenManifest, removeTagFromInstruction, reportErrors, sanitize, sanitize, setBuildDirectory, setOutputDirectory, transformDirectives, updateExcludesInDeps
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
rebuildBundle
@Parameter(property="rebuildBundle") protected boolean rebuildBundleWhen true, generate the manifest by rebuilding the full bundle in memory -
supportIncrementalBuild
@Parameter(property="supportIncrementalBuild") private boolean supportIncrementalBuildWhen true, manifest generation on incremental builds is supported in IDEs like Eclipse. Please note that the underlying BND library does not support incremental build, which means always the whole manifest and SCR metadata is generated. -
buildContext
@Component private org.sonatype.plexus.build.incremental.BuildContext buildContext
-
-
Constructor Details
-
ManifestPlugin
public ManifestPlugin()
-
-
Method Details
-
anyJavaSourceFileTouchedSinceLastBuild
private boolean anyJavaSourceFileTouchedSinceLastBuild()Checks if any *.java file was added, updated or removed since last build in any source directory. -
containsJavaFile
private boolean containsJavaFile(org.codehaus.plexus.util.Scanner scanner) -
exportScr
private static void exportScr(aQute.bnd.osgi.Analyzer analyzer, aQute.bnd.osgi.Jar jar, File scrLocation, org.sonatype.plexus.build.incremental.BuildContext buildContext, org.apache.maven.plugin.logging.Log log) throws Exception - Throws:
Exception
-
writeSCR
private static void writeSCR(aQute.bnd.osgi.Resource resource, File destination, org.sonatype.plexus.build.incremental.BuildContext buildContext, org.apache.maven.plugin.logging.Log log) throws Exception - Throws:
Exception
-
writeManifest
public static void writeManifest(aQute.bnd.osgi.Analyzer analyzer, File outputFile, boolean niceManifest, boolean exportScr, File scrLocation, org.sonatype.plexus.build.incremental.BuildContext buildContext, org.apache.maven.plugin.logging.Log log) throws Exception - Throws:
Exception
-
writeManifest
public static void writeManifest(Manifest manifest, File outputFile, boolean niceManifest, org.sonatype.plexus.build.incremental.BuildContext buildContext, org.apache.maven.plugin.logging.Log log) throws IOException - Throws:
IOException
-
calculateExportsFromContents