Package aQute.bnd.maven.plugin
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) String
Bnd instructions for this project specified directly in the pom file.(package private) String
File path to a bnd file containing bnd instructions for this project.(package private) org.sonatype.plexus.build.incremental.BuildContext
(package private) String
The name of the created artifact (excluding extension and classifier).(package private) boolean
Whether to include the contents of theclassesDir
directory in the generated bundle.(package private) static final String
protected final org.slf4j.Logger
(package private) static final String
(package private) org.apache.maven.plugin.MojoExecution
(package private) String
Timestamp for reproducible output archive entries, either formatted as ISO 8601yyyy-MM-dd'T'HH:mm:ssXXX
or as an int representing seconds since the epoch.(package private) static final String
(package private) static final String
The 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) File
The 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 StringBuilder
addHeaderAttribute
(StringBuilder builder, String key, String value, char separator) private static StringBuilder
addHeaderValue
(StringBuilder builder, String value, char separator) private void
addMavenMetadataToJar
(aQute.bnd.osgi.Jar bndJar) private void
attachArtifactToProject
(aQute.bnd.osgi.Jar bndJar) private String
createArtifactName
(org.apache.maven.artifact.Artifact artifact) void
execute()
private File
abstract File
private String
getExtension
(String type) abstract File
abstract File
abstract List
<org.apache.maven.model.Resource> abstract File
getType()
(package private) File
protected boolean
abstract boolean
isSkip()
private boolean
private boolean
protected void
processBuilder
(aQute.bnd.osgi.Builder builder) If a mojo needs to tweak the builder for any particular reason, do it here.protected void
processBuildPath
(List<Object> buildpath) If a mojo needs to update the buildpath for any particular reason, do it here.protected void
reportErrorsAndWarnings
(aQute.bnd.osgi.Builder builder) private void
writeContent
(aQute.bnd.osgi.Jar jar, File directory) private void
writeManifest
(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 theclassesDir
directory 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
The list of maven packaging types for which the plugin will execute. -
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:ssXXX
or 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.MojoExecutionException
org.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
If a mojo needs to update the buildpath for any particular reason, do it here.- Parameters:
buildpath
- the set of jars and class directories used while analyzing the jar contents
-
addHeaderValue
-
addHeaderAttribute
private static StringBuilder addHeaderAttribute(StringBuilder builder, String key, String value, char separator) -
attachArtifactToProject
- Throws:
Exception
-
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
- Throws:
Exception
-
writeManifest
- Throws:
Exception
-
outOfDate
private boolean outOfDate() -
outOfDate
-