@Mojo(name="stage-distributions",
defaultPhase=DEPLOY,
threadSafe=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 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 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()
Copies the list of files at the root of the
workingDirectory into
the directory structure of the distribution staging repository. |
private void |
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", alias="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", alias="outputDirectory") private File distCheckoutDirectory
@Parameter(defaultValue="false") private Boolean dryRun
true
, we do all but make the commits. We do checkout the repository in question
though.@Parameter(required=true) 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(property="user.name") private String username
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
private void copyReleaseNotesToWorkingDirectory() throws org.apache.maven.plugin.MojoExecutionException
RELEASE-NOTES.txt
file from the base directory of the
project and copies it into workingDirectory
.org.apache.maven.plugin.MojoExecutionException
- if an IOException
occurrs as a wrapper so that maven
can properly handle the exception.private List<File> copyDistributionsIntoScmDirectoryStructure() throws org.apache.maven.plugin.MojoExecutionException
workingDirectory
into
the directory structure of the distribution staging repository. Specifically:
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.