[ 
https://issues.apache.org/jira/browse/MNG-8140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17852904#comment-17852904
 ] 

ASF GitHub Bot commented on MNG-8140:
-------------------------------------

cstamas commented on code in PR #1555:
URL: https://github.com/apache/maven/pull/1555#discussion_r1630034144


##########
maven-core/src/main/java/org/apache/maven/internal/aether/LoggingRepositoryListener.java:
##########
@@ -96,12 +96,7 @@ public void artifactDescriptorInvalid(RepositoryEvent event) 
{
         buffer.append("The POM for ");
         buffer.append(event.getArtifact());
         buffer.append(" is invalid, transitive dependencies (if any) will not 
be available");
-
-        if (logger.isDebugEnabled()) {
-            logger.warn(buffer + ": " + event.getException().getMessage());
-        } else {
-            logger.warn(buffer + ", enable debug logging for more details");
-        }
+        logger.warn(buffer + ": " + event.getException().getMessage());

Review Comment:
   WDYM "even in debug level"? This listener is triggered when there is invalid 
model reported... stack trace WHERE (in Maven core) is totally irrelevant, it 
is much much import WHY and WHICH model was invalid.



##########
maven-core/src/main/java/org/apache/maven/internal/aether/LoggingRepositoryListener.java:
##########
@@ -96,12 +96,7 @@ public void artifactDescriptorInvalid(RepositoryEvent event) 
{
         buffer.append("The POM for ");
         buffer.append(event.getArtifact());
         buffer.append(" is invalid, transitive dependencies (if any) will not 
be available");
-
-        if (logger.isDebugEnabled()) {
-            logger.warn(buffer + ": " + event.getException().getMessage());
-        } else {
-            logger.warn(buffer + ", enable debug logging for more details");
-        }
+        logger.warn(buffer + ": " + event.getException().getMessage());

Review Comment:
   WDYM "even in debug level"? This listener is triggered when there is invalid 
model reported... stack trace WHERE (in Maven core) is totally irrelevant, it 
is much much important WHY and WHICH model was invalid.





> When a model is discarded (by model builder) for whatever reason, show why it 
> happened
> --------------------------------------------------------------------------------------
>
>                 Key: MNG-8140
>                 URL: https://issues.apache.org/jira/browse/MNG-8140
>             Project: Maven
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Tamas Cservenak
>            Assignee: Tamas Cservenak
>            Priority: Major
>             Fix For: 4.0.0, 3.9.8, 4.0.0-beta-4
>
>
> Currently, when a model is discarded as "invalid", Maven 3.x shows this line 
> in console:
> {noformat}
> [WARNING] The POM for org.openjfx:javafx-controls:jar:22.0.1 is invalid, 
> transitive dependencies (if any) will not be available, enable debug logging 
> for more details{noformat}
> And then when user uses {{-X}} and battles himself thru a TON of debug logs, 
> will find the cause WHY the model was discarded (despite it was all there 
> even in non-debug session).
> I want to know from first hand (and as soon as possible) WHY a model was 
> discarded, so we should modify this output to:
>  * do not "redirect" me at debug output
>  * immediately tell me why
> Note: Maven4 already have the CLI switch {{-sadp}} "strict artifact 
> descriptor policy" that will FAIL the build when it hits an "invalid" model, 
> as users usually don't want invalid models in their builds (is most often 
> usually some dev mistake, like using property for version/classifier while 
> not defining that property). This issue affects Maven4 as well, as if the 
> switch is used, build will fail due "invalid model", but user is still left 
> in dark WHY.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to