Skip to content

Commit 8cfbab6

Browse files
authored
Reduce non-debug logging (#389)
* Reduce non-debug logging
1 parent bc04d18 commit 8cfbab6

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3436,7 +3436,7 @@ private String getJavadocExecutable() throws IOException {
34363436
//
34373437
// In Java 9 and above the JRE is no longer in a subdirectory of the
34383438
// JDK, i.e. the JRE and the JDK are merged. In this case the java
3439-
// command is installed to my-dir/bin/java along side the javadoc
3439+
// command is installed to my-dir/bin/java alongside the javadoc
34403440
// command. So the relative path from "java.home" to the javadoc
34413441
// command is bin/javadoc.
34423442
//
@@ -3451,8 +3451,9 @@ private String getJavadocExecutable() throws IOException {
34513451
// "JEP 220: Modular Run-Time Images"
34523452
// http://openjdk.java.net/jeps/220
34533453
// ----------------------------------------------------------------------
3454-
// For IBM's JDK 1.2
34553454
// CHECKSTYLE_ON: LineLength
3455+
3456+
// For IBM's JDK 1.2
34563457
if (SystemUtils.IS_OS_AIX) {
34573458
javadocExe =
34583459
new File(SystemUtils.getJavaHome() + File.separator + ".." + File.separator + "sh", javadocCommand);
@@ -3930,7 +3931,7 @@ private void copyAdditionalJavadocResources(File anOutputDirectory) throws Maven
39303931
selectors[0].setExcludes(new String[] {"META-INF/**"});
39313932
unArchiver.setFileSelectors(selectors);
39323933

3933-
getLog().info("Extracting contents of resources artifact: " + artifact.getArtifactId());
3934+
getLog().debug("Extracting contents of resources artifact: " + artifact.getArtifactId());
39343935
try {
39353936
unArchiver.extract();
39363937
} catch (ArchiverException e) {
@@ -5009,13 +5010,13 @@ private boolean isUpToDate(Commandline cmd) throws MavenReportException {
50095010
prvdata = null;
50105011
}
50115012
if (curdata.equals(prvdata)) {
5012-
getLog().info("Skipping javadoc generation, everything is up to date.");
5013+
getLog().debug("Skipping javadoc generation, everything is up to date.");
50135014
return true;
50145015
} else {
50155016
if (prvdata == null) {
5016-
getLog().info("No previous run data found, generating javadoc.");
5017+
getLog().debug("No previous run data found, generating javadoc.");
50175018
} else {
5018-
getLog().info("Configuration changed, re-generating javadoc.");
5019+
getLog().debug("Configuration changed, re-generating javadoc.");
50195020
if (getLog().isDebugEnabled()) {
50205021
List<String> newStrings = new ArrayList<>(curdata);
50215022
List<String> remStrings = new ArrayList<>(prvdata);
@@ -5365,14 +5366,13 @@ private List<OfflineLink> getModulesLinks() throws MavenReportException {
53655366
File location = new File(p.getBasedir(), javadocDirRelative);
53665367

53675368
if (!location.exists()) {
5369+
String javadocGoal = getFullJavadocGoal();
53685370
if (getLog().isDebugEnabled()) {
53695371
getLog().debug("Javadoc directory not found: " + location);
5372+
getLog().debug("The goal '" + javadocGoal + "' has not been previously called for the module: '"
5373+
+ p.getId() + "'. Trying to invoke it...");
53705374
}
53715375

5372-
String javadocGoal = getFullJavadocGoal();
5373-
getLog().info("The goal '" + javadocGoal + "' has not been previously called for the module: '"
5374-
+ p.getId() + "'. Trying to invoke it...");
5375-
53765376
File invokerDir = new File(project.getBuild().getDirectory(), "invoker");
53775377
invokerDir.mkdirs();
53785378
File invokerLogFile = FileUtils.createTempFile("maven-javadoc-plugin", ".txt", invokerDir);

src/main/java/org/apache/maven/plugins/javadoc/JavadocJarMojo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ private File generateArchive(File javadocFiles, String jarFileName) throws Archi
270270
}
271271

272272
if (useDefaultManifestFile && defaultManifestFile.exists() && archive.getManifestFile() == null) {
273-
getLog().info("Adding existing MANIFEST to archive. Found under: " + defaultManifestFile.getPath());
273+
getLog().debug("Adding existing MANIFEST to archive. Found under: " + defaultManifestFile.getPath());
274274
archive.setManifestFile(defaultManifestFile);
275275
}
276276

src/test/java/org/apache/maven/plugins/javadoc/JavadocJarMojoTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,13 @@ public void testStale() throws Exception {
192192

193193
new File(getBasedir(), "target/test/unit/stale-test/target/maven-javadoc-plugin-stale-data.txt").delete();
194194
mojo.execute();
195-
assertThat(log.getMessages()).contains("[INFO] No previous run data found, generating javadoc.");
195+
assertThat(log.getMessages()).contains("[DEBUG] No previous run data found, generating javadoc.");
196196

197197
Thread.sleep(500);
198198

199199
log.getMessages().clear();
200200
mojo.execute();
201-
assertThat(log.getMessages()).contains("[INFO] Skipping javadoc generation, everything is up to date.");
201+
assertThat(log.getMessages()).contains("[DEBUG] Skipping javadoc generation, everything is up to date.");
202202
}
203203

204204
private static class BufferingLog implements Log {

0 commit comments

Comments
 (0)