You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2024/06/08 18:55:03 UTC
(maven-dependency-plugin) branch lock-down-classifier updated (a44eb5ab -> 04c32164)
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a change to branch lock-down-classifier
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git
omit a44eb5ab [MDEP-939] Lock down classifier in dependency:sources goal
add 9fd4ed53 Revert "Fix sources goal for multimodule projects"
new 04c32164 [MDEP-939] Lock down classifier in dependency:sources goal
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (a44eb5ab)
\
N -- N -- N refs/heads/lock-down-classifier (04c32164)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/it/projects/sources/module-a/pom.xml | 48 ----------------------
src/it/projects/sources/module-b/pom.xml | 48 ----------------------
src/it/projects/sources/pom.xml | 18 ++++----
src/it/projects/sources/test.properties | 5 ++-
.../resolvers/ResolveDependencySourcesMojo.java | 2 +-
5 files changed, 14 insertions(+), 107 deletions(-)
delete mode 100644 src/it/projects/sources/module-a/pom.xml
delete mode 100644 src/it/projects/sources/module-b/pom.xml
(maven-dependency-plugin) 01/01: [MDEP-939] Lock down classifier in dependency:sources goal
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch lock-down-classifier
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git
commit 04c32164bcb3ecef6115616fee291d5ee071d370
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Fri Jun 7 23:54:02 2024 +0200
[MDEP-939] Lock down classifier in dependency:sources goal
This closes #409
---
src/it/projects/sources/test.properties | 6 ++++--
.../resolvers/ResolveDependencySourcesMojo.java | 19 +++++--------------
2 files changed, 9 insertions(+), 16 deletions(-)
diff --git a/src/it/projects/sources/test.properties b/src/it/projects/sources/test.properties
index 238ec42e..d6b4c923 100644
--- a/src/it/projects/sources/test.properties
+++ b/src/it/projects/sources/test.properties
@@ -5,9 +5,9 @@
# 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
@@ -16,3 +16,5 @@
# under the License.
outputFile = target/resolved.txt
+# This is intentional to prove that no classifier is passed (read-only value)
+classifier = foo
diff --git a/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependencySourcesMojo.java b/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependencySourcesMojo.java
index 21e8cce3..cc1300e7 100644
--- a/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependencySourcesMojo.java
+++ b/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolveDependencySourcesMojo.java
@@ -18,9 +18,9 @@
*/
package org.apache.maven.plugins.dependency.resolvers;
-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.plugins.annotations.ResolutionScope;
/**
@@ -36,19 +36,10 @@ import org.apache.maven.plugins.annotations.ResolutionScope;
threadSafe = true)
public class ResolveDependencySourcesMojo extends ResolveDependenciesMojo {
- private static final String SOURCE_CLASSIFIER = "sources";
+ private static final String SOURCES_CLASSIFIER = "sources";
- /**
- * Main entry into mojo. Gets the list of dependencies and iterates through resolving the source jars.
- *
- * @throws MojoExecutionException with a message if an error occurs.
- */
- @Override
- protected void doExecute() throws MojoExecutionException {
- if (this.classifier == null || this.classifier.isEmpty()) {
- this.classifier = SOURCE_CLASSIFIER;
- }
-
- super.doExecute();
+ @Parameter(name = "classifier", defaultValue = SOURCES_CLASSIFIER, readonly = true)
+ public void setClassifier(String classifier) {
+ this.classifier = classifier;
}
}