|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.maven.plugin.AbstractMojo de.smartics.maven.plugin.buildmetadata.AbstractBuildMojo
public abstract class AbstractBuildMojo
Base implementation for all build mojos.
Field Summary | |
---|---|
protected boolean |
addToFilters Flag to indicate whether or not the generated properties file should be added to the projects filters. |
protected boolean |
createXmlReport Flag to choose whether ( true ) or not (false ) the XML report should be created. |
protected MavenProject |
project The Maven project. |
protected List<Property> |
properties The list of a system properties or environment variables to be selected by the user to include into the build meta data properties. |
protected File |
propertiesOutputFile The name of the properties file to write. |
protected List<FileMapping> |
propertyOutputFileMapping Maps a packaging to a location for the build meta data properties file. |
protected List<Provider> |
providers The list of meta data providers to launch that contribute to the meta data. |
protected RuntimeInformation |
runtime The runtime information of the Maven instance being executed for the build. |
protected MavenSession |
session The Maven session instance. |
protected File |
xmlOutputFile The name of the XML report file to write. |
Fields inherited from interface org.apache.maven.plugin.Mojo |
---|
ROLE |
Constructor Summary | |
---|---|
AbstractBuildMojo() |
Method Summary | |
---|---|
void |
execute() |
MavenProject |
getProject() Returns the Maven project. |
protected void |
provideBuildMetaData(Properties buildMetaDataProperties, ScmInfo scmInfo, List<Provider> providers, boolean runAtEndOfBuild) Adds the information as build properties for each provider. |
void |
setProject(MavenProject project) Sets the Maven project. |
void |
setPropertiesOutputFile(File propertiesOutputFile) Sets the name of the properties file to write. |
void |
setSession(MavenSession session) Sets the Maven session. |
protected void |
updateMavenEnvironment(Properties buildMetaDataProperties, BuildPropertiesFileHelper helper) Updates the Maven runtime with build properties. |
Methods inherited from class org.apache.maven.plugin.AbstractMojo |
---|
getLog, getPluginContext, setLog, setPluginContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected MavenProject project
protected MavenSession session
protected RuntimeInformation runtime
protected File propertiesOutputFile
protected List<FileMapping> propertyOutputFileMapping
This mapping is especially useful for multi projects.
protected File xmlOutputFile
${project.build.outputDirectory}/META-INF/buildmetadata.xml
.
protected boolean createXmlReport
true
) or not (
false
) the XML report should be created.
protected List<Provider> providers
protected List<Property> properties
The name is the name of the property, the section is relevant for placing the property in one of the following sections:
build.scm
build.dateAndVersion
build.runtime
build.java
build.maven
project
build.misc
If no valid section is given, the property is silently rendered in the build.misc
section.
protected boolean addToFilters
Filters are only added temporarily (read in-memory during the build) and are not written to the POM.
Constructor Detail |
---|
public AbstractBuildMojo()
Method Detail |
---|
public final MavenProject getProject()
public final void setProject(MavenProject project)
project
- the Maven project.
public final void setSession(MavenSession session)
Used for testing.
session
- the Maven session.
public final void setPropertiesOutputFile(File propertiesOutputFile)
Used for testing.
propertiesOutputFile
- the name of the properties file to write.
public void execute() throws MojoExecutionException, MojoFailureException
MojoExecutionException
MojoFailureException
protected final void provideBuildMetaData(Properties buildMetaDataProperties, ScmInfo scmInfo, List<Provider> providers, boolean runAtEndOfBuild) throws MojoExecutionException
buildMetaDataProperties
- the build meta data properties to add to.
scmInfo
- the information for the SCM provided to the build plugin.
providers
- the providers to iterate over.
runAtEndOfBuild
- checks if the provider is configured to be run at the end of the build. If a provider matches this value, it is run.
MojoExecutionException
- on any problem running on the providers.
protected final void updateMavenEnvironment(Properties buildMetaDataProperties, BuildPropertiesFileHelper helper)
buildMetaDataProperties
- the properties to add to the Maven project properties.
helper
- the project helper to use.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |