You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ch...@apache.org on 2018/01/07 18:21:45 UTC
[01/26] commons-release-plugin git commit: Initial commit
Repository: commons-release-plugin
Updated Branches:
refs/heads/master [created] bcca0ff9a
Initial commit
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/567e48b9
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/567e48b9
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/567e48b9
Branch: refs/heads/master
Commit: 567e48b9b89e3d3795458dd6a3c2c3a6f8376332
Parents:
Author: Rob Tompkins <ch...@gmail.com>
Authored: Fri Dec 22 20:45:31 2017 -0500
Committer: GitHub <no...@github.com>
Committed: Fri Dec 22 20:45:31 2017 -0500
----------------------------------------------------------------------
LICENSE | 201 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
README.md | 1 +
2 files changed, 202 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/567e48b9/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/567e48b9/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..de3e927
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+# commons-release-plugin
\ No newline at end of file
[12/26] commons-release-plugin git commit: Got svn repo provider
working
Posted by ch...@apache.org.
Got svn repo provider working
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/2a3a8823
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/2a3a8823
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/2a3a8823
Branch: refs/heads/master
Commit: 2a3a88238a95397331e35fb98670240575a4bea9
Parents: 7cc0bd9
Author: Rob Tompkins <ch...@apache.org>
Authored: Tue Jan 2 11:27:21 2018 -0500
Committer: Rob Tompkins <ch...@apache.org>
Committed: Tue Jan 2 11:28:55 2018 -0500
----------------------------------------------------------------------
pom.xml | 24 +++-
.../commons/release/plugin/SharedFunctions.java | 20 ++-
.../plugin/handler/DistributionScmHandler.java | 122 ++++++++++++++++++-
.../release/plugin/handler/package-info.java | 16 +++
.../CommonsDistributionDetatchmentMojo.java | 3 +-
.../mojos/CommonsDistributionStagingMojo.java | 70 ++++++++++-
.../mojos/CommonsSiteCompressionMojo.java | 18 ++-
7 files changed, 261 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/2a3a8823/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 1d8f463..c79db7c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -43,7 +43,8 @@
<scm>
<connection>scm:git:http://git-wip-us.apache.org/repos/asf/commons-release-plugin.git</connection>
- <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/commons-release-plugin.git</developerConnection>
+ <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/commons-release-plugin.git
+ </developerConnection>
<url>https://git-wip-us.apache.org/repos/asf?p=commons-release-plugin.git</url>
</scm>
@@ -97,9 +98,24 @@
<version>2.2.1</version>
</dependency>
<dependency>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-provider-api</artifactId>
- <version>3.0.0</version>
+ <groupId>org.apache.maven.scm</groupId>
+ <artifactId>maven-scm-api</artifactId>
+ <version>1.9.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.scm</groupId>
+ <artifactId>maven-scm-provider-svnexe</artifactId>
+ <version>1.9.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.scm</groupId>
+ <artifactId>maven-scm-provider-svn-commons</artifactId>
+ <version>1.9.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.plexus</groupId>
+ <artifactId>plexus-sec-dispatcher</artifactId>
+ <version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/2a3a8823/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java b/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java
index 238d58b..60f2db9 100644
--- a/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java
+++ b/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.release.plugin;
import org.apache.maven.plugin.MojoExecutionException;
@@ -26,13 +42,13 @@ public class SharedFunctions {
* @param log is the maven log for output logging, particularly in regards to error management.
* @param workingDirectory is a {@link File} that represents the directory to first attempt to delete then create.
*/
- public static void initWorkingDirectory(Log log, File workingDirectory) throws MojoExecutionException {
+ public static void initDirectory(Log log, File workingDirectory) throws MojoExecutionException {
if (workingDirectory.exists()) {
try {
FileUtils.deleteDirectory(workingDirectory);
} catch (IOException e) {
log.error(e.getMessage());
- throw new MojoExecutionException("Unable to remove working directory: " + e.getMessage(), e);
+ throw new MojoExecutionException("Unable to remove directory: " + e.getMessage(), e);
}
}
if (!workingDirectory.exists()) {
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/2a3a8823/src/main/java/org/apache/commons/release/plugin/handler/DistributionScmHandler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/handler/DistributionScmHandler.java b/src/main/java/org/apache/commons/release/plugin/handler/DistributionScmHandler.java
index 0a841f9..4762dae 100644
--- a/src/main/java/org/apache/commons/release/plugin/handler/DistributionScmHandler.java
+++ b/src/main/java/org/apache/commons/release/plugin/handler/DistributionScmHandler.java
@@ -1,11 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.release.plugin.handler;
+import org.apache.maven.scm.manager.NoSuchScmProviderException;
+import org.apache.maven.scm.manager.ScmManager;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.ScmProviderRepositoryWithHost;
+import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
+import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.scm.repository.ScmRepositoryException;
+import org.apache.maven.settings.Server;
+import org.apache.maven.settings.Settings;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.util.StringUtils;
+import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher;
+import org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException;
+
import java.io.File;
-public class DistributionScmHandler {
+@Component(role= DistributionScmHandler.class, instantiationStrategy = "singleton" )
+public class DistributionScmHandler extends AbstractLogEnabled {
+
+ /**
+ * The SCM manager.
+ */
+ @Requirement
+ private ScmManager scmManager;
+
+ /**
+ * When this plugin requires Maven 3.0 as minimum, this component can be removed and o.a.m.s.c.SettingsDecrypter be
+ * used instead.
+ */
+ @Requirement(hint = "mng-4384")
+ private SecDispatcher secDispatcher;
public void checkoutDirectory(String scmUrl, File checkoutRootDirectory) {
}
+ public ScmRepository getConfiguredRepository(String url,
+ String username,
+ String password,
+ String privateKey,
+ String passphrase,
+ Settings settings)
+ throws ScmRepositoryException, NoSuchScmProviderException {
+ ScmRepository repository = scmManager.makeScmRepository(url);
+ ScmProviderRepository scmRepo = repository.getProviderRepository();
+ //MRELEASE-76
+ scmRepo.setPersistCheckout(false);
+ if (settings != null) {
+ Server server = null;
+ if (server == null && repository.getProviderRepository() instanceof ScmProviderRepositoryWithHost) {
+ ScmProviderRepositoryWithHost repositoryWithHost =
+ (ScmProviderRepositoryWithHost) repository.getProviderRepository();
+ String host = repositoryWithHost.getHost();
+ int port = repositoryWithHost.getPort();
+ if (port > 0) {
+ host += ":" + port;
+ }
+ // TODO: this is a bit dodgy - id is not host, but since we don't have a <host> field we make an assumption
+ server = settings.getServer(host);
+ }
+
+ if (server != null) {
+ if (username == null) {
+ username = server.getUsername();
+ }
+ if (password == null) {
+ password = decrypt(server.getPassword(), server.getId());
+ }
+ if (privateKey == null) {
+ privateKey = server.getPrivateKey();
+ }
+ if (passphrase == null) {
+ passphrase = decrypt(server.getPassphrase(), server.getId());
+ }
+ }
+ }
+ if (!StringUtils.isEmpty(username)) {
+ scmRepo.setUser(username);
+ }
+ if (!StringUtils.isEmpty(password)) {
+ scmRepo.setPassword(password);
+ }
+ if (scmRepo instanceof ScmProviderRepositoryWithHost) {
+ ScmProviderRepositoryWithHost repositoryWithHost = (ScmProviderRepositoryWithHost) scmRepo;
+ if (!StringUtils.isEmpty(privateKey)) {
+ repositoryWithHost.setPrivateKey(privateKey);
+ }
+ if (!StringUtils.isEmpty(passphrase)) {
+ repositoryWithHost.setPassphrase(passphrase);
+ }
+ }
+ return repository;
+ }
+
+ private String decrypt(String str, String server) {
+ try {
+ return secDispatcher.decrypt(str);
+ } catch (SecDispatcherException e) {
+ String msg =
+ "Failed to decrypt password/passphrase for server " + server + ", using auth token as is: "
+ + e.getMessage();
+ if (getLogger().isDebugEnabled()) {
+ getLogger().warn(msg, e);
+ } else {
+ getLogger().warn(msg);
+ }
+ return str;
+ }
+ }
+
}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/2a3a8823/src/main/java/org/apache/commons/release/plugin/handler/package-info.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/handler/package-info.java b/src/main/java/org/apache/commons/release/plugin/handler/package-info.java
index 064b55a..6f97164 100644
--- a/src/main/java/org/apache/commons/release/plugin/handler/package-info.java
+++ b/src/main/java/org/apache/commons/release/plugin/handler/package-info.java
@@ -1 +1,17 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.release.plugin.handler;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/2a3a8823/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
index 1d6d54e..c8ed139 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
@@ -26,7 +26,6 @@ import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.artifact.AttachedArtifact;
-import org.codehaus.plexus.util.FileUtils;
import java.io.File;
import java.io.FileInputStream;
@@ -92,7 +91,7 @@ public class CommonsDistributionDetatchmentMojo extends AbstractMojo {
project.getAttachedArtifacts().remove(artifactToRemove);
}
if (!workingDirectory.exists()) {
- SharedFunctions.initWorkingDirectory(getLog(), workingDirectory);
+ SharedFunctions.initDirectory(getLog(), workingDirectory);
}
copyRemovedArtifactsToWorkingDirectory();
getLog().info("");
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/2a3a8823/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
index b4741f2..327d8c5 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
@@ -1,25 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.release.plugin.mojos;
+import org.apache.commons.release.plugin.SharedFunctions;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.scm.manager.BasicScmManager;
+import org.apache.maven.scm.manager.NoSuchScmProviderException;
+import org.apache.maven.scm.manager.ScmManager;
+import org.apache.maven.scm.provider.svn.svnexe.SvnExeScmProvider;
+import org.apache.maven.scm.repository.ScmRepository;
+import org.apache.maven.scm.repository.ScmRepositoryException;
+import org.apache.maven.settings.Settings;
import java.io.File;
@Mojo( name = "stage-distributions", defaultPhase = LifecyclePhase.DEPLOY, threadSafe = true)
public class CommonsDistributionStagingMojo extends AbstractMojo {
+ /**
+ */
+ @Parameter( defaultValue = "${settings}", readonly = true, required = true )
+ private Settings settings;
+
+ /**
+ */
@Parameter( defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory" )
private File workingDirectory;
+ /**
+ */
+ @Parameter( defaultValue = "${project.build.directory}/commons-release-plugin/scm", alias = "outputDirectory" )
+ private File distCheckoutDirectory;
+
+ /**
+ */
@Parameter ( required = true )
- private String distScmStagingUrl;
+ private String distSvnStagingUrl;
+
+ /**
+ * The SCM username to use.
+ */
+ @Parameter( property = "username" )
+ private String username;
+
+ /**
+ * The SCM password to use.
+ */
+ @Parameter( property = "password" )
+ private String password;
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
-
+ try {
+ ScmManager scmManager = new BasicScmManager();
+ scmManager.setScmProvider("svn", new SvnExeScmProvider());
+ ScmRepository repository = scmManager.makeScmRepository(distSvnStagingUrl);
+ if (!workingDirectory.exists()) {
+ SharedFunctions.initDirectory(getLog(), workingDirectory);
+ }
+ if (!distCheckoutDirectory.exists()) {
+ SharedFunctions.initDirectory(getLog(), distCheckoutDirectory);
+ }
+ } catch (ScmRepositoryException e) {
+ getLog().error("Failed getting scm repository: " + distSvnStagingUrl, e);
+ throw new MojoExecutionException("Failed getting scm repository: " + distSvnStagingUrl, e);
+ } catch (NoSuchScmProviderException e) {
+ getLog().error("No Scm Provider For: " + distSvnStagingUrl, e);
+ throw new MojoExecutionException("No Scm Provider For: " + distSvnStagingUrl, e);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/2a3a8823/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
index 5812061..c030f90 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.commons.release.plugin.mojos;
import org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator;
@@ -44,7 +60,7 @@ public class CommonsSiteCompressionMojo extends AbstractMojo {
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (!workingDirectory.exists()) {
- SharedFunctions.initWorkingDirectory(getLog(), workingDirectory);
+ SharedFunctions.initDirectory(getLog(), workingDirectory);
}
try {
filesToCompress = new ArrayList<>();
[07/26] commons-release-plugin git commit: Signing detatched artifacts
Posted by ch...@apache.org.
Signing detatched artifacts
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/a0b4bc2c
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/a0b4bc2c
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/a0b4bc2c
Branch: refs/heads/master
Commit: a0b4bc2ce5c9ef25ac59fe177ffdc1a9ef216b29
Parents: 3189050
Author: Rob Tompkins <ch...@gmail.com>
Authored: Sat Dec 30 10:18:22 2017 -0500
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Sat Dec 30 10:18:22 2017 -0500
----------------------------------------------------------------------
pom.xml | 17 +-
.../mojos/CommonsAssemblyStagingMojo.java | 91 ----------
.../CommonsDistributionDetatchmentMojo.java | 180 +++++++++++++++++++
.../mojos/CommonsDistributionStagingMojo.java | 14 ++
.../scm/AssemblyPublicationScmProvider.java | 45 +++++
.../release/plugin/scm/package-info.java | 17 ++
6 files changed, 270 insertions(+), 94 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/a0b4bc2c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 86d22a3..664c9f8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -99,12 +99,23 @@
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-provider-api</artifactId>
- <version>2.12</version>
+ <version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-providers</artifactId>
- <version>2.10</version>
+ <artifactId>wagon-scm</artifactId>
+ <version>3.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.10</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</version>
+ <scope>test</scope>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/a0b4bc2c/src/main/java/org/apache/commons/release/plugin/mojos/CommonsAssemblyStagingMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsAssemblyStagingMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsAssemblyStagingMojo.java
deleted file mode 100644
index 4b9e3d6..0000000
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsAssemblyStagingMojo.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.release.plugin.mojos;
-
-import edu.emory.mathcs.backport.java.util.Collections;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.artifact.AttachedArtifact;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * The purpose of this maven mojo is to detach the artifacts generated by the maven-assembly-plugin,
- * which for the Apache Commons Project do not get uploaded to Nexus, and putting those artifacts
- * in the dev distribution location for apache projects.
- *
- * @author chtompki
- * @since 1.0
- */
-@Mojo( name = "test", defaultPhase = LifecyclePhase.VERIFY, threadSafe = true)
-public class CommonsAssemblyStagingMojo extends AbstractMojo {
-
- /**
- * A list of "artifact types" in the maven vernacular, to
- * be detatched from the deployment. For the time being we want
- * all artifacts generated by the maven-assembly-plugin to be detatched
- * from the deployment, namely *-src.zip, *-src.tar.gz, *-bin.zip,
- * *-bin.tar.gz, and the corresponding .asc pgp signatures.
- */
- private static final Set<String> ARTIFACT_TYPES_TO_DETATCH;
- static {
- Set<String> hashSet = new HashSet<>();
- hashSet.add("zip");
- hashSet.add("tar.gz");
- hashSet.add("zip.asc");
- hashSet.add("tar.gz.asc");
- ARTIFACT_TYPES_TO_DETATCH = Collections.unmodifiableSet(hashSet);
- }
-
- /**
- * This list is supposed to hold the maven references to the aformentioned artifacts so that we
- * can upload them to svn after they've been detatched from the maven deployment.
- */
- private List<AttachedArtifact> detatchedArtifacts = new ArrayList<>();
-
- /**
- * The maven project context injection so that we can get a hold of the variables at hand.
- */
- @Parameter( defaultValue = "${project}", required = true )
- private MavenProject project;
-
- @Parameter( defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory" )
- private File workingDirectory;
-
- @Parameter ( required = true )
- private String pubScmStagingUrl;
-
- public void execute() {
- getLog().info("Detatching Assemblies");
- for (Object attachedArtifact : project.getAttachedArtifacts()) {
- if (ARTIFACT_TYPES_TO_DETATCH.contains(((AttachedArtifact) attachedArtifact).getType())) {
- detatchedArtifacts.add((AttachedArtifact) attachedArtifact);
- }
- }
- for(AttachedArtifact artifactToRemove : detatchedArtifacts) {
- project.getAttachedArtifacts().remove(artifactToRemove);
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/a0b4bc2c/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
new file mode 100644
index 0000000..7cfdb1d
--- /dev/null
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
@@ -0,0 +1,180 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.release.plugin.mojos;
+
+import edu.emory.mathcs.backport.java.util.Collections;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.artifact.AttachedArtifact;
+import org.codehaus.plexus.util.FileUtils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * The purpose of this maven mojo is to detach the artifacts generated by the maven-assembly-plugin,
+ * which for the Apache Commons Project do not get uploaded to Nexus, and putting those artifacts
+ * in the dev distribution location for apache projects.
+ *
+ * @author chtompki
+ * @since 1.0
+ */
+@Mojo( name = "detatch-assemblies", defaultPhase = LifecyclePhase.VERIFY, threadSafe = true)
+public class CommonsDistributionDetatchmentMojo extends AbstractMojo {
+
+ /**
+ * A list of "artifact types" in the maven vernacular, to
+ * be detatched from the deployment. For the time being we want
+ * all artifacts generated by the maven-assembly-plugin to be detatched
+ * from the deployment, namely *-src.zip, *-src.tar.gz, *-bin.zip,
+ * *-bin.tar.gz, and the corresponding .asc pgp signatures.
+ */
+ private static final Set<String> ARTIFACT_TYPES_TO_DETATCH;
+ static {
+ Set<String> hashSet = new HashSet<>();
+ hashSet.add("zip");
+ hashSet.add("tar.gz");
+ hashSet.add("zip.asc");
+ hashSet.add("tar.gz.asc");
+ ARTIFACT_TYPES_TO_DETATCH = Collections.unmodifiableSet(hashSet);
+ }
+
+ /**
+ * This list is supposed to hold the maven references to the aformentioned artifacts so that we
+ * can upload them to svn after they've been detatched from the maven deployment.
+ */
+ private List<AttachedArtifact> detatchedArtifacts = new ArrayList<>();
+
+ /**
+ * The maven project context injection so that we can get a hold of the variables at hand.
+ */
+ @Parameter( defaultValue = "${project}", required = true )
+ private MavenProject project;
+
+ @Parameter( defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory" )
+ private File workingDirectory;
+
+ public void execute() throws MojoExecutionException {
+ getLog().info("Detatching Assemblies");
+ for (Object attachedArtifact : project.getAttachedArtifacts()) {
+ if (ARTIFACT_TYPES_TO_DETATCH.contains(((AttachedArtifact) attachedArtifact).getType())) {
+ detatchedArtifacts.add((AttachedArtifact) attachedArtifact);
+ }
+ }
+ for(AttachedArtifact artifactToRemove : detatchedArtifacts) {
+ project.getAttachedArtifacts().remove(artifactToRemove);
+ }
+ initWorkingDirectory();
+ copyRemovedArtifactsToWorkingDirectory();
+ getLog().info("");
+ sha1AndMd5SignArtifacts();
+ }
+
+ private void initWorkingDirectory() throws MojoExecutionException {
+ if (workingDirectory.exists()) {
+ try {
+ FileUtils.deleteDirectory(workingDirectory);
+ } catch (IOException e) {
+ getLog().error(e.getMessage());
+ throw new MojoExecutionException("Unable to remove working directory: " + e.getMessage(), e);
+ }
+ }
+ if (!workingDirectory.exists()) {
+ workingDirectory.mkdirs();
+ }
+ }
+
+ private void copyRemovedArtifactsToWorkingDirectory() throws MojoExecutionException {
+ StringBuffer copiedArtifactAbsolutePath;
+ getLog().info("Copying detatched artifacts to working directory.");
+ for (AttachedArtifact artifact: detatchedArtifacts) {
+ File artifactFile = artifact.getFile();
+ copiedArtifactAbsolutePath = new StringBuffer(workingDirectory.getAbsolutePath());
+ copiedArtifactAbsolutePath.append("/");
+ copiedArtifactAbsolutePath.append(artifactFile.getName());
+ File copiedArtifact = new File(copiedArtifactAbsolutePath.toString());
+ getLog().info("Copying: " + artifactFile.getName());
+ FileInputStream in;
+ FileOutputStream out;
+ try {
+ in = new FileInputStream(artifactFile);
+ out = new FileOutputStream(copiedArtifact);
+ byte[] buf = new byte[1024];
+ int len;
+ while ((len = in.read(buf)) > 0) {
+ out.write(buf, 0, len);
+ }
+ in.close();
+ out.close();
+ } catch (IOException e) {
+ getLog().error(e.getMessage());
+ throw new MojoExecutionException("Unable to copy file: " + e.getMessage(), e);
+ }
+ }
+ }
+
+ private void sha1AndMd5SignArtifacts() throws MojoExecutionException {
+ for (AttachedArtifact artifact : detatchedArtifacts) {
+ if (!artifact.getFile().getName().contains("asc")) {
+ try {
+ FileInputStream artifactFileInputStream = new FileInputStream(artifact.getFile());
+ String md5 = DigestUtils.md5Hex(artifactFileInputStream);
+ getLog().info(artifact.getFile().getName() + " md5: " + md5);
+ PrintWriter md5Writer = new PrintWriter(getMd5FilePath(workingDirectory, artifact.getFile()));
+ md5Writer.println(md5);
+ String sha1 = DigestUtils.sha1Hex(artifactFileInputStream);
+ getLog().info(artifact.getFile().getName() + " sha1: " + sha1);
+ PrintWriter sha1Writer = new PrintWriter(getSha1FilePath(workingDirectory, artifact.getFile()));
+ sha1Writer.println(sha1);
+ md5Writer.close();
+ sha1Writer.close();
+ } catch (IOException e) {
+ throw new MojoExecutionException("Could not sign file: " + artifact.getFile().getName(), e);
+ }
+ }
+ }
+ }
+
+ private String getMd5FilePath(File workingDirectory, File file) {
+ StringBuffer buffer = new StringBuffer(workingDirectory.getAbsolutePath());
+ buffer.append("/");
+ buffer.append(file.getName());
+ buffer.append(".md5");
+ return buffer.toString();
+ }
+
+ private String getSha1FilePath(File workingDirectory, File file) {
+ StringBuffer buffer = new StringBuffer(workingDirectory.getAbsolutePath());
+ buffer.append("/");
+ buffer.append(file.getName());
+ buffer.append(".sha1");
+ return buffer.toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/a0b4bc2c/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
new file mode 100644
index 0000000..7f9ec67
--- /dev/null
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
@@ -0,0 +1,14 @@
+package org.apache.commons.release.plugin.mojos;
+
+import org.apache.maven.plugins.annotations.Parameter;
+
+import java.io.File;
+
+public class CommonsDistributionStagingMojo {
+
+ @Parameter( defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory" )
+ private File workingDirectory;
+
+ @Parameter ( required = true )
+ private String distScmStagingUrl;
+}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/a0b4bc2c/src/main/java/org/apache/commons/release/plugin/scm/AssemblyPublicationScmProvider.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/scm/AssemblyPublicationScmProvider.java b/src/main/java/org/apache/commons/release/plugin/scm/AssemblyPublicationScmProvider.java
new file mode 100644
index 0000000..3f942cb
--- /dev/null
+++ b/src/main/java/org/apache/commons/release/plugin/scm/AssemblyPublicationScmProvider.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.release.plugin.scm;
+
+import org.apache.maven.scm.ScmFileSet;
+
+import java.io.File;
+
+/**
+ * @author chtompki
+ * @since 1.0
+ */
+public class AssemblyPublicationScmProvider {
+
+ private static final String SCM_CHECKOUT_SUBDIRECTORY = "pub-scm";
+
+ public static void prepareScmCheckoutDirectory(File pluginWorkingDirectory) {
+ StringBuilder pubScmPath = new StringBuilder(pluginWorkingDirectory.getAbsolutePath());
+ pubScmPath.append("/");
+ pubScmPath.append(SCM_CHECKOUT_SUBDIRECTORY);
+ File pubScmDirectory = new File(pubScmPath.toString());
+ if (!pubScmDirectory.exists()) {
+ pubScmDirectory.mkdirs();
+ }
+ }
+
+ public void checkoutPubScmStagingUrl(String pubScmStagingUrl, File pluginWorkingDirectory) {
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/a0b4bc2c/src/main/java/org/apache/commons/release/plugin/scm/package-info.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/scm/package-info.java b/src/main/java/org/apache/commons/release/plugin/scm/package-info.java
new file mode 100644
index 0000000..8767dfc
--- /dev/null
+++ b/src/main/java/org/apache/commons/release/plugin/scm/package-info.java
@@ -0,0 +1,17 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.release.plugin.scm;
\ No newline at end of file
[16/26] commons-release-plugin git commit: Versioning the readme
Posted by ch...@apache.org.
Versioning the readme
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/eef80d6d
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/eef80d6d
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/eef80d6d
Branch: refs/heads/master
Commit: eef80d6da564ff9c9c07a16fa4c01d52c48cfcdb
Parents: af18800
Author: Rob Tompkins <ch...@apache.org>
Authored: Tue Jan 2 15:52:43 2018 -0500
Committer: Rob Tompkins <ch...@apache.org>
Committed: Tue Jan 2 15:52:43 2018 -0500
----------------------------------------------------------------------
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/eef80d6d/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 4dc208f..faa2e7f 100644
--- a/README.md
+++ b/README.md
@@ -65,7 +65,7 @@ Alternatively you can pull it from the central Maven repositories:
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-release-plugin</artifactId>
- <version>1.7</version>
+ <version>0.1-SNAPSHOT</version>
</dependency>
```
[26/26] commons-release-plugin git commit: Current work
Posted by ch...@apache.org.
Current work
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/bcca0ff9
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/bcca0ff9
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/bcca0ff9
Branch: refs/heads/master
Commit: bcca0ff9ae13761783d406e6fbe9165d1b401144
Parents: 5d4ab8c
Author: Rob Tompkins <ch...@apache.org>
Authored: Sun Jan 7 13:21:37 2018 -0500
Committer: Rob Tompkins <ch...@apache.org>
Committed: Sun Jan 7 13:21:37 2018 -0500
----------------------------------------------------------------------
.../CommonsDistributionDetatchmentMojo.java | 15 ++++----
.../DistributionDetatchmentProjectStub.java | 38 ++++++++++++++++++++
.../release/plugin/stubs/package-info.java | 17 +++++++++
3 files changed, 62 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/bcca0ff9/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
index fd75e39..746a51c 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
@@ -24,11 +24,10 @@ import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.artifact.AttachedArtifact;
+import org.apache.maven.artifact.Artifact;
import java.io.File;
import java.io.FileInputStream;
-import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
@@ -65,7 +64,7 @@ public class CommonsDistributionDetatchmentMojo extends AbstractMojo {
* This list is supposed to hold the maven references to the aformentioned artifacts so that we
* can upload them to svn after they've been detatched from the maven deployment.
*/
- private List<AttachedArtifact> detatchedArtifacts = new ArrayList<>();
+ private List<Artifact> detatchedArtifacts = new ArrayList<>();
/**
* The maven project context injection so that we can get a hold of the variables at hand.
@@ -86,11 +85,11 @@ public class CommonsDistributionDetatchmentMojo extends AbstractMojo {
public void execute() throws MojoExecutionException {
getLog().info("Detatching Assemblies");
for (Object attachedArtifact : project.getAttachedArtifacts()) {
- if (ARTIFACT_TYPES_TO_DETATCH.contains(((AttachedArtifact) attachedArtifact).getType())) {
- detatchedArtifacts.add((AttachedArtifact) attachedArtifact);
+ if (ARTIFACT_TYPES_TO_DETATCH.contains(((Artifact) attachedArtifact).getType())) {
+ detatchedArtifacts.add((Artifact) attachedArtifact);
}
}
- for(AttachedArtifact artifactToRemove : detatchedArtifacts) {
+ for(Artifact artifactToRemove : detatchedArtifacts) {
project.getAttachedArtifacts().remove(artifactToRemove);
}
if (!workingDirectory.exists()) {
@@ -104,7 +103,7 @@ public class CommonsDistributionDetatchmentMojo extends AbstractMojo {
private void copyRemovedArtifactsToWorkingDirectory() throws MojoExecutionException {
StringBuffer copiedArtifactAbsolutePath;
getLog().info("Copying detatched artifacts to working directory.");
- for (AttachedArtifact artifact: detatchedArtifacts) {
+ for (Artifact artifact: detatchedArtifacts) {
File artifactFile = artifact.getFile();
copiedArtifactAbsolutePath = new StringBuffer(workingDirectory.getAbsolutePath());
copiedArtifactAbsolutePath.append("/");
@@ -116,7 +115,7 @@ public class CommonsDistributionDetatchmentMojo extends AbstractMojo {
}
private void sha1AndMd5SignArtifacts() throws MojoExecutionException {
- for (AttachedArtifact artifact : detatchedArtifacts) {
+ for (Artifact artifact : detatchedArtifacts) {
if (!artifact.getFile().getName().contains("asc")) {
try {
FileInputStream artifactFileInputStream = new FileInputStream(artifact.getFile());
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/bcca0ff9/src/test/java/org/apache/commons/release/plugin/stubs/DistributionDetatchmentProjectStub.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/stubs/DistributionDetatchmentProjectStub.java b/src/test/java/org/apache/commons/release/plugin/stubs/DistributionDetatchmentProjectStub.java
new file mode 100644
index 0000000..9305d02
--- /dev/null
+++ b/src/test/java/org/apache/commons/release/plugin/stubs/DistributionDetatchmentProjectStub.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.release.plugin.stubs;
+
+import org.apache.commons.release.plugin.mojos.CommonsDistributionDetatchmentMojoTest;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.artifact.AttachedArtifact;
+
+import java.util.List;
+
+/**
+ * Stub for {@link MavenProject} for the {@link CommonsDistributionDetatchmentMojoTest}.
+ *
+ * @author chtompki
+ */
+public class DistributionDetatchmentProjectStub extends MavenProjectStub {
+
+ private List<Artifact> attachedArtifacts;
+
+
+
+}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/bcca0ff9/src/test/java/org/apache/commons/release/plugin/stubs/package-info.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/stubs/package-info.java b/src/test/java/org/apache/commons/release/plugin/stubs/package-info.java
new file mode 100644
index 0000000..95d9137
--- /dev/null
+++ b/src/test/java/org/apache/commons/release/plugin/stubs/package-info.java
@@ -0,0 +1,17 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.release.plugin.stubs;
\ No newline at end of file
[04/26] commons-release-plugin git commit: Detatch tar.gz/zip related
artifacts from deployment
Posted by ch...@apache.org.
Detatch tar.gz/zip related artifacts from deployment
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/f0c5441e
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/f0c5441e
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/f0c5441e
Branch: refs/heads/master
Commit: f0c5441e4240478fea6500c0ef2dc95b86fe9ec5
Parents: 9f86ea7
Author: Rob Tompkins <ch...@gmail.com>
Authored: Sat Dec 23 14:04:03 2017 -0500
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Sat Dec 23 14:04:03 2017 -0500
----------------------------------------------------------------------
pom.xml | 5 ++
src/it/settings.xml | 77 ++++++++++++++++++++
.../mojos/AbstractCommonsBuildPluginMojo.java | 28 -------
.../plugin/mojos/CommonsBuildPluginMojo.java | 32 --------
.../build/plugin/mojos/package-info.java | 17 -----
.../commons/build/plugin/package-info.java | 17 -----
.../mojos/AbstractCommonsReleasePluginMojo.java | 28 +++++++
.../plugin/mojos/CommonsReleasePluginMojo.java | 68 +++++++++++++++++
.../release/plugin/mojos/package-info.java | 17 +++++
.../commons/release/plugin/package-info.java | 17 +++++
src/test-project/pom.xml | 56 --------------
.../commons/build/plugin/package-info.java | 17 -----
.../commons/release/plugin/package-info.java | 17 +++++
13 files changed, 229 insertions(+), 167 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/f0c5441e/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 0a25031..6e01876 100644
--- a/pom.xml
+++ b/pom.xml
@@ -91,6 +91,11 @@
<artifactId>maven-plugin-annotations</artifactId>
<version>3.5</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>2.2.1</version>
+ </dependency>
</dependencies>
<build>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/f0c5441e/src/it/settings.xml
----------------------------------------------------------------------
diff --git a/src/it/settings.xml b/src/it/settings.xml
new file mode 100644
index 0000000..8912a7c
--- /dev/null
+++ b/src/it/settings.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<settings>
+ <profiles>
+ <profile>
+ <id>it-repo</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <repositories>
+ <repository>
+ <id>local.central</id>
+ <url>@localRepositoryUrl@</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>apache.snapshot</id>
+ <url>https://repository.apache.org/content/groups/snapshots-group/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>local.central</id>
+ <url>@localRepositoryUrl@</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+ </profiles>
+ <mirrors>
+ <mirror>
+ <id>local-tlc</id>
+ <mirrorOf>tlc</mirrorOf>
+ <url>@localRepositoryUrl@</url>
+ </mirror>
+ <mirror>
+ <id>apache-plugin-snapshots-new</id>
+ <mirrorOf>apache-plugin-snapshots</mirrorOf>
+ <url>https://repository.apache.org/content/groups/snapshots-group/</url>
+ </mirror>
+ </mirrors>
+</settings>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/f0c5441e/src/main/java/org/apache/commons/build/plugin/mojos/AbstractCommonsBuildPluginMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/build/plugin/mojos/AbstractCommonsBuildPluginMojo.java b/src/main/java/org/apache/commons/build/plugin/mojos/AbstractCommonsBuildPluginMojo.java
deleted file mode 100644
index ad26d7c..0000000
--- a/src/main/java/org/apache/commons/build/plugin/mojos/AbstractCommonsBuildPluginMojo.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.build.plugin.mojos;
-
-import org.apache.maven.plugin.AbstractMojo;
-
-/**
- * Contains the logging mechanics for the commons-build-plugin.
- *
- * @author chtompki
- * @since 1.0
- */
-public abstract class AbstractCommonsBuildPluginMojo extends AbstractMojo {
-}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/f0c5441e/src/main/java/org/apache/commons/build/plugin/mojos/CommonsBuildPluginMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/build/plugin/mojos/CommonsBuildPluginMojo.java b/src/main/java/org/apache/commons/build/plugin/mojos/CommonsBuildPluginMojo.java
deleted file mode 100644
index ae75b57..0000000
--- a/src/main/java/org/apache/commons/build/plugin/mojos/CommonsBuildPluginMojo.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.build.plugin.mojos;
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugins.annotations.Mojo;
-
-/**
- * @author chtompki
- * @since 1.0
- */
-@Mojo( name = "test", threadSafe = true )
-public class CommonsBuildPluginMojo extends AbstractMojo {
-
- public void execute() {
- getLog().info("Hello World");
- }
-}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/f0c5441e/src/main/java/org/apache/commons/build/plugin/mojos/package-info.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/build/plugin/mojos/package-info.java b/src/main/java/org/apache/commons/build/plugin/mojos/package-info.java
deleted file mode 100644
index 2f50937..0000000
--- a/src/main/java/org/apache/commons/build/plugin/mojos/package-info.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.build.plugin.mojos;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/f0c5441e/src/main/java/org/apache/commons/build/plugin/package-info.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/build/plugin/package-info.java b/src/main/java/org/apache/commons/build/plugin/package-info.java
deleted file mode 100644
index b3a065a..0000000
--- a/src/main/java/org/apache/commons/build/plugin/package-info.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.build.plugin;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/f0c5441e/src/main/java/org/apache/commons/release/plugin/mojos/AbstractCommonsReleasePluginMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/AbstractCommonsReleasePluginMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/AbstractCommonsReleasePluginMojo.java
new file mode 100644
index 0000000..7e78368
--- /dev/null
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/AbstractCommonsReleasePluginMojo.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.release.plugin.mojos;
+
+import org.apache.maven.plugin.AbstractMojo;
+
+/**
+ * Contains the logging mechanics for the commons-release-plugin.
+ *
+ * @author chtompki
+ * @since 1.0
+ */
+public abstract class AbstractCommonsReleasePluginMojo extends AbstractMojo {
+}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/f0c5441e/src/main/java/org/apache/commons/release/plugin/mojos/CommonsReleasePluginMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsReleasePluginMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsReleasePluginMojo.java
new file mode 100644
index 0000000..bc45bc1
--- /dev/null
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsReleasePluginMojo.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.release.plugin.mojos;
+
+import edu.emory.mathcs.backport.java.util.Collections;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.artifact.AttachedArtifact;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author chtompki
+ * @since 1.0
+ *
+ * , defaultPhase = LifecyclePhase.
+ */
+@Mojo( name = "test", defaultPhase = LifecyclePhase.VERIFY, threadSafe = true)
+public class CommonsReleasePluginMojo extends AbstractMojo {
+
+ private static final Set<String> ARTIFACT_TYPES_TO_DETATCH;
+ static {
+ Set<String> hashSet = new HashSet<>();
+ hashSet.add("zip");
+ hashSet.add("tar.gz");
+ hashSet.add("zip.asc");
+ hashSet.add("tar.gz.asc");
+ ARTIFACT_TYPES_TO_DETATCH = Collections.unmodifiableSet(hashSet);
+ }
+
+ private List<AttachedArtifact> detatchedArtifacts = new ArrayList<>();
+
+ @Parameter( defaultValue = "${project}", required = true )
+ private MavenProject project;
+
+ public void execute() {
+ getLog().info("Detatching Assemblies");
+ for (Object attachedArtifact : project.getAttachedArtifacts()) {
+ if (ARTIFACT_TYPES_TO_DETATCH.contains(((AttachedArtifact) attachedArtifact).getType())) {
+ detatchedArtifacts.add((AttachedArtifact) attachedArtifact);
+ }
+ }
+ for(AttachedArtifact artifactToRemove : detatchedArtifacts) {
+ project.getAttachedArtifacts().remove(artifactToRemove);
+ }
+ getLog().info("");
+ }
+}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/f0c5441e/src/main/java/org/apache/commons/release/plugin/mojos/package-info.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/package-info.java b/src/main/java/org/apache/commons/release/plugin/mojos/package-info.java
new file mode 100644
index 0000000..32828f0
--- /dev/null
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/package-info.java
@@ -0,0 +1,17 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.release.plugin.mojos;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/f0c5441e/src/main/java/org/apache/commons/release/plugin/package-info.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/package-info.java b/src/main/java/org/apache/commons/release/plugin/package-info.java
new file mode 100644
index 0000000..4852740
--- /dev/null
+++ b/src/main/java/org/apache/commons/release/plugin/package-info.java
@@ -0,0 +1,17 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.release.plugin;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/f0c5441e/src/test-project/pom.xml
----------------------------------------------------------------------
diff --git a/src/test-project/pom.xml b/src/test-project/pom.xml
deleted file mode 100644
index a02076f..0000000
--- a/src/test-project/pom.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.commons</groupId>
- <artifactId>test-project</artifactId>
- <version>1.3</version>
- <name>Test Project</name>
- <description>
- Commons Build Plugin Test Project.
- </description>
-
- <url>http://commons.apache.org/commons-build-plugin/</url>
-
- <issueManagement>
- <system>jira</system>
- <url>http://issues.apache.org/jira/browse/COMMONSSITE</url>
- </issueManagement>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-build-plugin</artifactId>
- <version>1.3</version>
- <configuration>
- <commons.release.name>${project.artifactId}-${commons.release.version}</commons.release.name>
- <commons.jira.id>COMMONSSITE</commons.jira.id>
- <commons.jira.pid>12310466</commons.jira.pid>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <properties>
- <commons.binary.suffix>-bin</commons.binary.suffix>
- <commons.release.version>1.0</commons.release.version>
- <commons.componentid>${project.artifactId}</commons.componentid>
- </properties>
-
-</project>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/f0c5441e/src/test/java/org/apache/commons/build/plugin/package-info.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/build/plugin/package-info.java b/src/test/java/org/apache/commons/build/plugin/package-info.java
deleted file mode 100644
index b3a065a..0000000
--- a/src/test/java/org/apache/commons/build/plugin/package-info.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.build.plugin;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/f0c5441e/src/test/java/org/apache/commons/release/plugin/package-info.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/package-info.java b/src/test/java/org/apache/commons/release/plugin/package-info.java
new file mode 100644
index 0000000..4852740
--- /dev/null
+++ b/src/test/java/org/apache/commons/release/plugin/package-info.java
@@ -0,0 +1,17 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.release.plugin;
\ No newline at end of file
[19/26] commons-release-plugin git commit: File should have newline
at end
Posted by ch...@apache.org.
File should have newline at end
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/a5557ab7
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/a5557ab7
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/a5557ab7
Branch: refs/heads/master
Commit: a5557ab73aa347c9ef251738da619790c26f6507
Parents: e1f50b9
Author: Rob Tompkins <ch...@capitalone.com>
Authored: Fri Jan 5 08:04:13 2018 -0500
Committer: Rob Tompkins <ch...@capitalone.com>
Committed: Fri Jan 5 08:04:13 2018 -0500
----------------------------------------------------------------------
README.md | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/a5557ab7/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index faa2e7f..c8475ce 100644
--- a/README.md
+++ b/README.md
@@ -99,3 +99,4 @@ Additional Resources
+ #apachecommons IRC channel on freenode.org
[ml]:https://commons.apache.org/mail-lists.html
+
[23/26] commons-release-plugin git commit: First succesful unit
test...finally
Posted by ch...@apache.org.
First succesful unit test...finally
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/977f9bb1
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/977f9bb1
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/977f9bb1
Branch: refs/heads/master
Commit: 977f9bb1754c4c925da650a9a3af8cab926fb4d9
Parents: b741c5b
Author: Rob Tompkins <ch...@apache.org>
Authored: Sat Jan 6 20:08:54 2018 -0500
Committer: Rob Tompkins <ch...@apache.org>
Committed: Sat Jan 6 20:08:54 2018 -0500
----------------------------------------------------------------------
pom.xml | 42 ++------------------
.../CommonsDistributionDetatchmentMojo.java | 13 +++---
.../mojos/CommonsDistributionStagingMojo.java | 1 -
.../mojos/CommonsSiteCompressionMojo.java | 9 +++++
.../mojos/CommonsSiteCompressionMojoTest.java | 24 ++++++++++-
.../mojos/compress-site/compress-site.xml | 1 +
6 files changed, 43 insertions(+), 47 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/977f9bb1/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index ebc4b5f..2061351 100644
--- a/pom.xml
+++ b/pom.xml
@@ -105,14 +105,9 @@
<version>3.5</version>
</dependency>
<dependency>
- <groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-shared-utils</artifactId>
- <version>3.2.0</version>
- </dependency>
- <dependency>
<groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
- <version>2.2.1</version>
+ <artifactId>maven-artifact</artifactId>
+ <version>${maven.dependency.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.scm</groupId>
@@ -130,16 +125,6 @@
<version>1.9.5</version>
</dependency>
<dependency>
- <groupId>org.sonatype.plexus</groupId>
- <artifactId>plexus-sec-dispatcher</artifactId>
- <version>1.4</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.wagon</groupId>
- <artifactId>wagon-scm</artifactId>
- <version>3.0.0</version>
- </dependency>
- <dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
@@ -150,24 +135,9 @@
<version>1.15</version>
</dependency>
<dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
- <version>3.0.24</version>
- </dependency>
- <dependency>
- <groupId>org.jdom</groupId>
- <artifactId>jdom</artifactId>
- <version>1.1.3</version>
- </dependency>
- <dependency>
- <groupId>org.sonatype.aether</groupId>
- <artifactId>aether-api</artifactId>
- <version>1.13.1</version>
- </dependency>
- <dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
- <version>2.1</version>
+ <version>3.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -177,12 +147,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-core</artifactId>
- <version>${maven.dependency.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/977f9bb1/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
index 5cf361a..fd75e39 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
@@ -16,7 +16,6 @@
*/
package org.apache.commons.release.plugin.mojos;
-import edu.emory.mathcs.backport.java.util.Collections;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.release.plugin.SharedFunctions;
import org.apache.maven.plugin.AbstractMojo;
@@ -32,10 +31,7 @@ import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
/**
* The purpose of this maven mojo is to detach the artifacts generated by the maven-assembly-plugin,
@@ -77,9 +73,16 @@ public class CommonsDistributionDetatchmentMojo extends AbstractMojo {
@Parameter( defaultValue = "${project}", required = true )
private MavenProject project;
+ /**
+ */
@Parameter( defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory" )
private File workingDirectory;
+ /**
+ */
+ @Parameter(required = true)
+ private String distSvnStagingUrl;
+
public void execute() throws MojoExecutionException {
getLog().info("Detatching Assemblies");
for (Object attachedArtifact : project.getAttachedArtifacts()) {
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/977f9bb1/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
index a708961..8bd7bf9 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
@@ -31,7 +31,6 @@ import org.apache.maven.scm.command.checkin.CheckInScmResult;
import org.apache.maven.scm.manager.BasicScmManager;
import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.provider.ScmProvider;
-import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
import org.apache.maven.scm.provider.svn.svnexe.SvnExeScmProvider;
import org.apache.maven.scm.repository.ScmRepository;
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/977f9bb1/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
index c030f90..b54e6af 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
@@ -45,12 +45,21 @@ import java.util.zip.ZipOutputStream;
@Mojo(name = "compress-site", defaultPhase = LifecyclePhase.POST_SITE, threadSafe = true)
public class CommonsSiteCompressionMojo extends AbstractMojo {
+ /**
+ */
@Parameter(defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory")
private File workingDirectory;
+ /**
+ */
@Parameter(defaultValue = "${project.build.directory}/site", alias = "siteOutputDirectory")
private File siteDirectory;
+ /**
+ */
+ @Parameter(required = true)
+ private String distSvnStagingUrl;
+
private ScatterZipOutputStream dirs;
private ParallelScatterZipCreator scatterZipCreator;
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/977f9bb1/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
index 58f3031..d594149 100644
--- a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
+++ b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
@@ -17,24 +17,44 @@
package org.apache.commons.release.plugin.mojos;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+import org.apache.maven.plugin.testing.MojoRule;
+import org.junit.Rule;
+import org.junit.Test;
import java.io.File;
+import static junit.framework.TestCase.assertTrue;
+import static org.junit.Assert.assertNotNull;
+
/**
* Unit tests for {@link CommonsSiteCompressionMojo}.
*
* @author chtompki
* @since 1.0
*/
-public class CommonsSiteCompressionMojoTest extends AbstractMojoTestCase {
+public class CommonsSiteCompressionMojoTest {
+
+ @Rule
+ public MojoRule rule = new MojoRule() {
+ @Override
+ protected void before() throws Throwable {
+ }
+
+ @Override
+ protected void after() {
+ }
+ };
protected CommonsSiteCompressionMojo mojo;
+ @Test
public void testCompressSite() throws Exception {
File testFile = new File("src/test/resources/mojos/compress-site/compress-site.xml");
assertNotNull(testFile);
assertTrue(testFile.exists());
- mojo = (CommonsSiteCompressionMojo) lookupMojo("compress-site", testFile);
+ mojo = (CommonsSiteCompressionMojo) rule.lookupMojo("compress-site", testFile);
mojo.execute();
+ File siteZip = new File("target/commons-release-plugin/site.zip");
+ assertTrue(siteZip.exists());
}
}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/977f9bb1/src/test/resources/mojos/compress-site/compress-site.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/compress-site/compress-site.xml b/src/test/resources/mojos/compress-site/compress-site.xml
index 0d08ab7..40db1ac 100644
--- a/src/test/resources/mojos/compress-site/compress-site.xml
+++ b/src/test/resources/mojos/compress-site/compress-site.xml
@@ -42,6 +42,7 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-release-plugin</artifactId>
<configuration>
+ <workingDirectory>target/commons-release-plugin</workingDirectory>
<distSvnStagingUrl>aBadUrl</distSvnStagingUrl>
<siteDirectory>${basedir}/target/test-classes/mojos/compress-site/example-site</siteDirectory>
</configuration>
[14/26] commons-release-plugin git commit: Preparing to add and
commit dists to svn
Posted by ch...@apache.org.
Preparing to add and commit dists to svn
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/d1d0cb40
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/d1d0cb40
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/d1d0cb40
Branch: refs/heads/master
Commit: d1d0cb407eea63d73a22c21b5add9eee34602539
Parents: d365f0b
Author: Rob Tompkins <ch...@apache.org>
Authored: Tue Jan 2 15:12:15 2018 -0500
Committer: Rob Tompkins <ch...@apache.org>
Committed: Tue Jan 2 15:12:15 2018 -0500
----------------------------------------------------------------------
.../commons/release/plugin/SharedFunctions.java | 29 ++++++++
.../CommonsDistributionDetatchmentMojo.java | 17 +----
.../mojos/CommonsDistributionStagingMojo.java | 77 +++++++++++++++++++-
3 files changed, 103 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/d1d0cb40/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java b/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java
index 60f2db9..9051629 100644
--- a/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java
+++ b/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java
@@ -21,6 +21,8 @@ import org.apache.maven.plugin.logging.Log;
import org.codehaus.plexus.util.FileUtils;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
import java.io.IOException;
/**
@@ -55,4 +57,31 @@ public class SharedFunctions {
workingDirectory.mkdirs();
}
}
+
+ /**
+ * Copies a file from the from file to the to file and logs the failure using the maven logger.
+ *
+ * @param log the {@link Log}, the maven logger.
+ * @param fromFile the {@link File} from which to copy.
+ * @param toFile the {@link File} to which to copy into.
+ * @throws MojoExecutionException if an {@link IOException} occurs.
+ */
+ public static void copyFile(Log log, File fromFile, File toFile) throws MojoExecutionException{
+ FileInputStream in;
+ FileOutputStream out;
+ try {
+ in = new FileInputStream(fromFile);
+ out = new FileOutputStream(toFile);
+ byte[] buf = new byte[1024];
+ int len;
+ while ((len = in.read(buf)) > 0) {
+ out.write(buf, 0, len);
+ }
+ in.close();
+ out.close();
+ } catch (IOException e) {
+ log.error(e.getMessage());
+ throw new MojoExecutionException("Unable to copy file: " + e.getMessage(), e);
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/d1d0cb40/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
index c8ed139..5cf361a 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
@@ -108,22 +108,7 @@ public class CommonsDistributionDetatchmentMojo extends AbstractMojo {
copiedArtifactAbsolutePath.append(artifactFile.getName());
File copiedArtifact = new File(copiedArtifactAbsolutePath.toString());
getLog().info("Copying: " + artifactFile.getName());
- FileInputStream in;
- FileOutputStream out;
- try {
- in = new FileInputStream(artifactFile);
- out = new FileOutputStream(copiedArtifact);
- byte[] buf = new byte[1024];
- int len;
- while ((len = in.read(buf)) > 0) {
- out.write(buf, 0, len);
- }
- in.close();
- out.close();
- } catch (IOException e) {
- getLog().error(e.getMessage());
- throw new MojoExecutionException("Unable to copy file: " + e.getMessage(), e);
- }
+ SharedFunctions.copyFile(getLog(), artifactFile, copiedArtifact);
}
}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/d1d0cb40/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
index 6fa1a52..68d37ab 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
@@ -23,6 +23,7 @@ import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.artifact.AttachedArtifact;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.manager.BasicScmManager;
@@ -36,23 +37,44 @@ import org.apache.maven.scm.repository.ScmRepositoryException;
import org.apache.maven.settings.Settings;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
-@Mojo( name = "stage-distributions", defaultPhase = LifecyclePhase.DEPLOY, threadSafe = true)
+/**
+ * This class checks out the dev distribution location, copies the distributions into that directory
+ * structure under the <code>target</code> directory. Then commits the distributions back up to SVN.
+ * Also, we include the built and zipped site as well as the RELEASE-NOTES.txt.
+ *
+ * @author chtompki
+ * @since 1.0
+ */
+@Mojo(name = "stage-distributions", defaultPhase = LifecyclePhase.DEPLOY, threadSafe = true)
public class CommonsDistributionStagingMojo extends AbstractMojo {
/**
*/
- @Parameter( defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory" )
+ @Parameter(defaultValue = "${basedir}")
+ private File basedir;
+
+ /**
+ */
+ @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory")
private File workingDirectory;
/**
*/
- @Parameter( defaultValue = "${project.build.directory}/commons-release-plugin/scm", alias = "outputDirectory" )
+ @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin/scm", alias = "outputDirectory")
private File distCheckoutDirectory;
+ @Parameter(defaultValue = "false")
+ private Boolean dryRun;
+
/**
*/
- @Parameter ( required = true )
+ @Parameter(required = true)
private String distSvnStagingUrl;
@Override
@@ -72,9 +94,56 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
ScmFileSet scmFileSet = new ScmFileSet(distCheckoutDirectory);
getLog().info("Checking out dist from: " + distSvnStagingUrl);
provider.checkOut(repository, scmFileSet);
+ copyReleaseNotesToWorkingDirectory();
+ copyDistributionsIntoScmDirectoryStructure();
} catch (ScmException e) {
getLog().error("Could not commit files to dist: " + distSvnStagingUrl, e);
throw new MojoExecutionException("Could not commit files to dist: " + distSvnStagingUrl, e);
}
}
+
+ private void copyReleaseNotesToWorkingDirectory() throws MojoExecutionException {
+ StringBuffer copiedReleaseNotesAbsolutePath;
+ getLog().info("Copying RELEASE-NOTES.txt to working directory.");
+ File releaseNotes = new File(basedir + "/RELEASE-NOTES.txt");
+ copiedReleaseNotesAbsolutePath = new StringBuffer(workingDirectory.getAbsolutePath());
+ copiedReleaseNotesAbsolutePath.append("/scm/");
+ copiedReleaseNotesAbsolutePath.append(releaseNotes.getName());
+ File copiedReleaseNotes = new File(copiedReleaseNotesAbsolutePath.toString());
+ getLog().info("Copying: " + releaseNotes.getName());
+ SharedFunctions.copyFile(getLog(), releaseNotes, copiedReleaseNotes);
+ }
+
+ private void copyDistributionsIntoScmDirectoryStructure() throws MojoExecutionException {
+ List<File> workingDirectoryFiles = Arrays.asList(workingDirectory.listFiles());
+ String scmBinariesRoot = buildDistBinariesRoot();
+ String scmSourceRoot = buildDistSourceRoot();
+ File copy;
+ for (File file : workingDirectoryFiles) {
+ if (file.getName().contains("src")) {
+ copy = new File(scmSourceRoot + "/" + file.getName());
+ SharedFunctions.copyFile(getLog(), file, copy);
+ } else if (file.getName().contains("bin")) {
+ copy = new File(scmBinariesRoot + "/" + file.getName());
+ SharedFunctions.copyFile(getLog(), file, copy);
+ } else if (file.getName().contains("scm")){
+ //do nothing because we are copying into scm
+ } else {
+ copy = new File(distCheckoutDirectory.getAbsolutePath() + "/" + file.getName());
+ SharedFunctions.copyFile(getLog(), file, copy);
+ }
+ }
+ }
+
+ private String buildDistBinariesRoot() {
+ StringBuffer buffer = new StringBuffer(distCheckoutDirectory.getAbsolutePath());
+ buffer.append("/binaries");
+ return buffer.toString();
+ }
+
+ private String buildDistSourceRoot() {
+ StringBuffer buffer = new StringBuffer(distCheckoutDirectory.getAbsolutePath());
+ buffer.append("/source");
+ return buffer.toString();
+ }
}
[20/26] commons-release-plugin git commit: Starting testing
Posted by ch...@apache.org.
Starting testing
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/0433b1e0
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/0433b1e0
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/0433b1e0
Branch: refs/heads/master
Commit: 0433b1e0cb93f82f26561a3c98d9c5cd0a93919f
Parents: a5557ab
Author: Rob Tompkins <ch...@capitalone.com>
Authored: Fri Jan 5 16:02:36 2018 -0500
Committer: Rob Tompkins <ch...@capitalone.com>
Committed: Fri Jan 5 16:02:36 2018 -0500
----------------------------------------------------------------------
pom.xml | 22 ++++++++++
.../mojos/CommonsSiteCompressionMojoTest.java | 44 ++++++++++++++++++++
.../release/plugin/mojos/package-info.java | 17 ++++++++
.../release/plugin/stubs/MavenProjectStub.java | 20 +++++++++
.../release/plugin/stubs/package-info.java | 17 ++++++++
.../mojos/compress-site/compress-site.xml | 34 +++++++++++++++
.../mojos/compress-site/example-site/index.html | 6 +++
7 files changed, 160 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/0433b1e0/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c79db7c..24e5da3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -133,6 +133,28 @@
<version>1.15</version>
</dependency>
<dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>3.0.24</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jdom</groupId>
+ <artifactId>jdom</artifactId>
+ <version>1.1.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>1.9.5</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugin-testing</groupId>
+ <artifactId>maven-plugin-testing-harness</artifactId>
+ <version>3.3.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/0433b1e0/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
new file mode 100644
index 0000000..745a297
--- /dev/null
+++ b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.release.plugin.mojos;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+
+import java.io.File;
+
+/**
+ * Unit tests for {@link CommonsSiteCompressionMojo}.
+ *
+ * @author chtompki
+ * @since 1.0
+ */
+public class CommonsSiteCompressionMojoTest extends AbstractMojoTestCase {
+
+ protected CommonsSiteCompressionMojo mojo;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ File testFile = getTestFile("target/test-classes/mojos/compress-site/compress-site.xml");
+ mojo = (CommonsSiteCompressionMojo) lookupMojo("compress-site", testFile);
+ }
+
+ public void testCompressSite() throws MojoExecutionException, MojoFailureException {
+ mojo.execute();
+ }
+}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/0433b1e0/src/test/java/org/apache/commons/release/plugin/mojos/package-info.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/mojos/package-info.java b/src/test/java/org/apache/commons/release/plugin/mojos/package-info.java
new file mode 100644
index 0000000..32828f0
--- /dev/null
+++ b/src/test/java/org/apache/commons/release/plugin/mojos/package-info.java
@@ -0,0 +1,17 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.release.plugin.mojos;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/0433b1e0/src/test/java/org/apache/commons/release/plugin/stubs/MavenProjectStub.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/stubs/MavenProjectStub.java b/src/test/java/org/apache/commons/release/plugin/stubs/MavenProjectStub.java
new file mode 100644
index 0000000..3a7e104
--- /dev/null
+++ b/src/test/java/org/apache/commons/release/plugin/stubs/MavenProjectStub.java
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.release.plugin.stubs;
+
+public class MavenProjectStub {
+}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/0433b1e0/src/test/java/org/apache/commons/release/plugin/stubs/package-info.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/stubs/package-info.java b/src/test/java/org/apache/commons/release/plugin/stubs/package-info.java
new file mode 100644
index 0000000..95d9137
--- /dev/null
+++ b/src/test/java/org/apache/commons/release/plugin/stubs/package-info.java
@@ -0,0 +1,17 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.release.plugin.stubs;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/0433b1e0/src/test/resources/mojos/compress-site/compress-site.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/compress-site/compress-site.xml b/src/test/resources/mojos/compress-site/compress-site.xml
new file mode 100644
index 0000000..8bdcf5b
--- /dev/null
+++ b/src/test/resources/mojos/compress-site/compress-site.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>commons-release-plugin</artifactId>
+ <configuration>
+ <siteDirectory>${basedir}/target/test-classes/mojos/compress-site/example-site</siteDirectory>
+ <goals>site-deploy</goals>
+ <useReleaseProfile>true</useReleaseProfile>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/0433b1e0/src/test/resources/mojos/compress-site/example-site/index.html
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/compress-site/example-site/index.html b/src/test/resources/mojos/compress-site/example-site/index.html
new file mode 100644
index 0000000..515cdbe
--- /dev/null
+++ b/src/test/resources/mojos/compress-site/example-site/index.html
@@ -0,0 +1,6 @@
+<html>
+<header><title>Mock maven site</title></header>
+<body>
+mock body
+</body>
+</html>
\ No newline at end of file
[22/26] commons-release-plugin git commit: Getting dependencies
approximately correct for testing
Posted by ch...@apache.org.
Getting dependencies approximately correct for testing
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/b741c5b0
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/b741c5b0
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/b741c5b0
Branch: refs/heads/master
Commit: b741c5b0b933494a083254483d009e86e091503f
Parents: 097b028
Author: Rob Tompkins <ch...@apache.org>
Authored: Sat Jan 6 13:52:10 2018 -0500
Committer: Rob Tompkins <ch...@apache.org>
Committed: Sat Jan 6 13:52:10 2018 -0500
----------------------------------------------------------------------
pom.xml | 31 +++++++++++++-------
.../mojos/CommonsSiteCompressionMojoTest.java | 10 ++-----
.../mojos/compress-site/compress-site.xml | 21 ++++++++++++-
3 files changed, 44 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/b741c5b0/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d3a2816..ebc4b5f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -100,16 +100,16 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-compat</artifactId>
- <version>${maven.dependency.version}</version>
- </dependency>
- <dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.5</version>
</dependency>
<dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-utils</artifactId>
+ <version>3.2.0</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>2.2.1</version>
@@ -160,15 +160,26 @@
<version>1.1.3</version>
</dependency>
<dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>1.9.5</version>
- <scope>test</scope>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-api</artifactId>
+ <version>1.13.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
- <version>3.3.0</version>
+ <version>2.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-compat</artifactId>
+ <version>${maven.dependency.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-core</artifactId>
+ <version>${maven.dependency.version}</version>
<scope>test</scope>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/b741c5b0/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
index cc3f0b9..58f3031 100644
--- a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
+++ b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
@@ -16,8 +16,6 @@
*/
package org.apache.commons.release.plugin.mojos;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
import java.io.File;
@@ -32,12 +30,10 @@ public class CommonsSiteCompressionMojoTest extends AbstractMojoTestCase {
protected CommonsSiteCompressionMojo mojo;
- protected void setUp() throws Exception {
- super.setUp();
- }
-
public void testCompressSite() throws Exception {
- File testFile = getTestFile("target/test-classes/mojos/compress-site/compress-site.xml");
+ File testFile = new File("src/test/resources/mojos/compress-site/compress-site.xml");
+ assertNotNull(testFile);
+ assertTrue(testFile.exists());
mojo = (CommonsSiteCompressionMojo) lookupMojo("compress-site", testFile);
mojo.execute();
}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/b741c5b0/src/test/resources/mojos/compress-site/compress-site.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/compress-site/compress-site.xml b/src/test/resources/mojos/compress-site/compress-site.xml
index c392fdc..0d08ab7 100644
--- a/src/test/resources/mojos/compress-site/compress-site.xml
+++ b/src/test/resources/mojos/compress-site/compress-site.xml
@@ -17,13 +17,32 @@
~ specific language governing permissions and limitations
~ under the License.
-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
-<project>
+ <groupId>org.apache.commons.plugin.my.unit</groupId>
+ <artifactId>compress-site-test</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>Test MyMojo</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
<build>
<plugins>
<plugin>
+ <groupId>org.apache.commons</groupId>
<artifactId>commons-release-plugin</artifactId>
<configuration>
+ <distSvnStagingUrl>aBadUrl</distSvnStagingUrl>
<siteDirectory>${basedir}/target/test-classes/mojos/compress-site/example-site</siteDirectory>
</configuration>
</plugin>
[09/26] commons-release-plugin git commit: Adding site zipper,
not finished
Posted by ch...@apache.org.
Adding site zipper, not finished
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/e0b91288
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/e0b91288
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/e0b91288
Branch: refs/heads/master
Commit: e0b91288f4202f5b223b6f9251b4abe9f7889497
Parents: 9923a5a
Author: Rob Tompkins <ch...@gmail.com>
Authored: Mon Jan 1 13:27:46 2018 -0500
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Mon Jan 1 13:27:46 2018 -0500
----------------------------------------------------------------------
pom.xml | 5 +++++
.../mojos/CommonsDistributionDetatchmentMojo.java | 17 ++---------------
2 files changed, 7 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/e0b91288/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 664c9f8..1d8f463 100644
--- a/pom.xml
+++ b/pom.xml
@@ -112,6 +112,11 @@
<version>1.10</version>
</dependency>
<dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-compress</artifactId>
+ <version>1.15</version>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/e0b91288/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
index 4df4579..a0fe1b0 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
@@ -18,6 +18,7 @@ package org.apache.commons.release.plugin.mojos;
import edu.emory.mathcs.backport.java.util.Collections;
import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.release.plugin.SharedFunctions;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
@@ -90,26 +91,12 @@ public class CommonsDistributionDetatchmentMojo extends AbstractMojo {
for(AttachedArtifact artifactToRemove : detatchedArtifacts) {
project.getAttachedArtifacts().remove(artifactToRemove);
}
- initWorkingDirectory();
+ SharedFunctions.initWorkingDirectory(getLog(), workingDirectory);
copyRemovedArtifactsToWorkingDirectory();
getLog().info("");
sha1AndMd5SignArtifacts();
}
- private void initWorkingDirectory() throws MojoExecutionException {
- if (workingDirectory.exists()) {
- try {
- FileUtils.deleteDirectory(workingDirectory);
- } catch (IOException e) {
- getLog().error(e.getMessage());
- throw new MojoExecutionException("Unable to remove working directory: " + e.getMessage(), e);
- }
- }
- if (!workingDirectory.exists()) {
- workingDirectory.mkdirs();
- }
- }
-
private void copyRemovedArtifactsToWorkingDirectory() throws MojoExecutionException {
StringBuffer copiedArtifactAbsolutePath;
getLog().info("Copying detatched artifacts to working directory.");
[11/26] commons-release-plugin git commit: Adding extra files
Posted by ch...@apache.org.
Adding extra files
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/7cc0bd92
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/7cc0bd92
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/7cc0bd92
Branch: refs/heads/master
Commit: 7cc0bd923a60bbb21aaabcae8e96da04d516f577
Parents: 1953878
Author: Rob Tompkins <ch...@gmail.com>
Authored: Mon Jan 1 15:34:51 2018 -0500
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Mon Jan 1 15:34:51 2018 -0500
----------------------------------------------------------------------
.../commons/release/plugin/SharedFunctions.java | 42 +++++++++
.../plugin/handler/DistributionScmHandler.java | 11 +++
.../release/plugin/handler/package-info.java | 1 +
.../mojos/CommonsSiteCompressionMojo.java | 97 ++++++++++++++++++++
4 files changed, 151 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/7cc0bd92/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java b/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java
new file mode 100644
index 0000000..238d58b
--- /dev/null
+++ b/src/main/java/org/apache/commons/release/plugin/SharedFunctions.java
@@ -0,0 +1,42 @@
+package org.apache.commons.release.plugin;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.codehaus.plexus.util.FileUtils;
+
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * Shared static functions for all of our Mojos
+ *
+ * @author chtompki
+ * @since 1.0
+ */
+public class SharedFunctions {
+
+ private SharedFunctions() {
+ //Uitility Class
+ }
+
+ /**
+ * Cleans and then initializes an empty directory that is given by the <code>workingDirectory</code>
+ * parameter.
+ *
+ * @param log is the maven log for output logging, particularly in regards to error management.
+ * @param workingDirectory is a {@link File} that represents the directory to first attempt to delete then create.
+ */
+ public static void initWorkingDirectory(Log log, File workingDirectory) throws MojoExecutionException {
+ if (workingDirectory.exists()) {
+ try {
+ FileUtils.deleteDirectory(workingDirectory);
+ } catch (IOException e) {
+ log.error(e.getMessage());
+ throw new MojoExecutionException("Unable to remove working directory: " + e.getMessage(), e);
+ }
+ }
+ if (!workingDirectory.exists()) {
+ workingDirectory.mkdirs();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/7cc0bd92/src/main/java/org/apache/commons/release/plugin/handler/DistributionScmHandler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/handler/DistributionScmHandler.java b/src/main/java/org/apache/commons/release/plugin/handler/DistributionScmHandler.java
new file mode 100644
index 0000000..0a841f9
--- /dev/null
+++ b/src/main/java/org/apache/commons/release/plugin/handler/DistributionScmHandler.java
@@ -0,0 +1,11 @@
+package org.apache.commons.release.plugin.handler;
+
+import java.io.File;
+
+public class DistributionScmHandler {
+
+ public void checkoutDirectory(String scmUrl, File checkoutRootDirectory) {
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/7cc0bd92/src/main/java/org/apache/commons/release/plugin/handler/package-info.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/handler/package-info.java b/src/main/java/org/apache/commons/release/plugin/handler/package-info.java
new file mode 100644
index 0000000..064b55a
--- /dev/null
+++ b/src/main/java/org/apache/commons/release/plugin/handler/package-info.java
@@ -0,0 +1 @@
+package org.apache.commons.release.plugin.handler;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/7cc0bd92/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
new file mode 100644
index 0000000..5812061
--- /dev/null
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
@@ -0,0 +1,97 @@
+package org.apache.commons.release.plugin.mojos;
+
+import org.apache.commons.compress.archivers.zip.ParallelScatterZipCreator;
+import org.apache.commons.compress.archivers.zip.ScatterZipOutputStream;
+import org.apache.commons.release.plugin.SharedFunctions;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+/**
+ * Takes the built <code>./target/site</code> directory and compresses it to
+ * <code>./target/commons-release-plugin/site.zip</code>.
+ *
+ * @author chtompki
+ * @since 1.0
+ */
+@Mojo(name = "compress-site", defaultPhase = LifecyclePhase.POST_SITE, threadSafe = true)
+public class CommonsSiteCompressionMojo extends AbstractMojo {
+
+ @Parameter(defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory")
+ private File workingDirectory;
+
+ @Parameter(defaultValue = "${project.build.directory}/site", alias = "siteOutputDirectory")
+ private File siteDirectory;
+
+ private ScatterZipOutputStream dirs;
+
+ private ParallelScatterZipCreator scatterZipCreator;
+
+ private List<File> filesToCompress;
+
+ @Override
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ if (!workingDirectory.exists()) {
+ SharedFunctions.initWorkingDirectory(getLog(), workingDirectory);
+ }
+ try {
+ filesToCompress = new ArrayList<>();
+ getAllSiteFiles(siteDirectory, filesToCompress);
+ writeZipFile(workingDirectory, siteDirectory, filesToCompress);
+ } catch (IOException e) {
+ getLog().error("Failed to create ./target/commons-release-plugin/site.zip: " + e.getMessage(), e);
+ throw new MojoExecutionException("Failed to create ./target/commons-release-plugin/site.zip: " + e.getMessage(), e);
+ }
+ }
+
+ private void getAllSiteFiles(File siteDirectory, List<File> filesToCompress) throws IOException {
+ File[] files = siteDirectory.listFiles();
+ for (File file : files) {
+ filesToCompress.add(file);
+ if (file.isDirectory()) {
+ getAllSiteFiles(file, filesToCompress);
+ }
+ }
+ }
+
+ private void writeZipFile(File workingDirectory, File directoryToZip, List<File> fileList) throws IOException {
+ FileOutputStream fos = new FileOutputStream(workingDirectory.getAbsolutePath() + "/site.zip");
+ ZipOutputStream zos = new ZipOutputStream(fos);
+ for (File file : fileList) {
+ if (!file.isDirectory()) { // we only zip files, not directories
+ addToZip(directoryToZip, file, zos);
+ }
+ }
+ zos.close();
+ fos.close();
+ }
+
+ private void addToZip(File directoryToZip, File file, ZipOutputStream zos) throws IOException {
+ FileInputStream fis = new FileInputStream(file);
+ // we want the zipEntry's path to be a relative path that is relative
+ // to the directory being zipped, so chop off the rest of the path
+ String zipFilePath = file.getCanonicalPath().substring(directoryToZip.getCanonicalPath().length() + 1,
+ file.getCanonicalPath().length());
+ ZipEntry zipEntry = new ZipEntry(zipFilePath);
+ zos.putNextEntry(zipEntry);
+ byte[] bytes = new byte[1024];
+ int length;
+ while ((length = fis.read(bytes)) >= 0) {
+ zos.write(bytes, 0, length);
+ }
+ zos.closeEntry();
+ fis.close();
+ }
+}
[24/26] commons-release-plugin git commit: Happy new year
Posted by ch...@apache.org.
Happy new year
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/bb999955
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/bb999955
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/bb999955
Branch: refs/heads/master
Commit: bb999955f1ac5609d7a5c9ba5df93f883ffffa91
Parents: 977f9bb
Author: Rob Tompkins <ch...@apache.org>
Authored: Sat Jan 6 20:32:30 2018 -0500
Committer: Rob Tompkins <ch...@apache.org>
Committed: Sat Jan 6 20:32:30 2018 -0500
----------------------------------------------------------------------
NOTICE.txt | 2 +-
pom.xml | 1 +
.../mojos/CommonsSiteCompressionMojo.java | 11 +++--
.../mojos/CommonsSiteCompressionMojoTest.java | 20 +++++++-
.../compress-site/compress-site-failure.xml | 51 ++++++++++++++++++++
.../mojos/compress-site/compress-site.xml | 1 -
.../mojos/compress-site/example-site/index.html | 18 +++++++
7 files changed, 95 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/bb999955/NOTICE.txt
----------------------------------------------------------------------
diff --git a/NOTICE.txt b/NOTICE.txt
index c6952f6..17bc4f0 100644
--- a/NOTICE.txt
+++ b/NOTICE.txt
@@ -1,5 +1,5 @@
Apache Commons Build Plugin
-Copyright 2008-2017 The Apache Software Foundation
+Copyright 2008-2018 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/bb999955/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2061351..d0bc295 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,6 +69,7 @@
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.dependency.version>3.5.2</maven.dependency.version>
+ <commons.jacoco.version>0.7.9</commons.jacoco.version>
<commons.manifestfile/>
<commons.componentid>commons-release-plugin</commons.componentid>
<commons.jira.id>COMMONSSITE</commons.jira.id>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/bb999955/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
index b54e6af..c5d5af9 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojo.java
@@ -55,11 +55,6 @@ public class CommonsSiteCompressionMojo extends AbstractMojo {
@Parameter(defaultValue = "${project.build.directory}/site", alias = "siteOutputDirectory")
private File siteDirectory;
- /**
- */
- @Parameter(required = true)
- private String distSvnStagingUrl;
-
private ScatterZipOutputStream dirs;
private ParallelScatterZipCreator scatterZipCreator;
@@ -68,6 +63,12 @@ public class CommonsSiteCompressionMojo extends AbstractMojo {
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
+ if (!siteDirectory.exists()) {
+ getLog().error("\"mvn site\" was not run before this goal, or a siteDirectory did not exist.");
+ throw new MojoFailureException(
+ "\"mvn site\" was not run before this goal, or a siteDirectory did not exist."
+ );
+ }
if (!workingDirectory.exists()) {
SharedFunctions.initDirectory(getLog(), workingDirectory);
}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/bb999955/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
index d594149..50313b3 100644
--- a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
+++ b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
@@ -16,7 +16,7 @@
*/
package org.apache.commons.release.plugin.mojos;
-import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.testing.MojoRule;
import org.junit.Rule;
import org.junit.Test;
@@ -24,6 +24,7 @@ import org.junit.Test;
import java.io.File;
import static junit.framework.TestCase.assertTrue;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
/**
@@ -48,7 +49,7 @@ public class CommonsSiteCompressionMojoTest {
protected CommonsSiteCompressionMojo mojo;
@Test
- public void testCompressSite() throws Exception {
+ public void testCompressSiteSuccess() throws Exception {
File testFile = new File("src/test/resources/mojos/compress-site/compress-site.xml");
assertNotNull(testFile);
assertTrue(testFile.exists());
@@ -57,4 +58,19 @@ public class CommonsSiteCompressionMojoTest {
File siteZip = new File("target/commons-release-plugin/site.zip");
assertTrue(siteZip.exists());
}
+
+ @Test
+ public void testCompressSiteDirNonExistentFailure() throws Exception {
+ File testFile = new File("src/test/resources/mojos/compress-site/compress-site-failure.xml");
+ assertNotNull(testFile);
+ assertTrue(testFile.exists());
+ mojo = (CommonsSiteCompressionMojo) rule.lookupMojo("compress-site", testFile);
+ try {
+ mojo.execute();
+ } catch (MojoFailureException e) {
+ assertEquals(
+ "\"mvn site\" was not run before this goal, or a siteDirectory did not exist.", e.getMessage()
+ );
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/bb999955/src/test/resources/mojos/compress-site/compress-site-failure.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/compress-site/compress-site-failure.xml b/src/test/resources/mojos/compress-site/compress-site-failure.xml
new file mode 100644
index 0000000..1c3042d
--- /dev/null
+++ b/src/test/resources/mojos/compress-site/compress-site-failure.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.commons.plugin.my.unit</groupId>
+ <artifactId>compress-site-test-failure</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>Test MyMojo</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-release-plugin</artifactId>
+ <configuration>
+ <workingDirectory>target/commons-release-plugin</workingDirectory>
+ <siteDirectory>${basedir}/target/test-classes/mojos/junk</siteDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/bb999955/src/test/resources/mojos/compress-site/compress-site.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/compress-site/compress-site.xml b/src/test/resources/mojos/compress-site/compress-site.xml
index 40db1ac..c7e399b 100644
--- a/src/test/resources/mojos/compress-site/compress-site.xml
+++ b/src/test/resources/mojos/compress-site/compress-site.xml
@@ -43,7 +43,6 @@
<artifactId>commons-release-plugin</artifactId>
<configuration>
<workingDirectory>target/commons-release-plugin</workingDirectory>
- <distSvnStagingUrl>aBadUrl</distSvnStagingUrl>
<siteDirectory>${basedir}/target/test-classes/mojos/compress-site/example-site</siteDirectory>
</configuration>
</plugin>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/bb999955/src/test/resources/mojos/compress-site/example-site/index.html
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/compress-site/example-site/index.html b/src/test/resources/mojos/compress-site/example-site/index.html
index 515cdbe..c9a72dd 100644
--- a/src/test/resources/mojos/compress-site/example-site/index.html
+++ b/src/test/resources/mojos/compress-site/example-site/index.html
@@ -1,4 +1,22 @@
<html>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
<header><title>Mock maven site</title></header>
<body>
mock body
[13/26] commons-release-plugin git commit: Svn checkout of dist
working properly
Posted by ch...@apache.org.
Svn checkout of dist working properly
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/d365f0b0
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/d365f0b0
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/d365f0b0
Branch: refs/heads/master
Commit: d365f0b08d6e01664b3164bf9e48bdb0aba87dd0
Parents: 2a3a882
Author: Rob Tompkins <ch...@apache.org>
Authored: Tue Jan 2 14:22:50 2018 -0500
Committer: Rob Tompkins <ch...@apache.org>
Committed: Tue Jan 2 14:22:50 2018 -0500
----------------------------------------------------------------------
.../plugin/handler/DistributionScmHandler.java | 131 -------------------
.../release/plugin/handler/package-info.java | 17 ---
.../mojos/CommonsDistributionStagingMojo.java | 35 ++---
3 files changed, 12 insertions(+), 171 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/d365f0b0/src/main/java/org/apache/commons/release/plugin/handler/DistributionScmHandler.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/handler/DistributionScmHandler.java b/src/main/java/org/apache/commons/release/plugin/handler/DistributionScmHandler.java
deleted file mode 100644
index 4762dae..0000000
--- a/src/main/java/org/apache/commons/release/plugin/handler/DistributionScmHandler.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.release.plugin.handler;
-
-import org.apache.maven.scm.manager.NoSuchScmProviderException;
-import org.apache.maven.scm.manager.ScmManager;
-import org.apache.maven.scm.provider.ScmProviderRepository;
-import org.apache.maven.scm.provider.ScmProviderRepositoryWithHost;
-import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
-import org.apache.maven.scm.repository.ScmRepository;
-import org.apache.maven.scm.repository.ScmRepositoryException;
-import org.apache.maven.settings.Server;
-import org.apache.maven.settings.Settings;
-import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.Requirement;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
-import org.codehaus.plexus.util.StringUtils;
-import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher;
-import org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException;
-
-import java.io.File;
-
-@Component(role= DistributionScmHandler.class, instantiationStrategy = "singleton" )
-public class DistributionScmHandler extends AbstractLogEnabled {
-
- /**
- * The SCM manager.
- */
- @Requirement
- private ScmManager scmManager;
-
- /**
- * When this plugin requires Maven 3.0 as minimum, this component can be removed and o.a.m.s.c.SettingsDecrypter be
- * used instead.
- */
- @Requirement(hint = "mng-4384")
- private SecDispatcher secDispatcher;
-
- public void checkoutDirectory(String scmUrl, File checkoutRootDirectory) {
-
- }
-
- public ScmRepository getConfiguredRepository(String url,
- String username,
- String password,
- String privateKey,
- String passphrase,
- Settings settings)
- throws ScmRepositoryException, NoSuchScmProviderException {
- ScmRepository repository = scmManager.makeScmRepository(url);
- ScmProviderRepository scmRepo = repository.getProviderRepository();
- //MRELEASE-76
- scmRepo.setPersistCheckout(false);
- if (settings != null) {
- Server server = null;
- if (server == null && repository.getProviderRepository() instanceof ScmProviderRepositoryWithHost) {
- ScmProviderRepositoryWithHost repositoryWithHost =
- (ScmProviderRepositoryWithHost) repository.getProviderRepository();
- String host = repositoryWithHost.getHost();
- int port = repositoryWithHost.getPort();
- if (port > 0) {
- host += ":" + port;
- }
- // TODO: this is a bit dodgy - id is not host, but since we don't have a <host> field we make an assumption
- server = settings.getServer(host);
- }
-
- if (server != null) {
- if (username == null) {
- username = server.getUsername();
- }
- if (password == null) {
- password = decrypt(server.getPassword(), server.getId());
- }
- if (privateKey == null) {
- privateKey = server.getPrivateKey();
- }
- if (passphrase == null) {
- passphrase = decrypt(server.getPassphrase(), server.getId());
- }
- }
- }
- if (!StringUtils.isEmpty(username)) {
- scmRepo.setUser(username);
- }
- if (!StringUtils.isEmpty(password)) {
- scmRepo.setPassword(password);
- }
- if (scmRepo instanceof ScmProviderRepositoryWithHost) {
- ScmProviderRepositoryWithHost repositoryWithHost = (ScmProviderRepositoryWithHost) scmRepo;
- if (!StringUtils.isEmpty(privateKey)) {
- repositoryWithHost.setPrivateKey(privateKey);
- }
- if (!StringUtils.isEmpty(passphrase)) {
- repositoryWithHost.setPassphrase(passphrase);
- }
- }
- return repository;
- }
-
- private String decrypt(String str, String server) {
- try {
- return secDispatcher.decrypt(str);
- } catch (SecDispatcherException e) {
- String msg =
- "Failed to decrypt password/passphrase for server " + server + ", using auth token as is: "
- + e.getMessage();
- if (getLogger().isDebugEnabled()) {
- getLogger().warn(msg, e);
- } else {
- getLogger().warn(msg);
- }
- return str;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/d365f0b0/src/main/java/org/apache/commons/release/plugin/handler/package-info.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/handler/package-info.java b/src/main/java/org/apache/commons/release/plugin/handler/package-info.java
deleted file mode 100644
index 6f97164..0000000
--- a/src/main/java/org/apache/commons/release/plugin/handler/package-info.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.release.plugin.handler;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/d365f0b0/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
index 327d8c5..6fa1a52 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
@@ -23,9 +23,13 @@ import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.manager.BasicScmManager;
import org.apache.maven.scm.manager.NoSuchScmProviderException;
import org.apache.maven.scm.manager.ScmManager;
+import org.apache.maven.scm.provider.ScmProvider;
+import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.svn.svnexe.SvnExeScmProvider;
import org.apache.maven.scm.repository.ScmRepository;
import org.apache.maven.scm.repository.ScmRepositoryException;
@@ -38,11 +42,6 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
/**
*/
- @Parameter( defaultValue = "${settings}", readonly = true, required = true )
- private Settings settings;
-
- /**
- */
@Parameter( defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory" )
private File workingDirectory;
@@ -56,36 +55,26 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
@Parameter ( required = true )
private String distSvnStagingUrl;
- /**
- * The SCM username to use.
- */
- @Parameter( property = "username" )
- private String username;
-
- /**
- * The SCM password to use.
- */
- @Parameter( property = "password" )
- private String password;
-
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
try {
ScmManager scmManager = new BasicScmManager();
scmManager.setScmProvider("svn", new SvnExeScmProvider());
ScmRepository repository = scmManager.makeScmRepository(distSvnStagingUrl);
+ ScmProvider provider = scmManager.getProviderByRepository(repository);
+ ScmProviderRepository providerRepository = repository.getProviderRepository();
if (!workingDirectory.exists()) {
SharedFunctions.initDirectory(getLog(), workingDirectory);
}
if (!distCheckoutDirectory.exists()) {
SharedFunctions.initDirectory(getLog(), distCheckoutDirectory);
}
- } catch (ScmRepositoryException e) {
- getLog().error("Failed getting scm repository: " + distSvnStagingUrl, e);
- throw new MojoExecutionException("Failed getting scm repository: " + distSvnStagingUrl, e);
- } catch (NoSuchScmProviderException e) {
- getLog().error("No Scm Provider For: " + distSvnStagingUrl, e);
- throw new MojoExecutionException("No Scm Provider For: " + distSvnStagingUrl, e);
+ ScmFileSet scmFileSet = new ScmFileSet(distCheckoutDirectory);
+ getLog().info("Checking out dist from: " + distSvnStagingUrl);
+ provider.checkOut(repository, scmFileSet);
+ } catch (ScmException e) {
+ getLog().error("Could not commit files to dist: " + distSvnStagingUrl, e);
+ throw new MojoExecutionException("Could not commit files to dist: " + distSvnStagingUrl, e);
}
}
}
[18/26] commons-release-plugin git commit: Authentication does now
work
Posted by ch...@apache.org.
Authentication does now work
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/e1f50b99
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/e1f50b99
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/e1f50b99
Branch: refs/heads/master
Commit: e1f50b99d059d0571cb4e200a40877434d535e6a
Parents: ea0d256
Author: Rob Tompkins <ch...@apache.org>
Authored: Wed Jan 3 21:00:43 2018 -0500
Committer: Rob Tompkins <ch...@apache.org>
Committed: Wed Jan 3 21:00:43 2018 -0500
----------------------------------------------------------------------
.../mojos/CommonsDistributionStagingMojo.java | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/e1f50b99/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
index a829fdd..a708961 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
@@ -32,6 +32,7 @@ import org.apache.maven.scm.manager.BasicScmManager;
import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.provider.ScmProvider;
import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
import org.apache.maven.scm.provider.svn.svnexe.SvnExeScmProvider;
import org.apache.maven.scm.repository.ScmRepository;
@@ -53,7 +54,7 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
/**
*/
- @Parameter( defaultValue = "${project}", required = true )
+ @Parameter(defaultValue = "${project}", required = true )
private MavenProject project;
/**
@@ -71,6 +72,8 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
@Parameter(defaultValue = "${project.build.directory}/commons-release-plugin/scm", alias = "outputDirectory")
private File distCheckoutDirectory;
+ /**
+ */
@Parameter(defaultValue = "false")
private Boolean dryRun;
@@ -79,6 +82,16 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
@Parameter(required = true)
private String distSvnStagingUrl;
+ /**
+ */
+ @Parameter(property = "user.name")
+ private String username;
+
+ /**
+ */
+ @Parameter(property = "user.password")
+ private String password;
+
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
getLog().info("Preparing to stage distributions");
@@ -87,7 +100,9 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
scmManager.setScmProvider("svn", new SvnExeScmProvider());
ScmRepository repository = scmManager.makeScmRepository(distSvnStagingUrl);
ScmProvider provider = scmManager.getProviderByRepository(repository);
- ScmProviderRepository providerRepository = repository.getProviderRepository();
+ SvnScmProviderRepository providerRepository = (SvnScmProviderRepository) repository.getProviderRepository();
+ providerRepository.setUser(username);
+ providerRepository.setPassword(password);
if (!workingDirectory.exists()) {
SharedFunctions.initDirectory(getLog(), workingDirectory);
}
[25/26] commons-release-plugin git commit: Heading towards a test for
detatchment mojo
Posted by ch...@apache.org.
Heading towards a test for detatchment mojo
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/5d4ab8c4
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/5d4ab8c4
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/5d4ab8c4
Branch: refs/heads/master
Commit: 5d4ab8c4c3b024aae607d83f428be7cbb17568e5
Parents: bb99995
Author: Rob Tompkins <ch...@apache.org>
Authored: Sat Jan 6 20:50:57 2018 -0500
Committer: Rob Tompkins <ch...@apache.org>
Committed: Sat Jan 6 20:50:57 2018 -0500
----------------------------------------------------------------------
.../CommonsDistributionDetatchmentMojoTest.java | 54 +++++++++++++++++++
.../mojos/CommonsSiteCompressionMojoTest.java | 16 +++---
.../release/plugin/stubs/MavenProjectStub.java | 20 -------
.../release/plugin/stubs/package-info.java | 17 ------
.../detatch-distributions.xml | 51 ++++++++++++++++++
.../target/mockAttachedFile.html | 24 +++++++++
.../target/mockAttachedTar.tar.gz | Bin 0 -> 327 bytes
.../target/mockAttachedZip.zip | Bin 0 -> 1323 bytes
8 files changed, 137 insertions(+), 45 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/5d4ab8c4/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojoTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojoTest.java b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojoTest.java
new file mode 100644
index 0000000..7e7867d
--- /dev/null
+++ b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojoTest.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.release.plugin.mojos;
+
+import org.apache.maven.plugin.testing.MojoRule;
+import org.junit.Rule;
+import org.junit.Test;
+
+import java.io.File;
+
+import static junit.framework.TestCase.assertTrue;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Unit tests for {@link CommonsDistributionDetatchmentMojo}.
+ *
+ * @author chtompki
+ */
+public class CommonsDistributionDetatchmentMojoTest {
+
+ @Rule
+ public MojoRule rule = new MojoRule() {
+ @Override
+ protected void before() throws Throwable {
+ }
+
+ @Override
+ protected void after() {
+ }
+ };
+
+ private CommonsDistributionDetatchmentMojo mojo;
+
+ @Test
+ public void testSuccess() throws Exception {
+ File testPom = new File("src/test/resources/mojos/detatch-distributions/detatch-distributions.xml");
+ assertNotNull(testPom);
+ assertTrue(testPom.exists());
+ }
+}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/5d4ab8c4/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
index 50313b3..7d8efe6 100644
--- a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
+++ b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
@@ -50,10 +50,10 @@ public class CommonsSiteCompressionMojoTest {
@Test
public void testCompressSiteSuccess() throws Exception {
- File testFile = new File("src/test/resources/mojos/compress-site/compress-site.xml");
- assertNotNull(testFile);
- assertTrue(testFile.exists());
- mojo = (CommonsSiteCompressionMojo) rule.lookupMojo("compress-site", testFile);
+ File testPom = new File("src/test/resources/mojos/compress-site/compress-site.xml");
+ assertNotNull(testPom);
+ assertTrue(testPom.exists());
+ mojo = (CommonsSiteCompressionMojo) rule.lookupMojo("compress-site", testPom);
mojo.execute();
File siteZip = new File("target/commons-release-plugin/site.zip");
assertTrue(siteZip.exists());
@@ -61,10 +61,10 @@ public class CommonsSiteCompressionMojoTest {
@Test
public void testCompressSiteDirNonExistentFailure() throws Exception {
- File testFile = new File("src/test/resources/mojos/compress-site/compress-site-failure.xml");
- assertNotNull(testFile);
- assertTrue(testFile.exists());
- mojo = (CommonsSiteCompressionMojo) rule.lookupMojo("compress-site", testFile);
+ File testPom = new File("src/test/resources/mojos/compress-site/compress-site-failure.xml");
+ assertNotNull(testPom);
+ assertTrue(testPom.exists());
+ mojo = (CommonsSiteCompressionMojo) rule.lookupMojo("compress-site", testPom);
try {
mojo.execute();
} catch (MojoFailureException e) {
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/5d4ab8c4/src/test/java/org/apache/commons/release/plugin/stubs/MavenProjectStub.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/stubs/MavenProjectStub.java b/src/test/java/org/apache/commons/release/plugin/stubs/MavenProjectStub.java
deleted file mode 100644
index 3a7e104..0000000
--- a/src/test/java/org/apache/commons/release/plugin/stubs/MavenProjectStub.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.release.plugin.stubs;
-
-public class MavenProjectStub {
-}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/5d4ab8c4/src/test/java/org/apache/commons/release/plugin/stubs/package-info.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/stubs/package-info.java b/src/test/java/org/apache/commons/release/plugin/stubs/package-info.java
deleted file mode 100644
index 95d9137..0000000
--- a/src/test/java/org/apache/commons/release/plugin/stubs/package-info.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.release.plugin.stubs;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/5d4ab8c4/src/test/resources/mojos/detatch-distributions/detatch-distributions.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/detatch-distributions/detatch-distributions.xml b/src/test/resources/mojos/detatch-distributions/detatch-distributions.xml
new file mode 100644
index 0000000..c7e399b
--- /dev/null
+++ b/src/test/resources/mojos/detatch-distributions/detatch-distributions.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.commons.plugin.my.unit</groupId>
+ <artifactId>compress-site-test</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>Test MyMojo</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-release-plugin</artifactId>
+ <configuration>
+ <workingDirectory>target/commons-release-plugin</workingDirectory>
+ <siteDirectory>${basedir}/target/test-classes/mojos/compress-site/example-site</siteDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/5d4ab8c4/src/test/resources/mojos/detatch-distributions/target/mockAttachedFile.html
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/detatch-distributions/target/mockAttachedFile.html b/src/test/resources/mojos/detatch-distributions/target/mockAttachedFile.html
new file mode 100644
index 0000000..c9a72dd
--- /dev/null
+++ b/src/test/resources/mojos/detatch-distributions/target/mockAttachedFile.html
@@ -0,0 +1,24 @@
+<html>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<header><title>Mock maven site</title></header>
+<body>
+mock body
+</body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/5d4ab8c4/src/test/resources/mojos/detatch-distributions/target/mockAttachedTar.tar.gz
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/detatch-distributions/target/mockAttachedTar.tar.gz b/src/test/resources/mojos/detatch-distributions/target/mockAttachedTar.tar.gz
new file mode 100644
index 0000000..dda7e6c
Binary files /dev/null and b/src/test/resources/mojos/detatch-distributions/target/mockAttachedTar.tar.gz differ
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/5d4ab8c4/src/test/resources/mojos/detatch-distributions/target/mockAttachedZip.zip
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/detatch-distributions/target/mockAttachedZip.zip b/src/test/resources/mojos/detatch-distributions/target/mockAttachedZip.zip
new file mode 100644
index 0000000..1f34188
Binary files /dev/null and b/src/test/resources/mojos/detatch-distributions/target/mockAttachedZip.zip differ
[17/26] commons-release-plugin git commit: Authentication is now the
problem
Posted by ch...@apache.org.
Authentication is now the problem
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/ea0d256d
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/ea0d256d
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/ea0d256d
Branch: refs/heads/master
Commit: ea0d256d50eb3be306f90ece61f40cb2df85341b
Parents: eef80d6
Author: Rob Tompkins <ch...@apache.org>
Authored: Tue Jan 2 16:18:25 2018 -0500
Committer: Rob Tompkins <ch...@apache.org>
Committed: Tue Jan 2 16:18:25 2018 -0500
----------------------------------------------------------------------
.../mojos/CommonsDistributionStagingMojo.java | 28 ++++++++++++++------
1 file changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/ea0d256d/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
index 6e9ad33..a829fdd 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
@@ -24,23 +24,18 @@ import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.artifact.AttachedArtifact;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.command.add.AddScmResult;
+import org.apache.maven.scm.command.checkin.CheckInScmResult;
import org.apache.maven.scm.manager.BasicScmManager;
-import org.apache.maven.scm.manager.NoSuchScmProviderException;
import org.apache.maven.scm.manager.ScmManager;
import org.apache.maven.scm.provider.ScmProvider;
import org.apache.maven.scm.provider.ScmProviderRepository;
import org.apache.maven.scm.provider.svn.svnexe.SvnExeScmProvider;
import org.apache.maven.scm.repository.ScmRepository;
-import org.apache.maven.scm.repository.ScmRepositoryException;
-import org.apache.maven.settings.Settings;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -86,6 +81,7 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
+ getLog().info("Preparing to stage distributions");
try {
ScmManager scmManager = new BasicScmManager();
scmManager.setScmProvider("svn", new SvnExeScmProvider());
@@ -105,11 +101,26 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
List<File> filesToCommit = copyDistributionsIntoScmDirectoryStructure();
ScmFileSet scmFileSetToCommit = new ScmFileSet(distCheckoutDirectory, filesToCommit);
if (!dryRun) {
- provider.checkIn(
+ AddScmResult addResult = provider.add(
repository,
scmFileSetToCommit,
"Staging release: " + project.getArtifactId() + ", version: " + project.getVersion()
);
+ if (addResult.isSuccess()) {
+ getLog().info("Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());
+ CheckInScmResult checkInResult = provider.checkIn(
+ repository,
+ scmFileSetToCommit,
+ "Staging release: " + project.getArtifactId() + ", version: " + project.getVersion()
+ );
+ if (!checkInResult.isSuccess()) {
+ getLog().error("Committing dist files failed: " + checkInResult.getCommandOutput());
+ throw new MojoExecutionException("Committing dist files failed: " + checkInResult.getCommandOutput());
+ }
+ } else {
+ getLog().error("Adding dist files failed: " + addResult.getCommandOutput());
+ throw new MojoExecutionException("Adding dist files failed: " + addResult.getCommandOutput());
+ }
} else {
getLog().info("Would have committed to: " + distSvnStagingUrl);
getLog().info("Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());
@@ -155,6 +166,7 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
filesForMavenScmFileSet.add(copy);
}
}
+ filesForMavenScmFileSet.add(new File(distCheckoutDirectory + "/RELEASE-NOTES.txt"));
return filesForMavenScmFileSet;
}
[02/26] commons-release-plugin git commit: Starting project out
Posted by ch...@apache.org.
Starting project out
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/22442eca
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/22442eca
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/22442eca
Branch: refs/heads/master
Commit: 22442eca298929215de04ca51f7db51369566adb
Parents: 567e48b
Author: Rob Tompkins <ch...@gmail.com>
Authored: Fri Dec 22 20:57:31 2017 -0500
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Fri Dec 22 20:57:31 2017 -0500
----------------------------------------------------------------------
CONTRIBUTING.md | 97 ++++++++
LICENSE.txt | 202 ++++++++++++++++
NOTICE.txt | 5 +
README.md | 102 ++++++++-
pom.xml | 229 +++++++++++++++++++
src/assembly/src.xml | 39 ++++
src/changes/changes.xml | 32 +++
.../mojos/AbstractCommonsBuildPluginMojo.java | 28 +++
.../plugin/mojos/CommonsBuildPluginMojo.java | 32 +++
.../build/plugin/mojos/package-info.java | 17 ++
.../commons/build/plugin/package-info.java | 17 ++
src/site/site.xml | 36 +++
src/site/xdoc/index.xml | 75 ++++++
src/test-project/pom.xml | 56 +++++
14 files changed, 966 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/22442eca/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..4092304
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,97 @@
+<!---
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!---
+ +======================================================================+
+ |**** ****|
+ |**** THIS FILE IS GENERATED BY THE COMMONS BUILD PLUGIN ****|
+ |**** DO NOT EDIT DIRECTLY ****|
+ |**** ****|
+ +======================================================================+
+ | TEMPLATE FILE: contributing-md-template.md |
+ | commons-release-plugin/trunk/src/main/resources/commons-xdoc-templates |
+ +======================================================================+
+ | |
+ | 1) Re-generate using: mvn commons:contributing-md |
+ | |
+ | 2) Set the following properties in the component's pom: |
+ | - commons.jira.id (required, alphabetic, upper case) |
+ | |
+ | 3) Example Properties |
+ | |
+ | <properties> |
+ | <commons.jira.id>MATH</commons.jira.id> |
+ | </properties> |
+ | |
+ +======================================================================+
+--->
+Contributing to Apache Commons Release Plugin Maven Mojo
+======================
+
+You have found a bug or you have an idea for a cool new feature? Contributing code is a great way to give something back to
+the open source community. Before you dig right into the code there are a few guidelines that we need contributors to
+follow so that we can have a chance of keeping on top of things.
+
+Getting Started
+---------------
+
++ Make sure you have a [JIRA account](https://issues.apache.org/jira/).
++ Make sure you have a [GitHub account](https://github.com/signup/free).
++ If you're planning to implement a new feature it makes sense to discuss you're changes on the [dev list](https://commons.apache.org/mail-lists.html) first. This way you can make sure you're not wasting your time on something that isn't considered to be in Apache Commons Release Plugin Maven Mojo's scope.
++ Submit a ticket for your issue, assuming one does not already exist.
+ + Clearly describe the issue including steps to reproduce when it is a bug.
+ + Make sure you fill in the earliest version that you know has the issue.
++ Fork the repository on GitHub.
+
+Making Changes
+--------------
+
++ Create a topic branch from where you want to base your work (this is usually the master/trunk branch).
++ Make commits of logical units.
++ Respect the original code style:
+ + Only use spaces for indentation.
+ + Create minimal diffs - disable on save actions like reformat source code or organize imports. If you feel the source code should be reformatted create a separate PR for this change.
+ + Check for unnecessary whitespace with git diff --check before committing.
++ Make sure your commit messages are in the proper format. Your commit message should contain the key of the JIRA issue.
++ Make sure you have added the necessary tests for your changes.
++ Run all the tests with `mvn clean verify` to assure nothing else was accidentally broken.
+
+Making Trivial Changes
+----------------------
+
+For changes of a trivial nature to comments and documentation, it is not always necessary to create a new ticket in JIRA.
+In this case, it is appropriate to start the first line of a commit with '(doc)' instead of a ticket number.
+
+Submitting Changes
+------------------
+
++ Sign the [Contributor License Agreement][cla] if you haven't already.
++ Push your changes to a topic branch in your fork of the repository.
++ Submit a pull request to the repository in the apache organization.
++ Update your JIRA ticket and include a link to the pull request in the ticket.
+
+Additional Resources
+--------------------
+
++ [Contributing patches](https://commons.apache.org/patches.html)
++ [Apache Commons Release Plugin Maven Mojo JIRA project page](https://issues.apache.org/jira/browse/COMMONSSITE)
++ [Contributor License Agreement][cla]
++ [General GitHub documentation](https://help.github.com/)
++ [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
++ [Apache Commons Twitter Account](https://twitter.com/ApacheCommons)
++ #apachecommons IRC channel on freenode.org
+
+[cla]:https://www.apache.org/licenses/#clas
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/22442eca/LICENSE.txt
----------------------------------------------------------------------
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/22442eca/NOTICE.txt
----------------------------------------------------------------------
diff --git a/NOTICE.txt b/NOTICE.txt
new file mode 100644
index 0000000..c6952f6
--- /dev/null
+++ b/NOTICE.txt
@@ -0,0 +1,5 @@
+Apache Commons Build Plugin
+Copyright 2008-2017 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/22442eca/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index de3e927..5f60e63 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,101 @@
-# commons-release-plugin
\ No newline at end of file
+<!---
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!---
+ +======================================================================+
+ |**** ****|
+ |**** THIS FILE IS GENERATED BY THE COMMONS Release PLUGIN ****|
+ |**** DO NOT EDIT DIRECTLY ****|
+ |**** ****|
+ +======================================================================+
+ | TEMPLATE FILE: readme-md-template.md |
+ | commons-build-plugin/trunk/src/main/resources/commons-xdoc-templates |
+ +======================================================================+
+ | |
+ | 1) Re-generate using: mvn commons:readme-md |
+ | |
+ | 2) Set the following properties in the component's pom: |
+ | - commons.componentid (required, alphabetic, lower case) |
+ | - commons.release.version (required) |
+ | |
+ | 3) Example Properties |
+ | |
+ | <properties> |
+ | <commons.componentid>math</commons.componentid> |
+ | <commons.release.version>1.2</commons.release.version> |
+ | </properties> |
+ | |
+ +======================================================================+
+--->
+Apache Commons Release Plugin Maven Mojo
+===================
+
+Apache Maven Mojo for Apache Commons Release tasks.
+
+Documentation
+-------------
+
+More information can be found on the [homepage](https://commons.apache.org/proper/commons-commons-release-plugin).
+The [JavaDoc](https://commons.apache.org/proper/commons-commons-release-plugin/javadocs/api-release) can be browsed.
+Questions related to the usage of Apache Commons Release Plugin Maven Mojo should be posted to the [user mailing list][ml].
+
+[![Build Status](https://travis-ci.org/apache/commons-release-plugin.svg?branch=trunk)](https://travis-ci.org/apache/commons-release-plugin)
+[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.commons/commons-release-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.commons/commons-release-plugin)
+
+Where can I get the latest release?
+-----------------------------------
+You can download source and binaries from our [download page](https://commons.apache.org/proper/commons-commons-release-plugin/download_commons-release-plugin.cgi).
+
+Alternatively you can pull it from the central Maven repositories:
+
+```xml
+<dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-release-plugin</artifactId>
+ <version>1.7</version>
+</dependency>
+```
+
+Contributing
+------------
+
+We accept PRs via github. The [developer mailing list][ml] is the main channel of communication for contributors.
+There are some guidelines which will make applying PRs easier for us:
++ No tabs! Please use spaces for indentation.
++ Respect the code style.
++ Create minimal diffs - disable on save actions like reformat source code or organize imports. If you feel the source code should be reformatted create a separate PR for this change.
++ Provide JUnit tests for your changes and make sure your changes don't break any existing tests by running ```mvn clean test```.
+
+If you plan to contribute on a regular basis, please consider filing a [contributor license agreement](https://www.apache.org/licenses/#clas).
+You can learn more about contributing via GitHub in our [contribution guidelines](CONTRIBUTING.md).
+
+License
+-------
+Code is under the [Apache Licence v2](https://www.apache.org/licenses/LICENSE-2.0.txt).
+
+Donations
+---------
+You like Apache Commons Release Plugin Maven Mojo? Then [donate back to the ASF](https://www.apache.org/foundation/contributing.html) to support the development.
+
+Additional Resources
+--------------------
+
++ [Apache Commons Homepage](https://commons.apache.org/)
++ [Apache Issue Tracker (JIRA)](https://issues.apache.org/jira/)
++ [Apache Commons Twitter Account](https://twitter.com/ApacheCommons)
++ #apachecommons IRC channel on freenode.org
+
+[ml]:https://commons.apache.org/mail-lists.html
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/22442eca/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..444d72f
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,229 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-parent</artifactId>
+ <version>42</version>
+ </parent>
+ <artifactId>commons-release-plugin</artifactId>
+ <packaging>maven-plugin</packaging>
+ <version>0.1-SNAPSHOT</version>
+ <name>Apache Commons Release Plugin Maven Mojo</name>
+ <description>
+ Apache Maven Mojo for Apache Commons Release tasks.
+ </description>
+ <url>http://commons.apache.org/proper/commons-release-plugin/</url>
+ <issueManagement>
+ <system>jira</system>
+ <url>http://issues.apache.org/jira/browse/COMMONSSITE</url>
+ </issueManagement>
+ <inceptionYear>2008</inceptionYear>
+ <scm>
+ <connection>scm:git:http://git-wip-us.apache.org/repos/asf/commons-release-plugin.git</connection>
+ <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/commons-release-plugin.git</developerConnection>
+ <url>https://git-wip-us.apache.org/repos/asf?p=commons-release-plugin.git</url>
+ </scm>
+ <distributionManagement>
+ <site>
+ <id>commons.site</id>
+ <name>Apache Commons Site SVN</name>
+ <url>scm:svn:${commons.scmPubUrl}</url>
+ </site>
+ </distributionManagement>
+ <developers>
+ <developer>
+ <name>Rob Tompkins</name>
+ <id>chtompki</id>
+ <email>chtompki AT apache.org</email>
+ <timezone>-5</timezone>
+ </developer>
+ </developers>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools</artifactId>
+ <version>3.5</version>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ <version>3.5</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <targetPath>resources</targetPath>
+ </resource>
+ <resource>
+ <directory>${basedir}</directory>
+ <targetPath>META-INF</targetPath>
+ <includes>
+ <include>NOTICE.txt</include>
+ <include>LICENSE.txt</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>2.9</version>
+ <!-- Add the Ant plugin tools to the plugin -->
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-ant</artifactId>
+ <version>2.9</version>
+ </dependency>
+ </dependencies>
+
+ <configuration>
+ <goalPrefix>commons</goalPrefix>
+ </configuration>
+
+ <executions>
+ <execution>
+ <phase>pre-site</phase>
+ <goals>
+ <goal>xdoc</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>target/plugin-generated-xdocs</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assembly/src.xml</descriptor>
+ </descriptors>
+ <tarLongFileMode>gnu</tarLongFileMode>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <excludes>
+ <!-- template files which will be inserted into the middle of resulting page -->
+ <exclude>src/main/resources/commons-xdoc-templates/download-page-body.xml</exclude>
+ <exclude>src/main/resources/commons-xdoc-templates/download-page-foot.xml</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>versions-maven-plugin</artifactId>
+ <!-- Version 2.2 causes an NPE with Maven 3.3.9 -->
+ <version>2.3</version>
+ </plugin>
+ </plugins>
+ </build>
+ <reporting>
+ <plugins>
+
+ <!-- exclude surefire report -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <reportSets>
+ <reportSet/>
+ </reportSets>
+ </plugin>
+
+ <!-- exclude jdepend report -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jdepend-maven-plugin</artifactId>
+ <reportSets>
+ <reportSet/>
+ </reportSets>
+ </plugin>
+ </plugins>
+ </reporting>
+ <properties>
+ <maven.compiler.source>1.7</maven.compiler.source>
+ <maven.compiler.target>1.7</maven.compiler.target>
+ <commons.manifestfile/>
+ <commons.componentid>commons-release-plugin</commons.componentid>
+ <commons.jira.id>COMMONSSITE</commons.jira.id>
+ <commons.jira.pid>12310466&amp;component=12312401</commons.jira.pid>
+ <commons.release.version>${project.version}</commons.release.version>
+ <commons.rc.version>RC1</commons.rc.version>
+ <commons.site.path>commons-release-plugin</commons.site.path>
+ <commons.scmPubUrl>
+ https://svn.apache.org/repos/infra/websites/production/commons/content/proper/${commons.site.path}
+ </commons.scmPubUrl>
+ <commons.scmPubCheckoutDirectory>site-content</commons.scmPubCheckoutDirectory>
+ </properties>
+ <profiles>
+ <profile>
+ <id>setup-checkout</id>
+ <activation>
+ <file>
+ <missing>site-content</missing>
+ </file>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare-checkout</id>
+ <phase>pre-site</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <exec executable="svn">
+ <arg line="checkout --depth immediates ${commons.scmPubUrl} ${commons.scmPubCheckoutDirectory}"/>
+ </exec>
+
+ <exec executable="svn">
+ <arg line="update --set-depth exclude ${commons.scmPubCheckoutDirectory}/javadocs"/>
+ </exec>
+
+ <pathconvert pathsep=" " property="dirs">
+ <dirset dir="${commons.scmPubCheckoutDirectory}" includes="*"/>
+ </pathconvert>
+ <exec executable="svn">
+ <arg line="update --set-depth infinity ${dirs}"/>
+ </exec>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/22442eca/src/assembly/src.xml
----------------------------------------------------------------------
diff --git a/src/assembly/src.xml b/src/assembly/src.xml
new file mode 100644
index 0000000..7a2b2ce
--- /dev/null
+++ b/src/assembly/src.xml
@@ -0,0 +1,39 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<assembly>
+ <id>src</id>
+ <formats>
+ <format>tar.gz</format>
+ <format>zip</format>
+ </formats>
+ <baseDirectory>${project.artifactId}-${project.version}-src</baseDirectory>
+ <fileSets>
+ <fileSet>
+ <includes>
+ <include>CONTRIBUTING.md</include>
+ <include>LICENSE.txt</include>
+ <include>NOTICE.txt</include>
+ <include>pom.xml</include>
+ <include>RELEASE-NOTES.txt</include>
+ <include>README.md</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>src</directory>
+ </fileSet>
+ </fileSets>
+</assembly>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/22442eca/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
new file mode 100644
index 0000000..40196b8
--- /dev/null
+++ b/src/changes/changes.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- Description: http://maven.apache.org/plugins/maven-changes-plugin/changes.html -->
+
+<document>
+ <properties>
+ <title>Apache Commons Release Plugin Changes</title>
+ <author email="dev@commons.apache.org">Apache Commons Developers</author>
+ </properties>
+
+ <body>
+ <release version="1.0" date="YYYY-MM-DD" description="Feature release">
+ <action dev="chtompki" type="add">Placeholder</action>
+ </release>
+ </body>
+</document>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/22442eca/src/main/java/org/apache/commons/build/plugin/mojos/AbstractCommonsBuildPluginMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/build/plugin/mojos/AbstractCommonsBuildPluginMojo.java b/src/main/java/org/apache/commons/build/plugin/mojos/AbstractCommonsBuildPluginMojo.java
new file mode 100644
index 0000000..c3bedc4
--- /dev/null
+++ b/src/main/java/org/apache/commons/build/plugin/mojos/AbstractCommonsBuildPluginMojo.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.build.plugin.mojos;
+
+import org.apache.maven.plugin.AbstractMojo;
+
+/**
+ * Contains the logging mechanics for the commons-build-plugin.
+ *
+ * @author chtompki
+ * @since 1.8
+ */
+public abstract class AbstractCommonsBuildPluginMojo extends AbstractMojo {
+}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/22442eca/src/main/java/org/apache/commons/build/plugin/mojos/CommonsBuildPluginMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/build/plugin/mojos/CommonsBuildPluginMojo.java b/src/main/java/org/apache/commons/build/plugin/mojos/CommonsBuildPluginMojo.java
new file mode 100644
index 0000000..32d3ba6
--- /dev/null
+++ b/src/main/java/org/apache/commons/build/plugin/mojos/CommonsBuildPluginMojo.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.build.plugin.mojos;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugins.annotations.Mojo;
+
+/**
+ * @author chtompki
+ * @since 1.8
+ */
+@Mojo( name = "test", threadSafe = true )
+public class CommonsBuildPluginMojo extends AbstractMojo {
+
+ public void execute() {
+ getLog().info("Hello World");
+ }
+}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/22442eca/src/main/java/org/apache/commons/build/plugin/mojos/package-info.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/build/plugin/mojos/package-info.java b/src/main/java/org/apache/commons/build/plugin/mojos/package-info.java
new file mode 100644
index 0000000..2f50937
--- /dev/null
+++ b/src/main/java/org/apache/commons/build/plugin/mojos/package-info.java
@@ -0,0 +1,17 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.build.plugin.mojos;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/22442eca/src/main/java/org/apache/commons/build/plugin/package-info.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/build/plugin/package-info.java b/src/main/java/org/apache/commons/build/plugin/package-info.java
new file mode 100644
index 0000000..b3a065a
--- /dev/null
+++ b/src/main/java/org/apache/commons/build/plugin/package-info.java
@@ -0,0 +1,17 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.build.plugin;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/22442eca/src/site/site.xml
----------------------------------------------------------------------
diff --git a/src/site/site.xml b/src/site/site.xml
new file mode 100644
index 0000000..1c5d926
--- /dev/null
+++ b/src/site/site.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!--
+ $HeadURL$
+ $Revision$ $Date$
+ -->
+<project name="Commons Build Plugin">
+
+ <body>
+ <menu name="Build Plugin">
+ <item name="Overview" href="/index.html"/>
+ <item name="Help" href="/development.html">
+ <item name="Issue Tracking" href="/issue-tracking.html"/>
+ <item name="Development" href="/development.html"/>
+ <item name="Maven Plugins" href="http://maven.apache.org/guides/plugin/guide-ant-plugin-development.html"/>
+ <item name="Ant" href="http://ant.apache.org/manual/index.html"/>
+ </item>
+ </menu>
+ </body>
+
+</project>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/22442eca/src/site/xdoc/index.xml
----------------------------------------------------------------------
diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml
new file mode 100644
index 0000000..4c6427b
--- /dev/null
+++ b/src/site/xdoc/index.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!--
+ $HeadURL$
+ $Revision$ $Date$
+ -->
+<document>
+
+ <properties>
+ <title>Overview</title>
+ <author email="dev@commons.apache.org">Apache Commons Documentation Team</author>
+ </properties>
+
+ <body>
+
+ <section name="Build Plugin">
+
+ <p>
+ This is a <a href="http://maven.apache.org/">Maven 2.x/3.x</a>
+ <a href="http://ant.apache.org/">Ant</a> Plugin which is
+ used by <a href="http://commons.apache.org/">Apache Commons</a> builds. See
+ the <a href="development.html">Development</a> page for information to
+ help maintain this plugin.
+ </p>
+
+ </section>
+
+ <section name="Plugin Goals">
+ <p>
+ Available Goals:
+ <ul>
+ <li><a href="download-page.html">commons:download-page</a> - Generate a Download page for the component's latest release</li>
+ <li><a href="mail-page.html">commons:mail-page</a> - Generate a custom <i>Mailing List</i> page for a component</li>
+ <li><a href="jira-page.html">commons:jira-page</a> - Generate a custom <i>JIRA Issue Tracking</i> page for a component</li>
+ <li><a href="sandbox-jira-page.html">commons:sandbox-jira-page</a> - Generate a custom <i>JIRA Issue Tracking page</i> for a Sandbox component</li>
+ <li><a href="copy-javadoc-files-build.html">commons:copy-javadoc-files</a> - Copy NOTICE and LICENSE files to -javadoc jar</li>
+ <li><a href="readme-md.html">commons:readme-md</a> - Generate a README.md file containing information for contributors from GitHub</li>
+ <li><a href="contributing-md.html">commons:contributing-md</a> - Generate a CONTRIBUTING.md file containing information on how to contribute for contributors from GitHub</li>
+ </ul>
+ </p>
+ </section>
+
+ <section name="Trying out the plugin">
+ <p>
+ Configure the plugin in the <code><build></code> section of the <code>pom.xml</code>
+<source><![CDATA[
+<plugin>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-build-plugin</artifactId>
+ <version>1.6</version>
+</plugin>
+]]></source>
+ </p>
+ <p>
+ Configure any properties required by the goal and try executing.
+ </p>
+ </section>
+
+ </body>
+</document>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/22442eca/src/test-project/pom.xml
----------------------------------------------------------------------
diff --git a/src/test-project/pom.xml b/src/test-project/pom.xml
new file mode 100644
index 0000000..a02076f
--- /dev/null
+++ b/src/test-project/pom.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>test-project</artifactId>
+ <version>1.3</version>
+ <name>Test Project</name>
+ <description>
+ Commons Build Plugin Test Project.
+ </description>
+
+ <url>http://commons.apache.org/commons-build-plugin/</url>
+
+ <issueManagement>
+ <system>jira</system>
+ <url>http://issues.apache.org/jira/browse/COMMONSSITE</url>
+ </issueManagement>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-build-plugin</artifactId>
+ <version>1.3</version>
+ <configuration>
+ <commons.release.name>${project.artifactId}-${commons.release.version}</commons.release.name>
+ <commons.jira.id>COMMONSSITE</commons.jira.id>
+ <commons.jira.pid>12310466</commons.jira.pid>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <properties>
+ <commons.binary.suffix>-bin</commons.binary.suffix>
+ <commons.release.version>1.0</commons.release.version>
+ <commons.componentid>${project.artifactId}</commons.componentid>
+ </properties>
+
+</project>
[10/26] commons-release-plugin git commit: Properly zipping site up
and putting it in working directory
Posted by ch...@apache.org.
Properly zipping site up and putting it in working directory
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/19538787
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/19538787
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/19538787
Branch: refs/heads/master
Commit: 195387875df82a1f628c0e2eda8d737a7518bf1f
Parents: e0b9128
Author: Rob Tompkins <ch...@gmail.com>
Authored: Mon Jan 1 15:30:52 2018 -0500
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Mon Jan 1 15:30:52 2018 -0500
----------------------------------------------------------------------
.../release/plugin/mojos/CommonsDistributionDetatchmentMojo.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/19538787/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
index a0fe1b0..1d6d54e 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
@@ -91,7 +91,9 @@ public class CommonsDistributionDetatchmentMojo extends AbstractMojo {
for(AttachedArtifact artifactToRemove : detatchedArtifacts) {
project.getAttachedArtifacts().remove(artifactToRemove);
}
- SharedFunctions.initWorkingDirectory(getLog(), workingDirectory);
+ if (!workingDirectory.exists()) {
+ SharedFunctions.initWorkingDirectory(getLog(), workingDirectory);
+ }
copyRemovedArtifactsToWorkingDirectory();
getLog().info("");
sha1AndMd5SignArtifacts();
[03/26] commons-release-plugin git commit: Getting project buildable
Posted by ch...@apache.org.
Getting project buildable
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/9f86ea72
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/9f86ea72
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/9f86ea72
Branch: refs/heads/master
Commit: 9f86ea7205b8538251b1d5bc283874b0f728bca2
Parents: 22442ec
Author: Rob Tompkins <ch...@gmail.com>
Authored: Fri Dec 22 21:08:22 2017 -0500
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Fri Dec 22 21:08:22 2017 -0500
----------------------------------------------------------------------
pom.xml | 118 ++++---------------
.../mojos/AbstractCommonsBuildPluginMojo.java | 2 +-
.../plugin/mojos/CommonsBuildPluginMojo.java | 2 +-
.../commons/build/plugin/package-info.java | 17 +++
4 files changed, 45 insertions(+), 94 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/9f86ea72/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 444d72f..0a25031 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,20 +27,26 @@
<packaging>maven-plugin</packaging>
<version>0.1-SNAPSHOT</version>
<name>Apache Commons Release Plugin Maven Mojo</name>
+
<description>
Apache Maven Mojo for Apache Commons Release tasks.
</description>
+
<url>http://commons.apache.org/proper/commons-release-plugin/</url>
+
<issueManagement>
<system>jira</system>
<url>http://issues.apache.org/jira/browse/COMMONSSITE</url>
</issueManagement>
+
<inceptionYear>2008</inceptionYear>
+
<scm>
<connection>scm:git:http://git-wip-us.apache.org/repos/asf/commons-release-plugin.git</connection>
<developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/commons-release-plugin.git</developerConnection>
<url>https://git-wip-us.apache.org/repos/asf?p=commons-release-plugin.git</url>
</scm>
+
<distributionManagement>
<site>
<id>commons.site</id>
@@ -48,6 +54,7 @@
<url>scm:svn:${commons.scmPubUrl}</url>
</site>
</distributionManagement>
+
<developers>
<developer>
<name>Rob Tompkins</name>
@@ -57,12 +64,27 @@
</developer>
</developers>
+ <properties>
+ <maven.compiler.source>1.7</maven.compiler.source>
+ <maven.compiler.target>1.7</maven.compiler.target>
+ <commons.manifestfile/>
+ <commons.componentid>commons-release-plugin</commons.componentid>
+ <commons.jira.id>COMMONSSITE</commons.jira.id>
+ <commons.jira.pid>12310466&amp;component=12312401</commons.jira.pid>
+ <commons.release.version>${project.version}</commons.release.version>
+ <commons.rc.version>RC1</commons.rc.version>
+ <commons.site.path>commons-release-plugin</commons.site.path>
+ <commons.scmPubUrl>
+ https://svn.apache.org/repos/infra/websites/production/commons/content/proper/${commons.site.path}
+ </commons.scmPubUrl>
+ <commons.scmPubCheckoutDirectory>site-content</commons.scmPubCheckoutDirectory>
+ </properties>
+
<dependencies>
<dependency>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools</artifactId>
- <version>3.5</version>
- <type>pom</type>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>3.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
@@ -88,34 +110,6 @@
</resources>
<plugins>
<plugin>
- <artifactId>maven-plugin-plugin</artifactId>
- <version>2.9</version>
- <!-- Add the Ant plugin tools to the plugin -->
- <dependencies>
- <dependency>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-tools-ant</artifactId>
- <version>2.9</version>
- </dependency>
- </dependencies>
-
- <configuration>
- <goalPrefix>commons</goalPrefix>
- </configuration>
-
- <executions>
- <execution>
- <phase>pre-site</phase>
- <goals>
- <goal>xdoc</goal>
- </goals>
- <configuration>
- <outputDirectory>target/plugin-generated-xdocs</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
@@ -166,64 +160,4 @@
</plugin>
</plugins>
</reporting>
- <properties>
- <maven.compiler.source>1.7</maven.compiler.source>
- <maven.compiler.target>1.7</maven.compiler.target>
- <commons.manifestfile/>
- <commons.componentid>commons-release-plugin</commons.componentid>
- <commons.jira.id>COMMONSSITE</commons.jira.id>
- <commons.jira.pid>12310466&amp;component=12312401</commons.jira.pid>
- <commons.release.version>${project.version}</commons.release.version>
- <commons.rc.version>RC1</commons.rc.version>
- <commons.site.path>commons-release-plugin</commons.site.path>
- <commons.scmPubUrl>
- https://svn.apache.org/repos/infra/websites/production/commons/content/proper/${commons.site.path}
- </commons.scmPubUrl>
- <commons.scmPubCheckoutDirectory>site-content</commons.scmPubCheckoutDirectory>
- </properties>
- <profiles>
- <profile>
- <id>setup-checkout</id>
- <activation>
- <file>
- <missing>site-content</missing>
- </file>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>prepare-checkout</id>
- <phase>pre-site</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <exec executable="svn">
- <arg line="checkout --depth immediates ${commons.scmPubUrl} ${commons.scmPubCheckoutDirectory}"/>
- </exec>
-
- <exec executable="svn">
- <arg line="update --set-depth exclude ${commons.scmPubCheckoutDirectory}/javadocs"/>
- </exec>
-
- <pathconvert pathsep=" " property="dirs">
- <dirset dir="${commons.scmPubCheckoutDirectory}" includes="*"/>
- </pathconvert>
- <exec executable="svn">
- <arg line="update --set-depth infinity ${dirs}"/>
- </exec>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
</project>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/9f86ea72/src/main/java/org/apache/commons/build/plugin/mojos/AbstractCommonsBuildPluginMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/build/plugin/mojos/AbstractCommonsBuildPluginMojo.java b/src/main/java/org/apache/commons/build/plugin/mojos/AbstractCommonsBuildPluginMojo.java
index c3bedc4..ad26d7c 100644
--- a/src/main/java/org/apache/commons/build/plugin/mojos/AbstractCommonsBuildPluginMojo.java
+++ b/src/main/java/org/apache/commons/build/plugin/mojos/AbstractCommonsBuildPluginMojo.java
@@ -22,7 +22,7 @@ import org.apache.maven.plugin.AbstractMojo;
* Contains the logging mechanics for the commons-build-plugin.
*
* @author chtompki
- * @since 1.8
+ * @since 1.0
*/
public abstract class AbstractCommonsBuildPluginMojo extends AbstractMojo {
}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/9f86ea72/src/main/java/org/apache/commons/build/plugin/mojos/CommonsBuildPluginMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/build/plugin/mojos/CommonsBuildPluginMojo.java b/src/main/java/org/apache/commons/build/plugin/mojos/CommonsBuildPluginMojo.java
index 32d3ba6..ae75b57 100644
--- a/src/main/java/org/apache/commons/build/plugin/mojos/CommonsBuildPluginMojo.java
+++ b/src/main/java/org/apache/commons/build/plugin/mojos/CommonsBuildPluginMojo.java
@@ -21,7 +21,7 @@ import org.apache.maven.plugins.annotations.Mojo;
/**
* @author chtompki
- * @since 1.8
+ * @since 1.0
*/
@Mojo( name = "test", threadSafe = true )
public class CommonsBuildPluginMojo extends AbstractMojo {
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/9f86ea72/src/test/java/org/apache/commons/build/plugin/package-info.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/build/plugin/package-info.java b/src/test/java/org/apache/commons/build/plugin/package-info.java
new file mode 100644
index 0000000..b3a065a
--- /dev/null
+++ b/src/test/java/org/apache/commons/build/plugin/package-info.java
@@ -0,0 +1,17 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.build.plugin;
\ No newline at end of file
[05/26] commons-release-plugin git commit: adding licenses to all
files
Posted by ch...@apache.org.
adding licenses to all files
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/75c92308
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/75c92308
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/75c92308
Branch: refs/heads/master
Commit: 75c923080dc16ace9866389a906188ae71b522c4
Parents: f0c5441
Author: Rob Tompkins <ch...@gmail.com>
Authored: Sun Dec 24 08:30:14 2017 -0500
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Sun Dec 24 08:30:14 2017 -0500
----------------------------------------------------------------------
pom.xml | 10 +++
.../mojos/AbstractCommonsReleasePluginMojo.java | 28 ------
.../mojos/CommonsAssemblyStagingMojo.java | 91 ++++++++++++++++++++
.../plugin/mojos/CommonsReleasePluginMojo.java | 68 ---------------
4 files changed, 101 insertions(+), 96 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/75c92308/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6e01876..86d22a3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -96,6 +96,16 @@
<artifactId>maven-project</artifactId>
<version>2.2.1</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-provider-api</artifactId>
+ <version>2.12</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-providers</artifactId>
+ <version>2.10</version>
+ </dependency>
</dependencies>
<build>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/75c92308/src/main/java/org/apache/commons/release/plugin/mojos/AbstractCommonsReleasePluginMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/AbstractCommonsReleasePluginMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/AbstractCommonsReleasePluginMojo.java
deleted file mode 100644
index 7e78368..0000000
--- a/src/main/java/org/apache/commons/release/plugin/mojos/AbstractCommonsReleasePluginMojo.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.release.plugin.mojos;
-
-import org.apache.maven.plugin.AbstractMojo;
-
-/**
- * Contains the logging mechanics for the commons-release-plugin.
- *
- * @author chtompki
- * @since 1.0
- */
-public abstract class AbstractCommonsReleasePluginMojo extends AbstractMojo {
-}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/75c92308/src/main/java/org/apache/commons/release/plugin/mojos/CommonsAssemblyStagingMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsAssemblyStagingMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsAssemblyStagingMojo.java
new file mode 100644
index 0000000..4b9e3d6
--- /dev/null
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsAssemblyStagingMojo.java
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.release.plugin.mojos;
+
+import edu.emory.mathcs.backport.java.util.Collections;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.artifact.AttachedArtifact;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * The purpose of this maven mojo is to detach the artifacts generated by the maven-assembly-plugin,
+ * which for the Apache Commons Project do not get uploaded to Nexus, and putting those artifacts
+ * in the dev distribution location for apache projects.
+ *
+ * @author chtompki
+ * @since 1.0
+ */
+@Mojo( name = "test", defaultPhase = LifecyclePhase.VERIFY, threadSafe = true)
+public class CommonsAssemblyStagingMojo extends AbstractMojo {
+
+ /**
+ * A list of "artifact types" in the maven vernacular, to
+ * be detatched from the deployment. For the time being we want
+ * all artifacts generated by the maven-assembly-plugin to be detatched
+ * from the deployment, namely *-src.zip, *-src.tar.gz, *-bin.zip,
+ * *-bin.tar.gz, and the corresponding .asc pgp signatures.
+ */
+ private static final Set<String> ARTIFACT_TYPES_TO_DETATCH;
+ static {
+ Set<String> hashSet = new HashSet<>();
+ hashSet.add("zip");
+ hashSet.add("tar.gz");
+ hashSet.add("zip.asc");
+ hashSet.add("tar.gz.asc");
+ ARTIFACT_TYPES_TO_DETATCH = Collections.unmodifiableSet(hashSet);
+ }
+
+ /**
+ * This list is supposed to hold the maven references to the aformentioned artifacts so that we
+ * can upload them to svn after they've been detatched from the maven deployment.
+ */
+ private List<AttachedArtifact> detatchedArtifacts = new ArrayList<>();
+
+ /**
+ * The maven project context injection so that we can get a hold of the variables at hand.
+ */
+ @Parameter( defaultValue = "${project}", required = true )
+ private MavenProject project;
+
+ @Parameter( defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory" )
+ private File workingDirectory;
+
+ @Parameter ( required = true )
+ private String pubScmStagingUrl;
+
+ public void execute() {
+ getLog().info("Detatching Assemblies");
+ for (Object attachedArtifact : project.getAttachedArtifacts()) {
+ if (ARTIFACT_TYPES_TO_DETATCH.contains(((AttachedArtifact) attachedArtifact).getType())) {
+ detatchedArtifacts.add((AttachedArtifact) attachedArtifact);
+ }
+ }
+ for(AttachedArtifact artifactToRemove : detatchedArtifacts) {
+ project.getAttachedArtifacts().remove(artifactToRemove);
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/75c92308/src/main/java/org/apache/commons/release/plugin/mojos/CommonsReleasePluginMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsReleasePluginMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsReleasePluginMojo.java
deleted file mode 100644
index bc45bc1..0000000
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsReleasePluginMojo.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.release.plugin.mojos;
-
-import edu.emory.mathcs.backport.java.util.Collections;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.artifact.AttachedArtifact;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @author chtompki
- * @since 1.0
- *
- * , defaultPhase = LifecyclePhase.
- */
-@Mojo( name = "test", defaultPhase = LifecyclePhase.VERIFY, threadSafe = true)
-public class CommonsReleasePluginMojo extends AbstractMojo {
-
- private static final Set<String> ARTIFACT_TYPES_TO_DETATCH;
- static {
- Set<String> hashSet = new HashSet<>();
- hashSet.add("zip");
- hashSet.add("tar.gz");
- hashSet.add("zip.asc");
- hashSet.add("tar.gz.asc");
- ARTIFACT_TYPES_TO_DETATCH = Collections.unmodifiableSet(hashSet);
- }
-
- private List<AttachedArtifact> detatchedArtifacts = new ArrayList<>();
-
- @Parameter( defaultValue = "${project}", required = true )
- private MavenProject project;
-
- public void execute() {
- getLog().info("Detatching Assemblies");
- for (Object attachedArtifact : project.getAttachedArtifacts()) {
- if (ARTIFACT_TYPES_TO_DETATCH.contains(((AttachedArtifact) attachedArtifact).getType())) {
- detatchedArtifacts.add((AttachedArtifact) attachedArtifact);
- }
- }
- for(AttachedArtifact artifactToRemove : detatchedArtifacts) {
- project.getAttachedArtifacts().remove(artifactToRemove);
- }
- getLog().info("");
- }
-}
[21/26] commons-release-plugin git commit: A non working attempt at
getting testing working
Posted by ch...@apache.org.
A non working attempt at getting testing working
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/097b0283
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/097b0283
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/097b0283
Branch: refs/heads/master
Commit: 097b0283a8c3c08f90f1f7e0f13489e4c8652fc6
Parents: 0433b1e
Author: Rob Tompkins <ch...@capitalone.com>
Authored: Fri Jan 5 16:17:16 2018 -0500
Committer: Rob Tompkins <ch...@capitalone.com>
Committed: Fri Jan 5 16:17:16 2018 -0500
----------------------------------------------------------------------
pom.xml | 19 ++++++++++++++++++-
.../mojos/CommonsSiteCompressionMojoTest.java | 6 +++---
.../mojos/compress-site/compress-site.xml | 2 --
3 files changed, 21 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/097b0283/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 24e5da3..d3a2816 100644
--- a/pom.xml
+++ b/pom.xml
@@ -68,6 +68,7 @@
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
+ <maven.dependency.version>3.5.2</maven.dependency.version>
<commons.manifestfile/>
<commons.componentid>commons-release-plugin</commons.componentid>
<commons.jira.id>COMMONSSITE</commons.jira.id>
@@ -84,8 +85,24 @@
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
+ <artifactId>maven-core</artifactId>
+ <version>${maven.dependency.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
- <version>3.5.2</version>
+ <version>${maven.dependency.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact</artifactId>
+ <version>${maven.dependency.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-compat</artifactId>
+ <version>${maven.dependency.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/097b0283/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
index 745a297..cc3f0b9 100644
--- a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
+++ b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java
@@ -34,11 +34,11 @@ public class CommonsSiteCompressionMojoTest extends AbstractMojoTestCase {
protected void setUp() throws Exception {
super.setUp();
- File testFile = getTestFile("target/test-classes/mojos/compress-site/compress-site.xml");
- mojo = (CommonsSiteCompressionMojo) lookupMojo("compress-site", testFile);
}
- public void testCompressSite() throws MojoExecutionException, MojoFailureException {
+ public void testCompressSite() throws Exception {
+ File testFile = getTestFile("target/test-classes/mojos/compress-site/compress-site.xml");
+ mojo = (CommonsSiteCompressionMojo) lookupMojo("compress-site", testFile);
mojo.execute();
}
}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/097b0283/src/test/resources/mojos/compress-site/compress-site.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/mojos/compress-site/compress-site.xml b/src/test/resources/mojos/compress-site/compress-site.xml
index 8bdcf5b..c392fdc 100644
--- a/src/test/resources/mojos/compress-site/compress-site.xml
+++ b/src/test/resources/mojos/compress-site/compress-site.xml
@@ -25,8 +25,6 @@
<artifactId>commons-release-plugin</artifactId>
<configuration>
<siteDirectory>${basedir}/target/test-classes/mojos/compress-site/example-site</siteDirectory>
- <goals>site-deploy</goals>
- <useReleaseProfile>true</useReleaseProfile>
</configuration>
</plugin>
</plugins>
[06/26] commons-release-plugin git commit: Changing README.md a little
Posted by ch...@apache.org.
Changing README.md a little
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/31890506
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/31890506
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/31890506
Branch: refs/heads/master
Commit: 31890506ee7cb6fe70f0fca6d7affd8363c1056c
Parents: 75c9230
Author: Rob Tompkins <ch...@gmail.com>
Authored: Sun Dec 24 08:33:43 2017 -0500
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Sun Dec 24 08:33:43 2017 -0500
----------------------------------------------------------------------
README.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/31890506/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 5f60e63..4dc208f 100644
--- a/README.md
+++ b/README.md
@@ -40,17 +40,17 @@
| |
+======================================================================+
--->
-Apache Commons Release Plugin Maven Mojo
+Apache Commons Release Plugin.
===================
-Apache Maven Mojo for Apache Commons Release tasks.
+Apache Maven Plugin for Apache Commons Release tasks.
Documentation
-------------
More information can be found on the [homepage](https://commons.apache.org/proper/commons-commons-release-plugin).
The [JavaDoc](https://commons.apache.org/proper/commons-commons-release-plugin/javadocs/api-release) can be browsed.
-Questions related to the usage of Apache Commons Release Plugin Maven Mojo should be posted to the [user mailing list][ml].
+Questions related to the usage of Apache Commons Release Plugin should be posted to the [user mailing list][ml].
[![Build Status](https://travis-ci.org/apache/commons-release-plugin.svg?branch=trunk)](https://travis-ci.org/apache/commons-release-plugin)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.commons/commons-release-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.commons/commons-release-plugin)
[15/26] commons-release-plugin git commit: Close to getting maven to
commit to svn...didn't work though
Posted by ch...@apache.org.
Close to getting maven to commit to svn...didn't work though
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/af188007
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/af188007
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/af188007
Branch: refs/heads/master
Commit: af1880079c500cc32bbd5ed6d2923c263563047f
Parents: d1d0cb4
Author: Rob Tompkins <ch...@apache.org>
Authored: Tue Jan 2 15:51:53 2018 -0500
Committer: Rob Tompkins <ch...@apache.org>
Committed: Tue Jan 2 15:51:53 2018 -0500
----------------------------------------------------------------------
.../mojos/CommonsDistributionStagingMojo.java | 27 ++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/af188007/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
index 68d37ab..6e9ad33 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
@@ -23,6 +23,7 @@ import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.MavenProject;
import org.apache.maven.project.artifact.AttachedArtifact;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
@@ -40,6 +41,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -56,6 +58,11 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
/**
*/
+ @Parameter( defaultValue = "${project}", required = true )
+ private MavenProject project;
+
+ /**
+ */
@Parameter(defaultValue = "${basedir}")
private File basedir;
@@ -95,7 +102,18 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
getLog().info("Checking out dist from: " + distSvnStagingUrl);
provider.checkOut(repository, scmFileSet);
copyReleaseNotesToWorkingDirectory();
- copyDistributionsIntoScmDirectoryStructure();
+ List<File> filesToCommit = copyDistributionsIntoScmDirectoryStructure();
+ ScmFileSet scmFileSetToCommit = new ScmFileSet(distCheckoutDirectory, filesToCommit);
+ if (!dryRun) {
+ provider.checkIn(
+ repository,
+ scmFileSetToCommit,
+ "Staging release: " + project.getArtifactId() + ", version: " + project.getVersion()
+ );
+ } else {
+ getLog().info("Would have committed to: " + distSvnStagingUrl);
+ getLog().info("Staging release: " + project.getArtifactId() + ", version: " + project.getVersion());
+ }
} catch (ScmException e) {
getLog().error("Could not commit files to dist: " + distSvnStagingUrl, e);
throw new MojoExecutionException("Could not commit files to dist: " + distSvnStagingUrl, e);
@@ -114,25 +132,30 @@ public class CommonsDistributionStagingMojo extends AbstractMojo {
SharedFunctions.copyFile(getLog(), releaseNotes, copiedReleaseNotes);
}
- private void copyDistributionsIntoScmDirectoryStructure() throws MojoExecutionException {
+ private List<File> copyDistributionsIntoScmDirectoryStructure() throws MojoExecutionException {
List<File> workingDirectoryFiles = Arrays.asList(workingDirectory.listFiles());
String scmBinariesRoot = buildDistBinariesRoot();
String scmSourceRoot = buildDistSourceRoot();
+ List<File> filesForMavenScmFileSet = new ArrayList<>();
File copy;
for (File file : workingDirectoryFiles) {
if (file.getName().contains("src")) {
copy = new File(scmSourceRoot + "/" + file.getName());
SharedFunctions.copyFile(getLog(), file, copy);
+ filesForMavenScmFileSet.add(copy);
} else if (file.getName().contains("bin")) {
copy = new File(scmBinariesRoot + "/" + file.getName());
SharedFunctions.copyFile(getLog(), file, copy);
+ filesForMavenScmFileSet.add(copy);
} else if (file.getName().contains("scm")){
//do nothing because we are copying into scm
} else {
copy = new File(distCheckoutDirectory.getAbsolutePath() + "/" + file.getName());
SharedFunctions.copyFile(getLog(), file, copy);
+ filesForMavenScmFileSet.add(copy);
}
}
+ return filesForMavenScmFileSet;
}
private String buildDistBinariesRoot() {
[08/26] commons-release-plugin git commit: Staging other mojos for
use.
Posted by ch...@apache.org.
Staging other mojos for use.
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/9923a5a3
Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/9923a5a3
Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/9923a5a3
Branch: refs/heads/master
Commit: 9923a5a39a03d70dcefb2b76cdfbef5b294dfabf
Parents: a0b4bc2
Author: Rob Tompkins <ch...@gmail.com>
Authored: Mon Jan 1 11:46:55 2018 -0500
Committer: Rob Tompkins <ch...@gmail.com>
Committed: Mon Jan 1 11:46:55 2018 -0500
----------------------------------------------------------------------
.../CommonsDistributionDetatchmentMojo.java | 3 +-
.../mojos/CommonsDistributionStagingMojo.java | 13 +++++-
.../scm/AssemblyPublicationScmProvider.java | 45 --------------------
.../release/plugin/scm/package-info.java | 17 --------
4 files changed, 13 insertions(+), 65 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/9923a5a3/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
index 7cfdb1d..4df4579 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionDetatchmentMojo.java
@@ -29,7 +29,6 @@ import org.codehaus.plexus.util.FileUtils;
import java.io.File;
import java.io.FileInputStream;
-import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
@@ -46,7 +45,7 @@ import java.util.Set;
* @author chtompki
* @since 1.0
*/
-@Mojo( name = "detatch-assemblies", defaultPhase = LifecyclePhase.VERIFY, threadSafe = true)
+@Mojo( name = "detatch-distributions", defaultPhase = LifecyclePhase.VERIFY, threadSafe = true)
public class CommonsDistributionDetatchmentMojo extends AbstractMojo {
/**
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/9923a5a3/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
index 7f9ec67..b4741f2 100644
--- a/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
+++ b/src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java
@@ -1,14 +1,25 @@
package org.apache.commons.release.plugin.mojos;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import java.io.File;
-public class CommonsDistributionStagingMojo {
+@Mojo( name = "stage-distributions", defaultPhase = LifecyclePhase.DEPLOY, threadSafe = true)
+public class CommonsDistributionStagingMojo extends AbstractMojo {
@Parameter( defaultValue = "${project.build.directory}/commons-release-plugin", alias = "outputDirectory" )
private File workingDirectory;
@Parameter ( required = true )
private String distScmStagingUrl;
+
+ @Override
+ public void execute() throws MojoExecutionException, MojoFailureException {
+
+ }
}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/9923a5a3/src/main/java/org/apache/commons/release/plugin/scm/AssemblyPublicationScmProvider.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/scm/AssemblyPublicationScmProvider.java b/src/main/java/org/apache/commons/release/plugin/scm/AssemblyPublicationScmProvider.java
deleted file mode 100644
index 3f942cb..0000000
--- a/src/main/java/org/apache/commons/release/plugin/scm/AssemblyPublicationScmProvider.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.release.plugin.scm;
-
-import org.apache.maven.scm.ScmFileSet;
-
-import java.io.File;
-
-/**
- * @author chtompki
- * @since 1.0
- */
-public class AssemblyPublicationScmProvider {
-
- private static final String SCM_CHECKOUT_SUBDIRECTORY = "pub-scm";
-
- public static void prepareScmCheckoutDirectory(File pluginWorkingDirectory) {
- StringBuilder pubScmPath = new StringBuilder(pluginWorkingDirectory.getAbsolutePath());
- pubScmPath.append("/");
- pubScmPath.append(SCM_CHECKOUT_SUBDIRECTORY);
- File pubScmDirectory = new File(pubScmPath.toString());
- if (!pubScmDirectory.exists()) {
- pubScmDirectory.mkdirs();
- }
- }
-
- public void checkoutPubScmStagingUrl(String pubScmStagingUrl, File pluginWorkingDirectory) {
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/9923a5a3/src/main/java/org/apache/commons/release/plugin/scm/package-info.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/release/plugin/scm/package-info.java b/src/main/java/org/apache/commons/release/plugin/scm/package-info.java
deleted file mode 100644
index 8767dfc..0000000
--- a/src/main/java/org/apache/commons/release/plugin/scm/package-info.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.commons.release.plugin.scm;
\ No newline at end of file