This is an automated email from the ASF dual-hosted git repository. rmannibucau pushed a commit to branch rmannibucau/MJAR-276_avoid-useless-warning-when-jar-creation-is-forced-even-empty in repository https://gitbox.apache.org/repos/asf/maven-jar-plugin.git
commit 4027e40376031d8be01abddeb21de16e98ea0c58 Author: Romain Manni-Bucau <rmannibu...@gmail.com> AuthorDate: Wed Dec 2 09:48:50 2020 +0100 [MJAR-276] don't log useless warning when jar creation is forced and directory does not exist --- src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java b/src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java index 68da0ec..d7b298f 100644 --- a/src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java +++ b/src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java @@ -266,7 +266,10 @@ public abstract class AbstractJarMojo File contentDirectory = getClassesDirectory(); if ( !contentDirectory.exists() ) { - getLog().warn( "JAR will be empty - no content was marked for inclusion!" ); + if ( !forceCreation ) + { + getLog().warn( "JAR will be empty - no content was marked for inclusion!" ); + } } else {