Package org.apache.felix.bundleplugin
Class BundlePlugin
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.felix.bundleplugin.BundlePlugin
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AntPlugin,InstructionsPlugin,ManifestPlugin
@Mojo(name="bundle",
requiresDependencyResolution=TEST,
threadSafe=true,
defaultPhase=PACKAGE)
public class BundlePlugin
extends org.apache.maven.plugin.AbstractMojo
Create an OSGi bundle from Maven project
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.maven.archiver.MavenArchiveConfigurationThe archive configuration to use.private org.apache.maven.artifact.resolver.ArtifactCollectorprotected org.apache.maven.artifact.factory.ArtifactFactoryprivate org.apache.maven.artifact.metadata.ArtifactMetadataSourceprotected org.apache.maven.artifact.resolver.ArtifactResolverArtifact resolver, needed to download source jars for inclusion in classpath.protected org.sonatype.plexus.build.incremental.BuildContextprivate StringThe directory for the generated JAR.private static final Stringprivate static final Stringprotected StringClassifier type of the bundle to be installed.protected booleanIf true, remove any inlined or embedded dependencies from the resulting pom.private static final String[]protected org.apache.maven.shared.dependency.graph.DependencyGraphBuilderprotected FileWhere to put the dependency reduced pom.protected FileFile where the BND class-path will be dumpedprotected FileFile where the BND instructions will be dumpedprivate static final String[]protected StringComma separated list of artifactIds to exclude from the dependency classpath passed to BND (use "true" to exclude everything)protected booleanWhen true, dump the generated SCR filesprivate StringFinal name of the bundle (without classifier or extension)The BND instructions for the bundle.private static final Stringprotected org.apache.maven.artifact.repository.ArtifactRepositoryLocal maven repository.private org.codehaus.plexus.archiver.manager.ArchiverManagerprivate org.apache.maven.artifact.handler.manager.ArtifactHandlerManagerprivate final Maven2OsgiConverterUse locally patched version for now.private org.apache.maven.execution.MavenSessionprivate org.apache.maven.project.MavenProjectHelperprotected FileDirectory where the manifest will be writtenprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprotected org.apache.maven.project.MavenProjectBuilderProjectBuilder, needed to create projects from the artifacts.protected booleanOutput a nicely formatted manifest that still respects the 72 character line limit.private static final StringProject types which are not supported, but silently ignored.private FileThe directory for the generated bundles.private StringTimestamp for reproducible output archive entries, either formatted as ISO 8601yyyy-MM-dd'T'HH:mm:ssXXXor as an int representing seconds since the epoch (like SOURCE_DATE_EPOCH).protected StringPackaging type of the bundle to be installed.protected org.apache.maven.project.MavenProjectThe Maven project.protected List<org.apache.maven.artifact.repository.ArtifactRepository> Remote repositories which will be searched for source attachments.protected FileDirectory where the SCR files will be writtenprotected org.apache.maven.execution.MavenSessionprivate booleanProject types which this plugin supports.protected booleanWhen true, unpack the bundle contents to the outputDirectoryFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddLocalPackages(File outputDirectory, aQute.bnd.osgi.Analyzer analyzer) protected voidaddMavenInstructions(org.apache.maven.project.MavenProject currentProject, aQute.bnd.osgi.Builder builder) protected static voidaddMavenSourcePath(org.apache.maven.project.MavenProject currentProject, aQute.bnd.osgi.Analyzer analyzer, org.apache.maven.plugin.logging.Log log) protected aQute.bnd.osgi.BuilderbuildOSGiBundle(org.apache.maven.project.MavenProject currentProject, Map<String, String> originalInstructions, BundlePlugin.ClassPathItem[] classpath) protected StringconvertVersionToOsgi(String version) Convert a Maven version into an OSGi compliant versionprivate Stringprivate voidcreateDependencyReducedPom(Set<String> artifactsToRemove) private voiddoMavenMetadata(org.apache.maven.project.MavenProject currentProject, aQute.bnd.osgi.Jar jar) protected static StringBuilderdumpClasspath(List<aQute.bnd.osgi.Jar> classpath, StringBuilder buf) protected static StringBuilderdumpInstructions(Properties properties, StringBuilder buf) protected static StringBuilderdumpManifest(Manifest manifest, StringBuilder buf) voidexecute()protected voidexecute(Map<String, String> originalInstructions, BundlePlugin.ClassPathItem[] classpath) private static AttributesfilterAttributes(aQute.bnd.osgi.Instructions instructions, Attributes source, Set<aQute.bnd.osgi.Instruction> nomatch) protected static FilegetBase(org.apache.maven.project.MavenProject currentProject) protected Stringprotected StringgetBundleName(org.apache.maven.project.MavenProject currentProject) TODO this should return getMaven2Osgi().getBundleFileName( project.getArtifact() )protected BundlePlugin.ClassPathItem[]getClasspath(org.apache.maven.project.MavenProject currentProject) private static StringgetCreatedByVersion(String groupId, String artifactId) protected PropertiesgetDefaultProperties(org.apache.maven.project.MavenProject currentProject) protected Collection<org.apache.maven.artifact.Artifact> getEmbeddableArtifacts(org.apache.maven.project.MavenProject currentProject, aQute.bnd.osgi.Analyzer analyzer) protected FilegetFile(org.apache.maven.artifact.Artifact artifact) Get the file for an Artifactprivate Stringprivate StringgetId(org.apache.maven.artifact.Artifact artifact) private StringgetId(org.apache.maven.model.Dependency dependency) protected Maven2OsgiConverterprotected static StringgetMavenResourcePaths(org.apache.maven.project.MavenProject currentProject, boolean test) private static List<org.apache.maven.model.Resource> getMavenResources(org.apache.maven.project.MavenProject currentProject, boolean test) getOptionalPackages(org.apache.maven.project.MavenProject currentProject) protected aQute.bnd.osgi.BuildergetOSGiBuilder(org.apache.maven.project.MavenProject currentProject, Map<String, String> originalInstructions, BundlePlugin.ClassPathItem[] classpath) protected Fileprivate static StringgetPackageName(String filename) protected org.apache.maven.project.MavenProjectgetProperties(org.apache.maven.model.Model projectModel, String prefix) private Collection<org.apache.maven.artifact.Artifact> getSelectedDependencies(Collection<org.apache.maven.artifact.Artifact> artifacts) private static voidheader(Properties properties, String key, Object value) protected static voidincludeJava9Fixups(org.apache.maven.project.MavenProject currentProject, aQute.bnd.osgi.Analyzer analyzer) Downgrade the message "Classes found in the wrong directory" to a warning.protected static voidincludeMavenResources(org.apache.maven.project.MavenProject currentProject, aQute.bnd.osgi.Analyzer analyzer, org.apache.maven.plugin.logging.Log log) protected booleanisTransitivelyOptional(HashSet<String> optionalArtifactIds, org.apache.maven.artifact.Artifact artifact) Check to see if any dependency along the dependency trail of the artifact is optional.private static voidmergeAttributes(Attributes... attributesArray) protected static voidmergeManifest(aQute.bnd.osgi.Instructions instructions, Manifest... manifests) protected voidmergeMavenManifest(org.apache.maven.project.MavenProject currentProject, aQute.bnd.osgi.Builder builder) private static StringBufferprintLicenses(List<org.apache.maven.model.License> licenses) protected static StringremoveTagFromInstruction(String instruction, String tag) protected booleanreportErrors(String prefix, aQute.bnd.osgi.Analyzer analyzer) protected static String