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
-
Field Summary
FieldsModifier and TypeFieldDescription(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) booleanprotected final org.slf4j.Logger(package private) static final String(package private) static final String(package private) org.apache.maven.plugin.MojoExecutionprivate String(package private) static final String(package private) static final String(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) File(package private) static final String(package private) FileFields 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(Jar bndJar) private voidattachArtifactToProject(Jar bndJar) private Fileprivate StringcreateArtifactName(org.apache.maven.artifact.Artifact artifact) private org.codehaus.plexus.util.xml.Xpp3Domvoidexecute()private voidabstract Fileprivate Optional<org.codehaus.plexus.util.xml.Xpp3Dom> getConfiguration(List<org.apache.maven.model.Plugin> plugins) abstract Fileabstract Fileabstract List<org.apache.maven.model.Resource> abstract FilegetType()protected booleanabstract booleanisSkip()private voidloadParentProjectProperties(Builder builder, org.apache.maven.project.MavenProject currentProject) private FileloadProjectProperties(Builder builder, org.apache.maven.project.MavenProject bndProject, org.apache.maven.project.MavenProject pomProject, org.codehaus.plexus.util.xml.Xpp3Dom configuration) private FileloadProperties(Builder builder) private booleanprotected voidprocessBuilder(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(Builder builder) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
logger
protected final org.slf4j.Logger logger -
MANIFEST_LAST_MODIFIED
- See Also:
-
MARKED_FILES
- See Also:
-
PACKAGING_JAR
- See Also:
-
PACKAGING_WAR
- See Also:
-
TSTAMP
- See Also:
-
SNAPSHOT
- See Also:
-
targetDir
-
includeClassesDir
@Parameter(defaultValue="true") boolean includeClassesDir -
warOutputDir
-
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
-
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 abnd file, 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 -
propertiesFile
File propertiesFile
-
-
Constructor Details
-
AbstractBndMavenPlugin
public AbstractBndMavenPlugin()
-
-
Method Details
-
getSourceDir
-
getResources
-
getClassesDir
-
getOutputDir
-
getManifestPath
-
isSkip
public abstract boolean isSkip() -
getClassifier
-
getType
-
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
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
-
createArtifactFile
-
createArtifactName
-
loadProperties
- Throws:
Exception
-
loadParentProjectProperties
private void loadParentProjectProperties(Builder builder, org.apache.maven.project.MavenProject currentProject) throws Exception - Throws:
Exception
-
loadProjectProperties
private File loadProjectProperties(Builder builder, org.apache.maven.project.MavenProject bndProject, org.apache.maven.project.MavenProject pomProject, org.codehaus.plexus.util.xml.Xpp3Dom configuration) throws Exception - Throws:
Exception
-
getConfiguration
-
defaultConfiguration
private org.codehaus.plexus.util.xml.Xpp3Dom defaultConfiguration() -
reportErrorsAndWarnings
protected void reportErrorsAndWarnings(Builder builder) throws org.apache.maven.plugin.MojoFailureException - Throws:
org.apache.maven.plugin.MojoFailureException
-
isEmpty
-
expandJar
- Throws:
Exception
-
manifestOutOfDate
private boolean manifestOutOfDate()
-