Class BaseMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- com.github.danielflower.mavenplugins.release.BaseMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
NextMojo,ReleaseMojo
public abstract class BaseMojo extends org.apache.maven.plugin.AbstractMojo- Author:
- Roland Hauser sourcepond@gmail.com
-
-
Field Summary
Fields Modifier and Type Field Description StringargumentsAdditional arguments to pass to Maven during a release.protected org.apache.maven.artifact.resolver.ArtifactResolverartifactResolverUsed to look up Artifacts in the remote repository.protected LongbuildNumberThe build number to use in the release version.protected org.apache.maven.artifact.factory.ArtifactFactoryfactoryUsed to look up Artifacts in the remote repository.protected org.apache.maven.artifact.repository.ArtifactRepositorylocalRepositoryLocation of the local repository.protected List<String>modulesToForceReleaseA module to force release on, even if no changes has been detected.protected List<String>modulesToReleaseThe modules to release, or no value to to release the project from the root pom, which is the default.protected NoChangesActionnoChangesActionDetermines the action to take when no module changes are detected.protected org.apache.maven.project.MavenProjectprojectThe Maven Project.protected List<org.apache.maven.project.MavenProject>projectsprotected booleanpullTagsFetch tags from remote repository to determine the next build number.protected ListremoteRepositoriesList of Remote Repositories used by the resolverprotected VersionNamerversionNamerConfigures the version naming.
-
Constructor Summary
Constructors Constructor Description BaseMojo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigureJsch(org.apache.maven.plugin.logging.Log log)protected org.eclipse.jgit.transport.CredentialsProvidergetCredentialsProvider(org.apache.maven.plugin.logging.Log log)protected static StringgetRemoteUrlOrNullIfNoneSet(org.apache.maven.model.Scm originalScm, org.apache.maven.model.Scm actualScm)-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Field Detail
-
project
@Parameter(property="project", required=true, readonly=true, defaultValue="${project}") protected org.apache.maven.project.MavenProject projectThe Maven Project.
-
projects
@Parameter(property="projects", required=true, readonly=true, defaultValue="${reactorProjects}") protected List<org.apache.maven.project.MavenProject> projects
-
buildNumber
@Parameter(property="buildNumber") protected Long buildNumber
The build number to use in the release version. Given a snapshot version of "1.0-SNAPSHOT" and a buildNumber value of "2", the actual released version will be "1.0.2".
By default, the plugin will automatically find a suitable build number. It will start at version 0 and increment this with each release.
This can be specified using a command line parameter ("-DbuildNumber=2") or in this plugin's configuration.
-
versionNamer
@Parameter(property="versionNamer") protected VersionNamer versionNamer
Configures the version naming.
-
modulesToRelease
@Parameter(alias="modulesToRelease", property="modulesToRelease") protected List<String> modulesToReleaseThe modules to release, or no value to to release the project from the root pom, which is the default. The selected module plus any other modules it needs will be built and released also. When run from the command line, this can be a comma-separated list of module names.
-
modulesToForceRelease
@Parameter(alias="forceRelease", property="forceRelease") protected List<String> modulesToForceReleaseA module to force release on, even if no changes has been detected.
-
noChangesAction
@Parameter(alias="noChangesAction", defaultValue="ReleaseAll", property="noChangesAction") protected NoChangesAction noChangesActionDetermines the action to take when no module changes are detected. Possible values:ReleaseAll,ReleaseNone,FailBuild
-
factory
@Component protected org.apache.maven.artifact.factory.ArtifactFactory factory
Used to look up Artifacts in the remote repository.
-
artifactResolver
@Component protected org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver
Used to look up Artifacts in the remote repository.
-
remoteRepositories
@Parameter(property="remoteRepositories", required=true, readonly=true, defaultValue="${project.remoteArtifactRepositories}") protected List remoteRepositoriesList of Remote Repositories used by the resolver
-
localRepository
@Parameter(property="localRepository", required=true, readonly=true, defaultValue="${localRepository}") protected org.apache.maven.artifact.repository.ArtifactRepository localRepositoryLocation of the local repository.
-
pullTags
@Parameter(alias="pullTags", property="pull", defaultValue="true") protected boolean pullTagsFetch tags from remote repository to determine the next build number. If false, then tags from the local repository will be used instead. Make sure they are up to date to avoid problems.
-
arguments
@Parameter(property="arguments") public String arguments
Additional arguments to pass to Maven during a release.
To pass multiple system properties from the command line, use
-Darguments="-Dprop.1=prop1value -Dprop.2=prop2value"To configure arguments in your pom, in the
<configuration>node add:<arguments>'-Dprop.1=prop 1 value' -Dprop.2=prop2value</arguments>
-
-
Method Detail
-
getCredentialsProvider
protected org.eclipse.jgit.transport.CredentialsProvider getCredentialsProvider(org.apache.maven.plugin.logging.Log log) throws ValidationException- Throws:
ValidationException
-
configureJsch
protected final void configureJsch(org.apache.maven.plugin.logging.Log log)
-
getRemoteUrlOrNullIfNoneSet
protected static String getRemoteUrlOrNullIfNoneSet(org.apache.maven.model.Scm originalScm, org.apache.maven.model.Scm actualScm) throws ValidationException
- Throws:
ValidationException
-
-