@Mojo(name="stage-distributions",
defaultPhase=DEPLOY,
threadSafe=true,
aggregator=true)
public class CommonsDistributionStagingMojo
extends org.apache.maven.plugin.AbstractMojo
target/commons-release-plugin/scm directory. Then commits the
distributions back up to SVN. Also, we include the built and zipped site as well as the RELEASE-NOTES.txt.| Modifier and Type | Field and Description |
|---|---|
private File |
basedir
The
File that contains a file to the root directory of the working project. |
private File |
distCheckoutDirectory
The location to which to checkout the dist subversion repository under our working directory, which
was given above.
|
private String |
distSvnStagingUrl
The url of the subversion repository to which we wish the artifacts to be staged.
|
private Boolean |
dryRun
A boolean that determines whether or not we actually commit the files up to the subversion repository.
|
private Boolean |
isDistModule
A parameter to generally avoid running unless it is specifically turned on by the consuming module.
|
private String |
password
The password associated with
username. |
private org.apache.maven.project.MavenProject |
project
The
MavenProject object is essentially the context of the maven build at
a given time. |
private File |
releaseNotesFile
The location of the RELEASE-NOTES.txt file such that multimodule builds can configure it.
|
private String |
username
The username for the distribution subversion repository.
|
private File |
workingDirectory
The main working directory for the plugin, namely
target/commons-release-plugin, but
that assumes that we're using the default maven ${project.build.directory}. |
| Constructor and Description |
|---|
CommonsDistributionStagingMojo() |
| Modifier and Type | Method and Description |
|---|---|
private String |
buildDistBinariesRoot()
Build the path for the distribution binaries directory.
|
private String |
buildDistSourceRoot()
Build the path for the distribution source directory.
|
private List<File> |
copyDistributionsIntoScmDirectoryStructure(File copiedReleaseNotes)
Copies the list of files at the root of the
workingDirectory into
the directory structure of the distribution staging repository. |
private File |
copyReleaseNotesToWorkingDirectory()
A utility method that takes the
RELEASE-NOTES.txt file from the base directory of the
project and copies it into workingDirectory. |
void |
execute() |
protected void |
setBasedir(File basedir)
This method is the setter for the
basedir field, specifically
for the usage in the unit tests. |
@Parameter(defaultValue="${project}",
required=true)
private org.apache.maven.project.MavenProject project
MavenProject object is essentially the context of the maven build at
a given time.@Parameter(defaultValue="${basedir}")
private File basedir
File that contains a file to the root directory of the working project. Typically
this directory is where the pom.xml resides.@Parameter(defaultValue="${project.build.directory}/commons-release-plugin",
property="commons.outputDirectory")
private File workingDirectory
target/commons-release-plugin, but
that assumes that we're using the default maven ${project.build.directory}.@Parameter(defaultValue="${project.build.directory}/commons-release-plugin/scm",
property="commons.distCheckoutDirectory")
private File distCheckoutDirectory
@Parameter(defaultValue="${basedir}/RELEASE-NOTES.txt",
property="commons.releaseNotesLocation")
private File releaseNotesFile
@Parameter(property="commons.release.dryRun",
defaultValue="false")
private Boolean dryRun
true, we do all but make the commits. We do checkout the repository in question
though.@Parameter(defaultValue="",
property="commons.distSvnStagingUrl")
private String distSvnStagingUrl
scm:svn:https://dist.apache.org/repos/dist/dev/commons/foo. Note. that the prefix to the
substring https is a requirement.@Parameter(defaultValue="false",
property="commons.release.isDistModule")
private Boolean isDistModule
@Parameter(property="user.name") private String username
public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprivate File copyReleaseNotesToWorkingDirectory() throws org.apache.maven.plugin.MojoExecutionException
RELEASE-NOTES.txt file from the base directory of the
project and copies it into workingDirectory.target/commons-release-notes/scm
directory for the purpose of adding it to the scm change set in the method
copyDistributionsIntoScmDirectoryStructure(File).org.apache.maven.plugin.MojoExecutionException - if an IOException occurrs as a wrapper so that maven
can properly handle the exception.private List<File> copyDistributionsIntoScmDirectoryStructure(File copiedReleaseNotes) throws org.apache.maven.plugin.MojoExecutionException
workingDirectory into
the directory structure of the distribution staging repository. Specifically:
copiedReleaseNotes - is the RELEASE-NOTES.txt file that exists in the
target/commons-release-plugin/scm directory.List of File's in the directory for the purpose of adding them to the maven
ScmFileSet.org.apache.maven.plugin.MojoExecutionException - if an IOException occurrs so that Maven can handle it properly.private String buildDistBinariesRoot()
private String buildDistSourceRoot()
Copyright © 2018 The Apache Software Foundation. All rights reserved.