This is an automated email from the ASF dual-hosted git repository.
sjaranowski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new 0d88b668 Only log dependency classpath when no property/file output is
specified
0d88b668 is described below
commit 0d88b668ca4e192534bbba6402e9051aae8229ab
Author: Michael Walser <[email protected]>
AuthorDate: Fri Nov 7 12:09:26 2025 +0100
Only log dependency classpath when no property/file output is specified
---
.../dependency/fromDependencies/BuildClasspathMojo.java | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git
a/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java
b/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java
index c0cc14f0..b1584a70 100644
---
a/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java
+++
b/src/main/java/org/apache/maven/plugins/dependency/fromDependencies/BuildClasspathMojo.java
@@ -91,12 +91,14 @@ public class BuildClasspathMojo extends
AbstractDependencyFilterMojo implements
/**
* If defined, the name of a property to which the classpath string will
be written.
+ * If neither this nor the outputFile parameter is set, the classpath will
be logged at INFO level.
*/
@Parameter(property = "mdep.outputProperty")
private String outputProperty;
/**
- * The file to write the classpath string. If undefined, it just prints
the classpath as [INFO].
+ * If defined, the file to which the classpath string will be written.
+ * If neither this nor the outputProperty parameter is set, the classpath
will be logged at INFO level.
*/
@Parameter(property = "mdep.outputFile")
private File outputFile;
@@ -237,15 +239,18 @@ public class BuildClasspathMojo extends
AbstractDependencyFilterMojo implements
}
}
- if (outputFile == null) {
- getLog().info("Dependencies classpath:" + System.lineSeparator() +
cpString);
- } else {
+ if (outputFile != null) {
if (regenerateFile || !isUpToDate(cpString)) {
storeClasspathFile(cpString, outputFile);
} else {
this.getLog().info("Skipped writing classpath file '" +
outputFile + "'. No changes found.");
}
}
+
+ if (outputProperty == null && outputFile == null) {
+ getLog().info("Dependencies classpath:" + System.lineSeparator() +
cpString);
+ }
+
if (attach) {
attachFile(cpString);
}