Skip to content
Permalink
Browse files
Add another info level toggle to the plugin run
  • Loading branch information
chtompki committed Feb 28, 2018
1 parent f37d774 commit c3745c4219b6d8418432c2ea8512bb17472780d1
Showing 10 changed files with 40 additions and 0 deletions.
@@ -93,8 +93,19 @@ public class CommonsDistributionDetachmentMojo extends AbstractMojo {
@Parameter(defaultValue = "", property = "commons.distSvnStagingUrl")
private String distSvnStagingUrl;

/**
* A parameter to generally avoid running unless it is specifically turned on by the consuming module.
*/
@Parameter(defaultValue = "false", property = "commons.release.isDistModule")
private Boolean isDistModule;

@Override
public void execute() throws MojoExecutionException {
if (!isDistModule) {
getLog().info("This module is marked as a non distribution " +
"or assembly module, and the plugin will not run.");
return;
}
if (StringUtils.isEmpty(distSvnStagingUrl)) {
getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin will not run.");
return;
@@ -108,6 +108,12 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
@Parameter(defaultValue = "", property = "commons.distSvnStagingUrl")
private String distSvnStagingUrl;

/**
* A parameter to generally avoid running unless it is specifically turned on by the consuming module.
*/
@Parameter(defaultValue = "false", property = "commons.release.isDistModule")
private Boolean isDistModule;

/**
* The username for the distribution subversion repository. This is typically your apache id.
*/
@@ -122,6 +128,11 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {

@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (!isDistModule) {
getLog().info("This module is marked as a non distribution " +
"or assembly module, and the plugin will not run.");
return;
}
if (StringUtils.isEmpty(distSvnStagingUrl)) {
getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin will not run.");
return;
@@ -71,6 +71,12 @@ public class CommonsSiteCompressionMojo extends AbstractMojo {
@Parameter(defaultValue = "", property = "commons.distSvnStagingUrl")
private String distSvnStagingUrl;

/**
* A parameter to generally avoid running unless it is specifically turned on by the consuming module.
*/
@Parameter(defaultValue = "false", property = "commons.release.isDistModule")
private Boolean isDistModule;

/**
* A variable for the process of creating the site.zip file.
*/
@@ -88,6 +94,11 @@ public class CommonsSiteCompressionMojo extends AbstractMojo {

@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (!isDistModule) {
getLog().info("This module is marked as a non distribution " +
"or assembly module, and the plugin will not run.");
return;
}
if (StringUtils.isEmpty(distSvnStagingUrl)) {
getLog().warn("commons.distSvnStagingUrl is not set, the commons-release-plugin will not run.");
return;
@@ -44,6 +44,7 @@
<configuration>
<workingDirectory>target/testing-commons-release-plugin</workingDirectory>
<siteDirectory>${basedir}/target/test-classes/mojos/compress-site/example-site</siteDirectory>
<isDistModule>true</isDistModule>
<distSvnStagingUrl>something</distSvnStagingUrl>
</configuration>
</plugin>
@@ -44,6 +44,7 @@
<configuration>
<workingDirectory>target/testing-commons-release-plugin</workingDirectory>
<siteDirectory>${basedir}/target/test-classes/mojos/junk</siteDirectory>
<isDistModule>true</isDistModule>
<distSvnStagingUrl>something</distSvnStagingUrl>
</configuration>
</plugin>
@@ -45,6 +45,7 @@
<workingDirectory>target/testing-commons-release-plugin</workingDirectory>
<siteDirectory>${basedir}/target/test-classes/mojos/compress-site/example-site</siteDirectory>
<distSvnStagingUrl>something</distSvnStagingUrl>
<isDistModule>true</isDistModule>
</configuration>
</plugin>
</plugins>
@@ -43,6 +43,7 @@
<artifactId>commons-release-plugin</artifactId>
<configuration>
<project implementation="org.apache.commons.release.plugin.stubs.DistributionDetachmentProjectStub" />
<isDistModule>true</isDistModule>
<workingDirectory>target/testing-commons-release-plugin</workingDirectory>
</configuration>
</plugin>
@@ -44,6 +44,7 @@
<configuration>
<project implementation="org.apache.commons.release.plugin.stubs.DistributionDetachmentProjectStub" />
<workingDirectory>target/testing-commons-release-plugin</workingDirectory>
<isDistModule>true</isDistModule>
<distSvnStagingUrl>mockDistSvnStagingUrl</distSvnStagingUrl>
</configuration>
</plugin>
@@ -47,6 +47,7 @@
<distCheckoutDirectory>target/testing-commons-release-plugin/scm</distCheckoutDirectory>
<releaseNotesFile>src/test/resources/mojos/stage-distributions/RELEASE-NOTES.txt</releaseNotesFile>
<distSvnStagingUrl>scm:svn:https://dist.apache.org/repos/dist/dev/commons/release-plugin</distSvnStagingUrl>
<isDistModule>false</isDistModule>
<dryRun>true</dryRun>
</configuration>
</plugin>
@@ -47,6 +47,7 @@
<distCheckoutDirectory>target/testing-commons-release-plugin/scm</distCheckoutDirectory>
<releaseNotesFile>src/test/resources/mojos/stage-distributions/RELEASE-NOTES.txt</releaseNotesFile>
<distSvnStagingUrl>scm:svn:https://dist.apache.org/repos/dist/dev/commons/release-plugin</distSvnStagingUrl>
<isDistModule>true</isDistModule>
<dryRun>true</dryRun>
</configuration>
</plugin>

0 comments on commit c3745c4

Please sign in to comment.