Class AbstractBndMavenPlugin
java.lang.Object
org.apache.maven.plugin.AbstractMojo
aQute.bnd.maven.plugin.AbstractBndMavenPlugin
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
BndMavenPlugin, BndMavenTestsPlugin
public abstract class AbstractBndMavenPlugin
extends org.apache.maven.plugin.AbstractMojo
Abstract base class for all bnd-maven-plugin mojos.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) org.apache.maven.artifact.handler.manager.ArtifactHandlerManager(package private) StringBnd instructions for this project specified directly in the pom file.(package private) StringFile path to a bnd file containing bnd instructions for this project.(package private) org.sonatype.plexus.build.incremental.BuildContext(package private) StringThe name of the created artifact (excluding extension and classifier).(package private) booleanWhether to include the contents of theclassesDirdirectory in the generated bundle.(package private) static final Stringprotected final org.slf4j.Logger(package private) static final String(package private) org.apache.maven.plugin.MojoExecution(package 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.(package private) static final String(package private) static final StringThe list of maven packaging types for which the plugin will execute.(package private) org.apache.maven.project.MavenProject(package private) org.apache.maven.project.MavenProjectHelper(package private) File(package private) org.apache.maven.settings.Settings(package private) boolean(package private) static final String(package private) static final String(package private) FileThe directory where the webapp is built when packaging iswar.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringBuilderaddHeaderAttribute(StringBuilder builder, String key, String value, char separator) private static StringBuilderaddHeaderValue(StringBuilder builder, String value, char separator) private voidaddMavenMetadataToJar(aQute.bnd.osgi.Jar bndJar) private voidattachArtifactToProject(aQute.bnd.osgi.Jar bndJar) private StringcreateArtifactName(org.apache.maven.artifact.Artifact artifact) voidexecute()private Fileabstract Fileprivate StringgetExtension(String type) abstract Fileabstract Fileabstract List<org.apache.maven.model.Resource> abstract FilegetType()(package private) Fileprotected booleanabstract booleanisSkip()private booleanprivate booleanprotected voidprocessBuilder(aQute.bnd.osgi.Builder builder) If a mojo needs to tweak the builder for any particular reason, do it here.protected voidprocessBuildPath(List<Object> buildpath) If a mojo needs to update the buildpath for any particular reason, do it here.protected voidreportErrorsAndWarnings(aQute.bnd.osgi.Builder builder) private voidwriteContent(aQute.bnd.osgi.Jar jar, File directory) private voidwriteManifest(aQute.bnd.osgi.Jar jar, File manifestPath) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
logger
protected final org.slf4j.Logger logger -
LAST_MODIFIED
- See Also:
-
MARKED_FILES
- See Also:
-
PACKAGING_JAR
- See Also:
-
PACKAGING_WAR
- See Also:
-
TSTAMP
- See Also:
-
SNAPSHOT
- See Also:
-
includeClassesDir
@Parameter(defaultValue="true") boolean includeClassesDirWhether to include the contents of theclassesDirdirectory in the generated bundle. -
webappDirectory
@Parameter(alias="warOutputDir", defaultValue="${project.build.directory}/${project.build.finalName}") File webappDirectoryThe directory where the webapp is built when packaging iswar. -
finalName
The name of the created artifact (excluding extension and classifier). -
project
@Parameter(defaultValue="${project}", required=true, readonly=true) org.apache.maven.project.MavenProject project -
settings
@Parameter(defaultValue="${settings}", readonly=true) org.apache.maven.settings.Settings settings -
mojoExecution
@Parameter(defaultValue="${mojoExecution}", readonly=true) org.apache.maven.plugin.MojoExecution mojoExecution -
packagingTypes
-
skipIfEmpty
@Parameter(property="bnd.skipIfEmpty", defaultValue="false") boolean skipIfEmpty -
outputTimestamp
Timestamp for reproducible output archive entries, either formatted as ISO 8601yyyy-MM-dd'T'HH:mm:ssXXXor as an int representing seconds since the epoch.- See Also:
-
bndfile
File path to a bnd file containing bnd instructions for this project. Defaults tobnd.bnd. The file path can be an absolute or relative to the project directory.The bnd instructions for this project are merged with the bnd instructions, if any, for the parent project.
-
bnd
Bnd instructions for this project specified directly in the pom file. This is generally be done using a<![CDATA[]]>section. If the projects has abndfile, then this configuration element is ignored.The bnd instructions for this project are merged with the bnd instructions, if any, for the parent project.
-
buildContext
@Component org.sonatype.plexus.build.incremental.BuildContext buildContext -
projectHelper
@Component org.apache.maven.project.MavenProjectHelper projectHelper -
artifactHandlerManager
@Component org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager -
propertiesFile
File propertiesFile
-
-
Constructor Details
-
AbstractBndMavenPlugin
public AbstractBndMavenPlugin()
-
-
Method Details
-
getSourceDir
-
getResources
-
getClassesDir
-
getOutputDir
-
getManifestPath
-
isSkip
public abstract boolean isSkip() -
getClassifier
-
getType
-
getWebappDirectory
File getWebappDirectory() -
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
processBuilder
protected void processBuilder(aQute.bnd.osgi.Builder builder) throws org.apache.maven.plugin.MojoFailureException If a mojo needs to tweak the builder for any particular reason, do it here.- Parameters:
builder- the Builder created to analyze the jar contents- Throws:
org.apache.maven.plugin.MojoFailureException- if an issue is encountered
-
processBuildPath
-
addHeaderValue
-
addHeaderAttribute
private static StringBuilder addHeaderAttribute(StringBuilder builder, String key, String value, char separator) -
attachArtifactToProject
-
addMavenMetadataToJar
- Throws:
IOException
-
getArtifactFile
-
getExtension
-
createArtifactName
-
reportErrorsAndWarnings
protected void reportErrorsAndWarnings(aQute.bnd.osgi.Builder builder) throws org.apache.maven.plugin.MojoFailureException - Throws:
org.apache.maven.plugin.MojoFailureException
-
isEmpty
-
writeContent
-
writeManifest
-
outOfDate
private boolean outOfDate() -
outOfDate
-