You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2025/06/03 18:31:23 UTC
(maven-javadoc-plugin) branch master updated: Reduce non-debug logging (#389)
This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new 8cfbab6a Reduce non-debug logging (#389)
8cfbab6a is described below
commit 8cfbab6a75d7942254737e0e53f15b201ee552ef
Author: Elliotte Rusty Harold <el...@users.noreply.github.com>
AuthorDate: Tue Jun 3 18:31:18 2025 +0000
Reduce non-debug logging (#389)
* Reduce non-debug logging
---
.../maven/plugins/javadoc/AbstractJavadocMojo.java | 20 ++++++++++----------
.../apache/maven/plugins/javadoc/JavadocJarMojo.java | 2 +-
.../maven/plugins/javadoc/JavadocJarMojoTest.java | 4 ++--
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
index a6b59161..7c3cb593 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
@@ -3436,7 +3436,7 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
//
// In Java 9 and above the JRE is no longer in a subdirectory of the
// JDK, i.e. the JRE and the JDK are merged. In this case the java
- // command is installed to my-dir/bin/java along side the javadoc
+ // command is installed to my-dir/bin/java alongside the javadoc
// command. So the relative path from "java.home" to the javadoc
// command is bin/javadoc.
//
@@ -3451,8 +3451,9 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
// "JEP 220: Modular Run-Time Images"
// http://openjdk.java.net/jeps/220
// ----------------------------------------------------------------------
- // For IBM's JDK 1.2
// CHECKSTYLE_ON: LineLength
+
+ // For IBM's JDK 1.2
if (SystemUtils.IS_OS_AIX) {
javadocExe =
new File(SystemUtils.getJavaHome() + File.separator + ".." + File.separator + "sh", javadocCommand);
@@ -3930,7 +3931,7 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
selectors[0].setExcludes(new String[] {"META-INF/**"});
unArchiver.setFileSelectors(selectors);
- getLog().info("Extracting contents of resources artifact: " + artifact.getArtifactId());
+ getLog().debug("Extracting contents of resources artifact: " + artifact.getArtifactId());
try {
unArchiver.extract();
} catch (ArchiverException e) {
@@ -5009,13 +5010,13 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
prvdata = null;
}
if (curdata.equals(prvdata)) {
- getLog().info("Skipping javadoc generation, everything is up to date.");
+ getLog().debug("Skipping javadoc generation, everything is up to date.");
return true;
} else {
if (prvdata == null) {
- getLog().info("No previous run data found, generating javadoc.");
+ getLog().debug("No previous run data found, generating javadoc.");
} else {
- getLog().info("Configuration changed, re-generating javadoc.");
+ getLog().debug("Configuration changed, re-generating javadoc.");
if (getLog().isDebugEnabled()) {
List<String> newStrings = new ArrayList<>(curdata);
List<String> remStrings = new ArrayList<>(prvdata);
@@ -5365,14 +5366,13 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
File location = new File(p.getBasedir(), javadocDirRelative);
if (!location.exists()) {
+ String javadocGoal = getFullJavadocGoal();
if (getLog().isDebugEnabled()) {
getLog().debug("Javadoc directory not found: " + location);
+ getLog().debug("The goal '" + javadocGoal + "' has not been previously called for the module: '"
+ + p.getId() + "'. Trying to invoke it...");
}
- String javadocGoal = getFullJavadocGoal();
- getLog().info("The goal '" + javadocGoal + "' has not been previously called for the module: '"
- + p.getId() + "'. Trying to invoke it...");
-
File invokerDir = new File(project.getBuild().getDirectory(), "invoker");
invokerDir.mkdirs();
File invokerLogFile = FileUtils.createTempFile("maven-javadoc-plugin", ".txt", invokerDir);
diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocJarMojo.java b/src/main/java/org/apache/maven/plugins/javadoc/JavadocJarMojo.java
index 3d840ac0..f5d8ae18 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocJarMojo.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocJarMojo.java
@@ -270,7 +270,7 @@ public class JavadocJarMojo extends AbstractJavadocMojo {
}
if (useDefaultManifestFile && defaultManifestFile.exists() && archive.getManifestFile() == null) {
- getLog().info("Adding existing MANIFEST to archive. Found under: " + defaultManifestFile.getPath());
+ getLog().debug("Adding existing MANIFEST to archive. Found under: " + defaultManifestFile.getPath());
archive.setManifestFile(defaultManifestFile);
}
diff --git a/src/test/java/org/apache/maven/plugins/javadoc/JavadocJarMojoTest.java b/src/test/java/org/apache/maven/plugins/javadoc/JavadocJarMojoTest.java
index 3db81a58..a5ddc562 100644
--- a/src/test/java/org/apache/maven/plugins/javadoc/JavadocJarMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/javadoc/JavadocJarMojoTest.java
@@ -192,13 +192,13 @@ public class JavadocJarMojoTest extends AbstractMojoTestCase {
new File(getBasedir(), "target/test/unit/stale-test/target/maven-javadoc-plugin-stale-data.txt").delete();
mojo.execute();
- assertThat(log.getMessages()).contains("[INFO] No previous run data found, generating javadoc.");
+ assertThat(log.getMessages()).contains("[DEBUG] No previous run data found, generating javadoc.");
Thread.sleep(500);
log.getMessages().clear();
mojo.execute();
- assertThat(log.getMessages()).contains("[INFO] Skipping javadoc generation, everything is up to date.");
+ assertThat(log.getMessages()).contains("[DEBUG] Skipping javadoc generation, everything is up to date.");
}
private static class BufferingLog implements Log {