[jira] [Commented] (MNG-8140) When a model is discarded (by model builder) for whatever reason, show why it happened
[ https://issues.apache.org/jira/browse/MNG-8140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852914#comment-17852914 ] ASF GitHub Bot commented on MNG-8140: - cstamas merged PR #1555: URL: https://github.com/apache/maven/pull/1555 > 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)
[jira] [Commented] (MDEP-938) 'mdep.overIfNewer' is misnamed from its usage of 'mdep.overWriteIfNewer'
[ https://issues.apache.org/jira/browse/MDEP-938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852913#comment-17852913 ] ASF GitHub Bot commented on MDEP-938: - slawekjaranowski merged PR #404: URL: https://github.com/apache/maven-dependency-plugin/pull/404 > 'mdep.overIfNewer' is misnamed from its usage of 'mdep.overWriteIfNewer' > > > Key: MDEP-938 > URL: https://issues.apache.org/jira/browse/MDEP-938 > Project: Maven Dependency Plugin > Issue Type: Bug >Reporter: Jeremy Landis >Assignee: Slawomir Jaranowski >Priority: Minor > > This is a follow up of older PR I raised to fix this > [https://github.com/apache/maven-dependency-plugin/pull/285.] After looking > again and regrouping on this, made adjustments to deprecate the old property > and creating jira. > > This means added 'overIfNewer' that is immediately deprecated and goes > unused. The use case is rare in how issue was exposed. Looking at the code > overall, its only messed up in this one unique way but correct everywhere > else. Added suggested time this shows up as 3.7.0. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852908#comment-17852908 ] ASF GitHub Bot commented on MNG-8146: - cstamas merged PR #1564: URL: https://github.com/apache/maven/pull/1564 > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8140) When a model is discarded (by model builder) for whatever reason, show why it happened
[ https://issues.apache.org/jira/browse/MNG-8140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852906#comment-17852906 ] ASF GitHub Bot commented on MNG-8140: - michael-o commented on code in PR #1555: URL: https://github.com/apache/maven/pull/1555#discussion_r1630041413 ## 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: Makes sense. > 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)
[jira] [Commented] (MNG-8140) When a model is discarded (by model builder) for whatever reason, show why it happened
[ https://issues.apache.org/jira/browse/MNG-8140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852905#comment-17852905 ] ASF GitHub Bot commented on MNG-8140: - cstamas commented on code in PR #1555: URL: https://github.com/apache/maven/pull/1555#discussion_r1630040851 ## 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: In mean, it other words we _know_ from where even comes: from model builder and will always come from model builder as this event is triggered from it when it reports invalid model. So zero information (or zero value) has the stack trace. ## 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: In mean, it other words we _know_ from where it comes: from model builder and will always come from model builder as this event is triggered from it when it reports invalid model. So zero information (or zero value) has the stack trace. > 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)
[jira] [Commented] (MNG-8140) When a model is discarded (by model builder) for whatever reason, show why it happened
[ https://issues.apache.org/jira/browse/MNG-8140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)
[jira] [Commented] (MNG-8140) When a model is discarded (by model builder) for whatever reason, show why it happened
[ https://issues.apache.org/jira/browse/MNG-8140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852903#comment-17852903 ] 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 is totally irrelevant, it is much much import 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)
[jira] [Commented] (MNG-8140) When a model is discarded (by model builder) for whatever reason, show why it happened
[ https://issues.apache.org/jira/browse/MNG-8140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852901#comment-17852901 ] ASF GitHub Bot commented on MNG-8140: - michael-o commented on code in PR #1555: URL: https://github.com/apache/maven/pull/1555#discussion_r1630027061 ## 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: Even in debug level? > 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)
[jira] [Commented] (MNG-8140) When a model is discarded (by model builder) for whatever reason, show why it happened
[ https://issues.apache.org/jira/browse/MNG-8140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852900#comment-17852900 ] ASF GitHub Bot commented on MNG-8140: - cstamas commented on code in PR #1555: URL: https://github.com/apache/maven/pull/1555#discussion_r1630024252 ## 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: I don't want to _increase_ output, I want to make it more useful :stuck_out_tongue: > 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)
[jira] [Commented] (MNG-7758) o.e.aether.resolution.ArtifactResolutionException incorrectly examined when multiple repositories are involved
[ https://issues.apache.org/jira/browse/MNG-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852888#comment-17852888 ] ASF GitHub Bot commented on MNG-7758: - slawekjaranowski commented on PR #1563: URL: https://github.com/apache/maven/pull/1563#issuecomment-2153063578 Fixed IT - https://github.com/apache/maven-integration-testing/pull/346 > o.e.aether.resolution.ArtifactResolutionException incorrectly examined when > multiple repositories are involved > -- > > Key: MNG-7758 > URL: https://issues.apache.org/jira/browse/MNG-7758 > Project: Maven > Issue Type: Bug > Components: Artifacts and Repositories, Dependencies, Performance >Affects Versions: 3.8.8, 3.9.1, 4.0.0-alpha-5 >Reporter: Michael Osipov >Priority: Critical > Fix For: 4.0.x-candidate, 4.0.0 > > Attachments: 1.png, 2.png, Exception hierarchy.png > > > Consider you have three repos defined in your build (could be POM or > settings), evaluated in following order: > 1. repo A: serves custom artifacts with group id {{com.example}}, due to repo > partitioning in Nexus rejects requests to all other group ids with 403 > 1. repo B: serves third party artifacts without any restriction from a Nexus > repo > 1. repo C: serves Central mirror, last one quried, no restrictions > Note that order is important! Now add a non-existing dependency to your POM > and receive the following behavior: > {{ArtifactResolutionException}} will contain an {{ArtifactResult}} with three > exceptions: > - {{TransferException}} with nested {{AuthorizationException}}, > - {{ArtifactNotFoundException}}, > - {{ArtifactNotFoundException}}. > {{ArtifactResolutionException#getCause()}} will be populated with the > {{TransferException}} so will > {{org.eclipse.aether.resolution.ArtifactResult.isMissing()}} take the first > exception only into account. E.g., {{DefaultArtifactDescriptorReader}} will > do {{if (e.getCause() instanceof ArtifactNotFoundException)}} which is > deceiving. > Here is a sample for a non-existing artifact: > {noformat} > [INFO] --- maven-site-plugin:4.0.0-M7-SNAPSHOT:site (default-site) @ > mskins-222 --- > [INFO] Configuring report plugin > org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.2 > [WARNING] index report is declared twice in default reportSet > [INFO] 15 reports configured for maven-project-info-reports-plugin:3.4.2: > index, summary, dependency-info, modules, team, scm, issue-management, > mailing-lists, dependency-management, dependencies, dependency-convergence, > ci-management, plugin-management, plugins, distribution-management > [INFO] Rendering site for default locale > Downloading from lda-public: > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 3.214 s > [INFO] Finished at: 2023-04-02T12:51:02+02:00 > [INFO] > > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222: SiteToolException: The site descriptor > cannot be resolved from the repository: Unable to locate site descriptor: > Could not transfer artifact org.apache:apache:xml:site:29 from/to lda-public > (https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/): > authorization failed for > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml, > status: 403 Forbidden -> [Help 1] > [ERROR] > [ERROR] To see the full stack trace of the errors, re-run Maven with the -e > switch. > [ERROR] Re-run Maven using the -X switch to enable full debug logging. > [ERROR] > [ERROR] For more information about the errors and possible solutions, please > read the following articles: > [ERROR] [Help 1] > http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException > {noformat} > for a dependency: > {noformat} > [INFO] org.apache.maven.cli.event.ExecutionEventLogger - > > [ERROR] org.apache.maven.cli.MavenCli - Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222: Failed to get report for > org.apache.maven.plugins:maven-project-plugin: Plugin > org.apache.maven.plugins:maven-project-plugin:3.4.2 or one of its > dependencies could not be resolved: Failed to read artifact descriptor for >
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852886#comment-17852886 ] ASF GitHub Bot commented on MNG-8146: - cstamas commented on code in PR #1564: URL: https://github.com/apache/maven/pull/1564#discussion_r1629954594 ## maven-artifact/src/test/java/org/apache/maven/artifact/versioning/DefaultArtifactVersionTest.java: ## @@ -80,6 +80,15 @@ public void testVersionParsing() { checkVersionParsing("1.2.3-200705301630", 1, 2, 3, 0, "200705301630"); } +public void testVersionParsingNot09() { +String ver = "१.२.३"; +assertTrue(Character.isDigit(ver.charAt(0))); +assertTrue(Character.isDigit(ver.charAt(2))); +assertTrue(Character.isDigit(ver.charAt(4))); +ArtifactVersion version = newArtifactVersion(ver); +assertEquals(ver, version.getQualifier()); +} Review Comment: but we must carry thru same change on Resolver as well... > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852885#comment-17852885 ] ASF GitHub Bot commented on MNG-8146: - michael-o commented on code in PR #1564: URL: https://github.com/apache/maven/pull/1564#discussion_r1629952883 ## maven-artifact/src/test/java/org/apache/maven/artifact/versioning/DefaultArtifactVersionTest.java: ## @@ -80,6 +80,15 @@ public void testVersionParsing() { checkVersionParsing("1.2.3-200705301630", 1, 2, 3, 0, "200705301630"); } +public void testVersionParsingNot09() { +String ver = "१.२.३"; +assertTrue(Character.isDigit(ver.charAt(0))); +assertTrue(Character.isDigit(ver.charAt(2))); +assertTrue(Character.isDigit(ver.charAt(4))); +ArtifactVersion version = newArtifactVersion(ver); +assertEquals(ver, version.getQualifier()); +} Review Comment: man, I want `U+1F4A9` as qualifier! > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8140) When a model is discarded (by model builder) for whatever reason, show why it happened
[ https://issues.apache.org/jira/browse/MNG-8140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852883#comment-17852883 ] ASF GitHub Bot commented on MNG-8140: - michael-o commented on code in PR #1555: URL: https://github.com/apache/maven/pull/1555#discussion_r1629950634 ## 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: Maybe one should probe if debug is enabled and pass `e` otherwise? > 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)
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852884#comment-17852884 ] ASF GitHub Bot commented on MNG-8146: - cstamas commented on code in PR #1564: URL: https://github.com/apache/maven/pull/1564#discussion_r1629950638 ## maven-artifact/src/test/java/org/apache/maven/artifact/versioning/DefaultArtifactVersionTest.java: ## @@ -80,6 +80,15 @@ public void testVersionParsing() { checkVersionParsing("1.2.3-200705301630", 1, 2, 3, 0, "200705301630"); } +public void testVersionParsingNot09() { +String ver = "१.२.३"; +assertTrue(Character.isDigit(ver.charAt(0))); +assertTrue(Character.isDigit(ver.charAt(2))); +assertTrue(Character.isDigit(ver.charAt(4))); +ArtifactVersion version = newArtifactVersion(ver); +assertEquals(ver, version.getQualifier()); +} Review Comment: No, as these are not numbers anymore, they are qualifiers (otherwise it would go into major, minor...) > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852882#comment-17852882 ] ASF GitHub Bot commented on MNG-8146: - michael-o commented on code in PR #1564: URL: https://github.com/apache/maven/pull/1564#discussion_r1629949818 ## maven-artifact/src/test/java/org/apache/maven/artifact/versioning/DefaultArtifactVersionTest.java: ## @@ -80,6 +80,15 @@ public void testVersionParsing() { checkVersionParsing("1.2.3-200705301630", 1, 2, 3, 0, "200705301630"); } +public void testVersionParsingNot09() { +String ver = "१.२.३"; +assertTrue(Character.isDigit(ver.charAt(0))); +assertTrue(Character.isDigit(ver.charAt(2))); +assertTrue(Character.isDigit(ver.charAt(4))); +ArtifactVersion version = newArtifactVersion(ver); +assertEquals(ver, version.getQualifier()); +} Review Comment: Hold on, shouldn't this fail? > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852880#comment-17852880 ] ASF GitHub Bot commented on MNG-8146: - michael-o commented on code in PR #1564: URL: https://github.com/apache/maven/pull/1564#discussion_r1629948490 ## maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java: ## @@ -179,7 +179,8 @@ private static boolean isDigits(String str) { return false; } for (int i = 0; i < str.length(); i++) { -if (!Character.isDigit(str.charAt(i))) { +char c = str.charAt(i); +if (!(c >= '0' && c <= '9')) { Review Comment: Good! > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8140) When a model is discarded (by model builder) for whatever reason, show why it happened
[ https://issues.apache.org/jira/browse/MNG-8140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852878#comment-17852878 ] ASF GitHub Bot commented on MNG-8140: - cstamas commented on PR #1555: URL: https://github.com/apache/maven/pull/1555#issuecomment-2153041468 ITs passed > 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)
[jira] [Commented] (MPMD-395) Build doesn't fail for invalid CPD format
[ https://issues.apache.org/jira/browse/MPMD-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852875#comment-17852875 ] ASF GitHub Bot commented on MPMD-395: - michael-o commented on code in PR #150: URL: https://github.com/apache/maven-pmd-plugin/pull/150#discussion_r1629937539 ## src/test/java/org/apache/maven/plugins/pmd/CpdReportTest.java: ## @@ -240,4 +241,30 @@ public void testExclusionsConfiguration() throws Exception { String str = readFile(generatedFile); assertEquals(0, StringUtils.countMatches(str, " Build doesn't fail for invalid CPD format > - > > Key: MPMD-395 > URL: https://issues.apache.org/jira/browse/MPMD-395 > Project: Maven PMD Plugin > Issue Type: Bug > Components: CPD >Affects Versions: 3.22.0 >Reporter: Andreas Dangel >Assignee: Andreas Dangel >Priority: Major > Fix For: next-version > > > See > [https://github.com/apache/maven-pmd-plugin/pull/144#issuecomment-2094371392] > > If an exception occurs while the CPD report is created, the exception is only > logged but doesn't fail the build. This means, that build appears to be > successful, although it didn't produce all expected build artifacts. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MPMD-395) Build doesn't fail for invalid CPD format
[ https://issues.apache.org/jira/browse/MPMD-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852873#comment-17852873 ] ASF GitHub Bot commented on MPMD-395: - michael-o commented on code in PR #150: URL: https://github.com/apache/maven-pmd-plugin/pull/150#discussion_r1629915124 ## src/main/java/org/apache/maven/plugins/pmd/exec/CpdReportConsumer.java: ## @@ -0,0 +1,118 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.plugins.pmd.exec; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.util.function.Consumer; +import java.util.function.Predicate; + +import net.sourceforge.pmd.cpd.CPDReport; +import net.sourceforge.pmd.cpd.CPDReportRenderer; +import net.sourceforge.pmd.cpd.Match; +import net.sourceforge.pmd.cpd.XMLRenderer; +import org.apache.maven.plugins.pmd.ExcludeDuplicationsFromFile; +import org.apache.maven.reporting.MavenReportException; +import org.codehaus.plexus.util.FileUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +class CpdReportConsumer implements Consumer { +private static final Logger LOG = LoggerFactory.getLogger(CpdReportConsumer.class); + +private final CpdRequest request; +private final ExcludeDuplicationsFromFile excludeDuplicationsFromFile; + +CpdReportConsumer(CpdRequest request, ExcludeDuplicationsFromFile excludeDuplicationsFromFile) { +this.request = request; +this.excludeDuplicationsFromFile = excludeDuplicationsFromFile; +} + +@Override +public void accept(CPDReport report) { +try { +// always create XML format. we need to output it even if the file list is empty or we have no +// duplications so that the "check" goals can check for violations +writeXmlReport(report); + +// HTML format is handled by maven site report, XML format has already been rendered. +// a renderer is only needed for other formats +String format = request.getFormat(); +if (!"html".equals(format) && !"xml".equals(format)) { +writeFormattedReport(report); +} +} catch (IOException | MavenReportException e) { +// Exceptions happening during this consumer are logged by PMD +// through the CPDConfiguration's reporter. Review Comment: Yes, please remove... > Build doesn't fail for invalid CPD format > - > > Key: MPMD-395 > URL: https://issues.apache.org/jira/browse/MPMD-395 > Project: Maven PMD Plugin > Issue Type: Bug > Components: CPD >Affects Versions: 3.22.0 >Reporter: Andreas Dangel >Assignee: Andreas Dangel >Priority: Major > Fix For: next-version > > > See > [https://github.com/apache/maven-pmd-plugin/pull/144#issuecomment-2094371392] > > If an exception occurs while the CPD report is created, the exception is only > logged but doesn't fail the build. This means, that build appears to be > successful, although it didn't produce all expected build artifacts. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8142) If JDK profile activator gets "invalid" JDK version for whatever reason, it chokes but does not tell why
[ https://issues.apache.org/jira/browse/MNG-8142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852860#comment-17852860 ] ASF GitHub Bot commented on MNG-8142: - michael-o commented on PR #1557: URL: https://github.com/apache/maven/pull/1557#issuecomment-2152956489 All, we should strive to get rid of all `System.setProperty()` calls. > If JDK profile activator gets "invalid" JDK version for whatever reason, it > chokes but does not tell why > > > Key: MNG-8142 > URL: https://issues.apache.org/jira/browse/MNG-8142 > Project: Maven > Issue Type: Bug > Components: Core >Reporter: Tamas Cservenak >Assignee: Tamas Cservenak >Priority: Major > Fix For: 4.0.0, 3.9.8, 4.0.0-beta-4 > > > The JDK profile activator uses property {{java.version}} to determine is > profile active or not, but if you look at MNG-3746 you can see that Maven > _allows overriding that property_ by user, but also, today some "weird > formatted" version may pop up in the wild. > The JDK profile activator is not prepared for these cases, and will just > throw (NumberFormatEx), without telling why it did belly up. > Improve the message why it throw. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8142) If JDK profile activator gets "invalid" JDK version for whatever reason, it chokes but does not tell why
[ https://issues.apache.org/jira/browse/MNG-8142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852858#comment-17852858 ] ASF GitHub Bot commented on MNG-8142: - cstamas merged PR #1557: URL: https://github.com/apache/maven/pull/1557 > If JDK profile activator gets "invalid" JDK version for whatever reason, it > chokes but does not tell why > > > Key: MNG-8142 > URL: https://issues.apache.org/jira/browse/MNG-8142 > Project: Maven > Issue Type: Bug > Components: Core >Reporter: Tamas Cservenak >Assignee: Tamas Cservenak >Priority: Major > Fix For: 4.0.0, 3.9.8, 4.0.0-beta-4 > > > The JDK profile activator uses property {{java.version}} to determine is > profile active or not, but if you look at MNG-3746 you can see that Maven > _allows overriding that property_ by user, but also, today some "weird > formatted" version may pop up in the wild. > The JDK profile activator is not prepared for these cases, and will just > throw (NumberFormatEx), without telling why it did belly up. > Improve the message why it throw. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MCHECKSTYLE-449) Add support for SARIF output format
[ https://issues.apache.org/jira/browse/MCHECKSTYLE-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852843#comment-17852843 ] ASF GitHub Bot commented on MCHECKSTYLE-449: michael-o commented on PR #136: URL: https://github.com/apache/maven-checkstyle-plugin/pull/136#issuecomment-2152889907 > Would it make sense to release versions of maven-checkstyle-plugin that are separately compatible with 9.x and 10.x? Technically yes, but not before the Doxia 2.0.0 stack has been integrated. That would force me to maintain four versions which I am not going to do. > Add support for SARIF output format > --- > > Key: MCHECKSTYLE-449 > URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-449 > Project: Maven Checkstyle Plugin > Issue Type: New Feature >Affects Versions: 3.3.1 >Reporter: Michael Osipov >Assignee: Michael Osipov >Priority: Major > Fix For: 3.4.0 > > -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MCHECKSTYLE-449) Add support for SARIF output format
[ https://issues.apache.org/jira/browse/MCHECKSTYLE-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852837#comment-17852837 ] ASF GitHub Bot commented on MCHECKSTYLE-449: motlin commented on PR #136: URL: https://github.com/apache/maven-checkstyle-plugin/pull/136#issuecomment-2152838061 Would it make sense to release versions of maven-checkstyle-plugin that are separately compatible with 9.x and 10.x? > Add support for SARIF output format > --- > > Key: MCHECKSTYLE-449 > URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-449 > Project: Maven Checkstyle Plugin > Issue Type: New Feature >Affects Versions: 3.3.1 >Reporter: Michael Osipov >Assignee: Michael Osipov >Priority: Major > Fix For: 3.4.0 > > -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MCHECKSTYLE-449) Add support for SARIF output format
[ https://issues.apache.org/jira/browse/MCHECKSTYLE-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852836#comment-17852836 ] ASF GitHub Bot commented on MCHECKSTYLE-449: michael-o commented on PR #136: URL: https://github.com/apache/maven-checkstyle-plugin/pull/136#issuecomment-2152821352 > Downgrading to Checkstyle 9.3 seemed to work. It's not ideal since I use some newer checks. This is something we cannot fix because Checkstyle raised to Java 11 some time ago. > Add support for SARIF output format > --- > > Key: MCHECKSTYLE-449 > URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-449 > Project: Maven Checkstyle Plugin > Issue Type: New Feature >Affects Versions: 3.3.1 >Reporter: Michael Osipov >Assignee: Michael Osipov >Priority: Major > Fix For: 3.4.0 > > -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MPMD-395) Build doesn't fail for invalid CPD format
[ https://issues.apache.org/jira/browse/MPMD-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852822#comment-17852822 ] ASF GitHub Bot commented on MPMD-395: - adangel commented on code in PR #150: URL: https://github.com/apache/maven-pmd-plugin/pull/150#discussion_r1629697284 ## src/main/java/org/apache/maven/plugins/pmd/exec/CpdReportConsumer.java: ## @@ -0,0 +1,118 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.plugins.pmd.exec; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.util.function.Consumer; +import java.util.function.Predicate; + +import net.sourceforge.pmd.cpd.CPDReport; +import net.sourceforge.pmd.cpd.CPDReportRenderer; +import net.sourceforge.pmd.cpd.Match; +import net.sourceforge.pmd.cpd.XMLRenderer; +import org.apache.maven.plugins.pmd.ExcludeDuplicationsFromFile; +import org.apache.maven.reporting.MavenReportException; +import org.codehaus.plexus.util.FileUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +class CpdReportConsumer implements Consumer { +private static final Logger LOG = LoggerFactory.getLogger(CpdReportConsumer.class); + +private final CpdRequest request; +private final ExcludeDuplicationsFromFile excludeDuplicationsFromFile; + +CpdReportConsumer(CpdRequest request, ExcludeDuplicationsFromFile excludeDuplicationsFromFile) { +this.request = request; +this.excludeDuplicationsFromFile = excludeDuplicationsFromFile; +} + +@Override +public void accept(CPDReport report) { +try { +// always create XML format. we need to output it even if the file list is empty or we have no +// duplications so that the "check" goals can check for violations +writeXmlReport(report); + +// HTML format is handled by maven site report, XML format has already been rendered. +// a renderer is only needed for other formats +String format = request.getFormat(); +if (!"html".equals(format) && !"xml".equals(format)) { +writeFormattedReport(report); +} +} catch (IOException | MavenReportException e) { +// Exceptions happening during this consumer are logged by PMD +// through the CPDConfiguration's reporter. +throw new RuntimeException(e); Review Comment: It's not unwrapped. And m-pmd-p won't see this exception at all. It's only visible to PMD, which logs it. > Build doesn't fail for invalid CPD format > - > > Key: MPMD-395 > URL: https://issues.apache.org/jira/browse/MPMD-395 > Project: Maven PMD Plugin > Issue Type: Bug > Components: CPD >Affects Versions: 3.22.0 >Reporter: Andreas Dangel >Assignee: Andreas Dangel >Priority: Major > Fix For: next-version > > > See > [https://github.com/apache/maven-pmd-plugin/pull/144#issuecomment-2094371392] > > If an exception occurs while the CPD report is created, the exception is only > logged but doesn't fail the build. This means, that build appears to be > successful, although it didn't produce all expected build artifacts. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852823#comment-17852823 ] ASF GitHub Bot commented on MNG-8146: - cstamas commented on PR #1564: URL: https://github.com/apache/maven/pull/1564#issuecomment-2152739532 I agree with this "general" rule to prefer NPE over IAE, but disagree with unconditional sticking to this rule. One has to be pragmatic a bit, and allow deviation. My point was, that in this PR, the spots where it was changed did and does not benefit _anything_ from distinguishing NPE from IAE, while if you look at change that made PR "by the book" (to distinguish NPE and IAE) worsened the quality of code, as it caused string/message duplication all over the place. So, IMHO rigidly sticking to something is just as bad as never adhering to any best practice. > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MPMD-395) Build doesn't fail for invalid CPD format
[ https://issues.apache.org/jira/browse/MPMD-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852821#comment-17852821 ] ASF GitHub Bot commented on MPMD-395: - adangel commented on code in PR #150: URL: https://github.com/apache/maven-pmd-plugin/pull/150#discussion_r1629695838 ## src/main/java/org/apache/maven/plugins/pmd/exec/CpdReportConsumer.java: ## @@ -0,0 +1,118 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.plugins.pmd.exec; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.util.function.Consumer; +import java.util.function.Predicate; + +import net.sourceforge.pmd.cpd.CPDReport; +import net.sourceforge.pmd.cpd.CPDReportRenderer; +import net.sourceforge.pmd.cpd.Match; +import net.sourceforge.pmd.cpd.XMLRenderer; +import org.apache.maven.plugins.pmd.ExcludeDuplicationsFromFile; +import org.apache.maven.reporting.MavenReportException; +import org.codehaus.plexus.util.FileUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +class CpdReportConsumer implements Consumer { +private static final Logger LOG = LoggerFactory.getLogger(CpdReportConsumer.class); + +private final CpdRequest request; +private final ExcludeDuplicationsFromFile excludeDuplicationsFromFile; + +CpdReportConsumer(CpdRequest request, ExcludeDuplicationsFromFile excludeDuplicationsFromFile) { +this.request = request; +this.excludeDuplicationsFromFile = excludeDuplicationsFromFile; +} + +@Override +public void accept(CPDReport report) { +try { +// always create XML format. we need to output it even if the file list is empty or we have no +// duplications so that the "check" goals can check for violations +writeXmlReport(report); + +// HTML format is handled by maven site report, XML format has already been rendered. +// a renderer is only needed for other formats +String format = request.getFormat(); +if (!"html".equals(format) && !"xml".equals(format)) { +writeFormattedReport(report); +} +} catch (IOException | MavenReportException e) { +// Exceptions happening during this consumer are logged by PMD +// through the CPDConfiguration's reporter. Review Comment: You can't see it in m-pmd-p. The CpdReportConsumer is executed in PMD's context - and the current default behavior is, that any exceptions occurred while consuming the report are logged. That this is actually the case, is now tested with the new unit test, so we should notice in case this behavior changes in the future. Maybe we don't need this comment at all, as it is more confusing than helpful? > Build doesn't fail for invalid CPD format > - > > Key: MPMD-395 > URL: https://issues.apache.org/jira/browse/MPMD-395 > Project: Maven PMD Plugin > Issue Type: Bug > Components: CPD >Affects Versions: 3.22.0 >Reporter: Andreas Dangel >Assignee: Andreas Dangel >Priority: Major > Fix For: next-version > > > See > [https://github.com/apache/maven-pmd-plugin/pull/144#issuecomment-2094371392] > > If an exception occurs while the CPD report is created, the exception is only > logged but doesn't fail the build. This means, that build appears to be > successful, although it didn't produce all expected build artifacts. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852819#comment-17852819 ] ASF GitHub Bot commented on MNG-8146: - cstamas commented on code in PR #1564: URL: https://github.com/apache/maven/pull/1564#discussion_r1629689572 ## maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java: ## @@ -176,6 +174,18 @@ private static Integer getNextIntegerToken(StringTokenizer tok) { return tryParseInt(s); } +private static boolean isDigits(String str) { +if (str == null || str.trim().isEmpty()) { +return false; +} +for (int i = 0; i < str.length(); i++) { +if (!Character.isDigit(str.charAt(i))) { Review Comment: Was https://github.com/apache/commons-lang/blob/45a955702a06d817aa18007a9b099c37ee2ec20a/src/main/java/org/apache/commons/lang3/math/NumberUtils.java#L679 but it actually ended up here https://github.com/apache/commons-lang/blob/45a955702a06d817aa18007a9b099c37ee2ec20a/src/main/java/org/apache/commons/lang3/StringUtils.java#L3812-L3813 And javadoc DOES contains example with non latin alphabet. But I agree, we really want ASCII 0-9 here. > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852818#comment-17852818 ] ASF GitHub Bot commented on MNG-8146: - elharo commented on PR #1564: URL: https://github.com/apache/maven/pull/1564#issuecomment-2152717446 I concur that NPE is strongly preferred over IAE for null values. I didn't happen to find any places where this was done wrong, but I wasn't reading that closely. > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-7758) o.e.aether.resolution.ArtifactResolutionException incorrectly examined when multiple repositories are involved
[ https://issues.apache.org/jira/browse/MNG-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852817#comment-17852817 ] ASF GitHub Bot commented on MNG-7758: - slawekjaranowski commented on PR #1563: URL: https://github.com/apache/maven/pull/1563#issuecomment-2152711345 > Give me a day or two, I try to try this out in a realworld env. I would be happy to have it in 3.9.x also So I fix ITs first > o.e.aether.resolution.ArtifactResolutionException incorrectly examined when > multiple repositories are involved > -- > > Key: MNG-7758 > URL: https://issues.apache.org/jira/browse/MNG-7758 > Project: Maven > Issue Type: Bug > Components: Artifacts and Repositories, Dependencies, Performance >Affects Versions: 3.8.8, 3.9.1, 4.0.0-alpha-5 >Reporter: Michael Osipov >Priority: Critical > Fix For: 4.0.x-candidate, 4.0.0 > > Attachments: 1.png, 2.png, Exception hierarchy.png > > > Consider you have three repos defined in your build (could be POM or > settings), evaluated in following order: > 1. repo A: serves custom artifacts with group id {{com.example}}, due to repo > partitioning in Nexus rejects requests to all other group ids with 403 > 1. repo B: serves third party artifacts without any restriction from a Nexus > repo > 1. repo C: serves Central mirror, last one quried, no restrictions > Note that order is important! Now add a non-existing dependency to your POM > and receive the following behavior: > {{ArtifactResolutionException}} will contain an {{ArtifactResult}} with three > exceptions: > - {{TransferException}} with nested {{AuthorizationException}}, > - {{ArtifactNotFoundException}}, > - {{ArtifactNotFoundException}}. > {{ArtifactResolutionException#getCause()}} will be populated with the > {{TransferException}} so will > {{org.eclipse.aether.resolution.ArtifactResult.isMissing()}} take the first > exception only into account. E.g., {{DefaultArtifactDescriptorReader}} will > do {{if (e.getCause() instanceof ArtifactNotFoundException)}} which is > deceiving. > Here is a sample for a non-existing artifact: > {noformat} > [INFO] --- maven-site-plugin:4.0.0-M7-SNAPSHOT:site (default-site) @ > mskins-222 --- > [INFO] Configuring report plugin > org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.2 > [WARNING] index report is declared twice in default reportSet > [INFO] 15 reports configured for maven-project-info-reports-plugin:3.4.2: > index, summary, dependency-info, modules, team, scm, issue-management, > mailing-lists, dependency-management, dependencies, dependency-convergence, > ci-management, plugin-management, plugins, distribution-management > [INFO] Rendering site for default locale > Downloading from lda-public: > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 3.214 s > [INFO] Finished at: 2023-04-02T12:51:02+02:00 > [INFO] > > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222: SiteToolException: The site descriptor > cannot be resolved from the repository: Unable to locate site descriptor: > Could not transfer artifact org.apache:apache:xml:site:29 from/to lda-public > (https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/): > authorization failed for > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml, > status: 403 Forbidden -> [Help 1] > [ERROR] > [ERROR] To see the full stack trace of the errors, re-run Maven with the -e > switch. > [ERROR] Re-run Maven using the -X switch to enable full debug logging. > [ERROR] > [ERROR] For more information about the errors and possible solutions, please > read the following articles: > [ERROR] [Help 1] > http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException > {noformat} > for a dependency: > {noformat} > [INFO] org.apache.maven.cli.event.ExecutionEventLogger - > > [ERROR] org.apache.maven.cli.MavenCli - Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222: Failed to get report for > org.apache.maven.plugins:maven-project-plugin: Plugin > org.apache.maven.plugins:maven-project-plugin:3.4.2 or one of its > dependencies could
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852816#comment-17852816 ] ASF GitHub Bot commented on MNG-8146: - elharo commented on code in PR #1564: URL: https://github.com/apache/maven/pull/1564#discussion_r1629675910 ## maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java: ## @@ -176,6 +174,18 @@ private static Integer getNextIntegerToken(StringTokenizer tok) { return tryParseInt(s); } +private static boolean isDigits(String str) { +if (str == null || str.trim().isEmpty()) { +return false; +} +for (int i = 0; i < str.length(); i++) { +if (!Character.isDigit(str.charAt(i))) { Review Comment: This is going to allow digits from other alphabets beyond the usual 0-9. I don't think we want that, do we? ## maven-embedder/src/test/java/org/apache/maven/cli/MavenCliTest.java: ## @@ -89,7 +89,10 @@ public void testCalculateDegreeOfConcurrency() { int cpus = Runtime.getRuntime().availableProcessors(); assertEquals((int) (cpus * 2.2), cli.calculateDegreeOfConcurrency("2.2C")); assertEquals(1, cli.calculateDegreeOfConcurrency("0.0001C")); -assertThrows(IllegalArgumentException.class, new ConcurrencyCalculator("2.C")); +// Note: this assertion below makes no sense, first Float.parseFloat("2.") DOES parse the string in 2.0. Review Comment: OK, just delete this then ## maven-core/src/main/java/org/apache/maven/configuration/DefaultBeanConfigurationRequest.java: ## @@ -104,8 +105,16 @@ public DefaultBeanConfigurationRequest setConfiguration( } private Plugin findPlugin(Model model, String groupId, String artifactId) { -Validate.notBlank(groupId, "groupId can neither be null, empty nor blank"); -Validate.notBlank(artifactId, "artifactId can neither be null, empty nor blank"); +if (Objects.requireNonNull(groupId, "groupId can neither be null, empty nor blank") Review Comment: nit: comma after empty ## maven-core/src/main/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformation.java: ## @@ -80,10 +79,13 @@ public String getMavenVersion() { } public boolean isMavenVersion(String versionRange) { +if (Objects.requireNonNull(versionRange, "versionRange can neither be null, empty nor blank") Review Comment: nit: comma after empty > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852814#comment-17852814 ] ASF GitHub Bot commented on MNG-8146: - cstamas commented on PR #1564: URL: https://github.com/apache/maven/pull/1564#issuecomment-2152701271 For ref, the Maven4 PR https://github.com/apache/maven/pull/1080 > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852813#comment-17852813 ] ASF GitHub Bot commented on MNG-8146: - elharo commented on PR #1564: URL: https://github.com/apache/maven/pull/1564#issuecomment-2152697789 I'll have to dig into the individual changes. However overall I no longer trust commons-lang and definitely favor removing our dependence on it if possible. > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852803#comment-17852803 ] ASF GitHub Bot commented on MNG-8146: - cstamas commented on PR #1564: URL: https://github.com/apache/maven/pull/1564#issuecomment-2152638881 > Yes, through out our entire codebase. Don't divert: I asked you to show me where _changed_ spots in this PR benefit anything from NPE (as vs IAEx). But nevertheless, with copy-paste (of message) introduced Objects.requireNonNull use instead to do throw NPE "by the book". > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MCHECKSTYLE-449) Add support for SARIF output format
[ https://issues.apache.org/jira/browse/MCHECKSTYLE-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852799#comment-17852799 ] ASF GitHub Bot commented on MCHECKSTYLE-449: motlin commented on PR #136: URL: https://github.com/apache/maven-checkstyle-plugin/pull/136#issuecomment-2152620974 Downgrading to Checkstyle 9.3 seemed to work. It's not ideal since I use some newer checks. > Add support for SARIF output format > --- > > Key: MCHECKSTYLE-449 > URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-449 > Project: Maven Checkstyle Plugin > Issue Type: New Feature >Affects Versions: 3.3.1 >Reporter: Michael Osipov >Assignee: Michael Osipov >Priority: Major > Fix For: 3.4.0 > > -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MCHECKSTYLE-449) Add support for SARIF output format
[ https://issues.apache.org/jira/browse/MCHECKSTYLE-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852797#comment-17852797 ] ASF GitHub Bot commented on MCHECKSTYLE-449: michael-o commented on PR #136: URL: https://github.com/apache/maven-checkstyle-plugin/pull/136#issuecomment-2152555247 Hold on, 10.17.0 is a major version. Signatures might have changed from 9. You should check that first. If it runs with the stock one, then the issue is clear. > Add support for SARIF output format > --- > > Key: MCHECKSTYLE-449 > URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-449 > Project: Maven Checkstyle Plugin > Issue Type: New Feature >Affects Versions: 3.3.1 >Reporter: Michael Osipov >Assignee: Michael Osipov >Priority: Major > Fix For: 3.4.0 > > -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MCHECKSTYLE-449) Add support for SARIF output format
[ https://issues.apache.org/jira/browse/MCHECKSTYLE-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852796#comment-17852796 ] ASF GitHub Bot commented on MCHECKSTYLE-449: michael-o commented on PR #136: URL: https://github.com/apache/maven-checkstyle-plugin/pull/136#issuecomment-2152552406 @motlin, can you provide `mvn -X` of the plugin execution. I'd like to see the dep tree. This output confuses me. > Add support for SARIF output format > --- > > Key: MCHECKSTYLE-449 > URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-449 > Project: Maven Checkstyle Plugin > Issue Type: New Feature >Affects Versions: 3.3.1 >Reporter: Michael Osipov >Assignee: Michael Osipov >Priority: Major > Fix For: 3.4.0 > > -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852794#comment-17852794 ] ASF GitHub Bot commented on MNG-8146: - michael-o commented on code in PR #1564: URL: https://github.com/apache/maven/pull/1564#discussion_r1629570046 ## pom.xml: ## @@ -442,16 +441,6 @@ under the License. commons-cli commons-cli ${commonsCliVersion} - - -commons-lang -commons-lang - - -commons-logging -commons-logging Review Comment: Commons Logging has been removed as a dep? > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852792#comment-17852792 ] ASF GitHub Bot commented on MNG-8146: - cstamas commented on code in PR #1564: URL: https://github.com/apache/maven/pull/1564#discussion_r1629554150 ## pom.xml: ## @@ -442,16 +441,6 @@ under the License. commons-cli commons-cli ${commonsCliVersion} - - -commons-lang -commons-lang - - -commons-logging -commons-logging Review Comment: Because commons-cli does not depend on any of these, this seems legacy that was never removed? Commons cli deps are only these: ``` org.junit.jupiter junit-jupiter-api test org.junit.jupiter junit-jupiter-engine test org.junit.jupiter junit-jupiter-params test commons-io commons-io 2.16.1 test ``` > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MCHECKSTYLE-449) Add support for SARIF output format
[ https://issues.apache.org/jira/browse/MCHECKSTYLE-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852788#comment-17852788 ] ASF GitHub Bot commented on MCHECKSTYLE-449: motlin commented on PR #136: URL: https://github.com/apache/maven-checkstyle-plugin/pull/136#issuecomment-2152517655 I'm trying to use this and running into: ``` Caused by: java.lang.NoSuchMethodError: 'void com.puppycrawl.tools.checkstyle.SarifLogger.(java.io.OutputStream, com.puppycrawl.tools.checkstyle.api.AutomaticBean$OutputStreamOptions)' at org.apache.maven.plugins.checkstyle.CheckstyleViolationCheckMojo.getListener (CheckstyleViolationCheckMojo.java:816) at org.apache.maven.plugins.checkstyle.CheckstyleViolationCheckMojo.execute (CheckstyleViolationCheckMojo.java:539) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174) at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75) at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162) at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105) at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:193) at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:180) at java.util.concurrent.FutureTask.run (FutureTask.java:264) at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:539) at java.util.concurrent.FutureTask.run (FutureTask.java:264) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1136) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635) at java.lang.Thread.run (Thread.java:842) ``` My command is: ``` mvn checkstyle:check --activate-profiles 'checkstyle-semantics' -Dcheckstyle.output.format=sarif ``` My versions are: ```xml checkstyle-semantics maven-checkstyle-plugin 3.4.0 com.puppycrawl.tools checkstyle 10.17.0 checkstyle-configuration-semantics.xml sarif checkstyle:check semantics check prepare-package ``` > Add support for SARIF output format > --- > > Key: MCHECKSTYLE-449 > URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-449 > Project: Maven Checkstyle Plugin > Issue Type: New Feature >Affects Versions: 3.3.1 >Reporter: Michael Osipov >Assignee: Michael Osipov >Priority: Major > Fix For: 3.4.0 > > -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852787#comment-17852787 ] ASF GitHub Bot commented on MNG-8146: - michael-o commented on PR #1564: URL: https://github.com/apache/maven/pull/1564#issuecomment-2152503852 I agree that for those few cases Commons Lang is overkill. > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852782#comment-17852782 ] ASF GitHub Bot commented on MNG-8146: - michael-o commented on code in PR #1564: URL: https://github.com/apache/maven/pull/1564#discussion_r1629513653 ## pom.xml: ## @@ -442,16 +441,6 @@ under the License. commons-cli commons-cli ${commonsCliVersion} - - -commons-lang -commons-lang - - -commons-logging -commons-logging Review Comment: Why did you remove the commons-logging exclusion? This is unrelated. > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852778#comment-17852778 ] ASF GitHub Bot commented on MNG-8146: - michael-o commented on PR #1564: URL: https://github.com/apache/maven/pull/1564#issuecomment-2152392587 > > Several changes are _not_ OK. There is clearly a definition that for a null value an NPE is expected, not IAE for past 10+ years. This violates the expectations from Effective Java. @elharo > > This is really nitpicking. Can you show me _where we make use of that important distinction_? Yes, through out our entire codebase. > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8146) Drop use of commons-lang
[ https://issues.apache.org/jira/browse/MNG-8146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852775#comment-17852775 ] ASF GitHub Bot commented on MNG-8146: - cstamas commented on PR #1564: URL: https://github.com/apache/maven/pull/1564#issuecomment-2152375090 > Several changes are _not_ OK. There is clearly a definition that for a null value an NPE is expected, not IAE for past 10+ years. This violates the expectations from Effective Java. @elharo This is really nitpicking. Can you show me _where we make use of that important distinction_? > Drop use of commons-lang > > > Key: MNG-8146 > URL: https://issues.apache.org/jira/browse/MNG-8146 > Project: Maven > Issue Type: Task >Reporter: Tamas Cservenak >Priority: Major > Fix For: 3.9.8 > > > Maven 4 already did this. By introspection, it turns out that 3.9 is also > very lightly use commons-lang, while it in fact represents quite noticeable > overhead of the ZIP distro size (10% almost). Without commons-lang Maven > 3.9.x distro is 9MB only. > Moreover, the presence of commons-lang just introduced some peculiarities: > * confusion over StringUtils (vs Plexus Utils StringUtils) > * skewed param validation: according to commons-lang string "2." is not a > valid float, while Float.parseFloat nicely parses it into 2.0 (see MNG-7756) > * PR ended up with {_}same LOC but noticeable smaller ZIP distro{_}, meaning > not much was really used out of it -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-7758) o.e.aether.resolution.ArtifactResolutionException incorrectly examined when multiple repositories are involved
[ https://issues.apache.org/jira/browse/MNG-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852742#comment-17852742 ] ASF GitHub Bot commented on MNG-7758: - michael-o commented on PR #1563: URL: https://github.com/apache/maven/pull/1563#issuecomment-2152128194 Give me a day or two, I try to try this out in a realworld env. > o.e.aether.resolution.ArtifactResolutionException incorrectly examined when > multiple repositories are involved > -- > > Key: MNG-7758 > URL: https://issues.apache.org/jira/browse/MNG-7758 > Project: Maven > Issue Type: Bug > Components: Artifacts and Repositories, Dependencies, Performance >Affects Versions: 3.8.8, 3.9.1, 4.0.0-alpha-5 >Reporter: Michael Osipov >Priority: Critical > Fix For: 4.0.x-candidate, 4.0.0 > > Attachments: 1.png, 2.png, Exception hierarchy.png > > > Consider you have three repos defined in your build (could be POM or > settings), evaluated in following order: > 1. repo A: serves custom artifacts with group id {{com.example}}, due to repo > partitioning in Nexus rejects requests to all other group ids with 403 > 1. repo B: serves third party artifacts without any restriction from a Nexus > repo > 1. repo C: serves Central mirror, last one quried, no restrictions > Note that order is important! Now add a non-existing dependency to your POM > and receive the following behavior: > {{ArtifactResolutionException}} will contain an {{ArtifactResult}} with three > exceptions: > - {{TransferException}} with nested {{AuthorizationException}}, > - {{ArtifactNotFoundException}}, > - {{ArtifactNotFoundException}}. > {{ArtifactResolutionException#getCause()}} will be populated with the > {{TransferException}} so will > {{org.eclipse.aether.resolution.ArtifactResult.isMissing()}} take the first > exception only into account. E.g., {{DefaultArtifactDescriptorReader}} will > do {{if (e.getCause() instanceof ArtifactNotFoundException)}} which is > deceiving. > Here is a sample for a non-existing artifact: > {noformat} > [INFO] --- maven-site-plugin:4.0.0-M7-SNAPSHOT:site (default-site) @ > mskins-222 --- > [INFO] Configuring report plugin > org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.2 > [WARNING] index report is declared twice in default reportSet > [INFO] 15 reports configured for maven-project-info-reports-plugin:3.4.2: > index, summary, dependency-info, modules, team, scm, issue-management, > mailing-lists, dependency-management, dependencies, dependency-convergence, > ci-management, plugin-management, plugins, distribution-management > [INFO] Rendering site for default locale > Downloading from lda-public: > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 3.214 s > [INFO] Finished at: 2023-04-02T12:51:02+02:00 > [INFO] > > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222: SiteToolException: The site descriptor > cannot be resolved from the repository: Unable to locate site descriptor: > Could not transfer artifact org.apache:apache:xml:site:29 from/to lda-public > (https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/): > authorization failed for > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml, > status: 403 Forbidden -> [Help 1] > [ERROR] > [ERROR] To see the full stack trace of the errors, re-run Maven with the -e > switch. > [ERROR] Re-run Maven using the -X switch to enable full debug logging. > [ERROR] > [ERROR] For more information about the errors and possible solutions, please > read the following articles: > [ERROR] [Help 1] > http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException > {noformat} > for a dependency: > {noformat} > [INFO] org.apache.maven.cli.event.ExecutionEventLogger - > > [ERROR] org.apache.maven.cli.MavenCli - Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222: Failed to get report for > org.apache.maven.plugins:maven-project-plugin: Plugin > org.apache.maven.plugins:maven-project-plugin:3.4.2 or one of its > dependencies could not be resolved: Failed to read artifact descriptor for >
[jira] [Commented] (MNG-8066) Maven hangs on self-referencing exceptions
[ https://issues.apache.org/jira/browse/MNG-8066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852714#comment-17852714 ] ASF GitHub Bot commented on MNG-8066: - cstamas merged PR #1558: URL: https://github.com/apache/maven/pull/1558 > Maven hangs on self-referencing exceptions > -- > > Key: MNG-8066 > URL: https://issues.apache.org/jira/browse/MNG-8066 > Project: Maven > Issue Type: Bug >Reporter: François Guillot >Assignee: Tamas Cservenak >Priority: Major > Fix For: 4.0.0, 3.9.8, 4.0.0-beta-4 > > > If the code executed by Maven throws a self-referencing exception, such as > {code:java} > RuntimeException selfReferencingException = new RuntimeException("BOOM self"); > selfReferencingException.initCause(new Exception("BOOM cause", > selfReferencingException)); > throw selfReferencingException; > {code} > For instance, if this code is added to an `AbstractExecutionListener`, which > is added to the running build: > {code:java} > import org.apache.maven.execution.AbstractExecutionListener; > import org.apache.maven.execution.ExecutionListener; > import org.apache.maven.execution.ExecutionEvent; > public class FailingExecutionListener extends AbstractExecutionListener { > private final ExecutionListener delegate; > public FailingExecutionListener(ExecutionListener delegate) { > this.delegate = delegate; > } > @Override > public void sessionStarted(ExecutionEvent event) { > if (delegate != null) { > delegate.sessionStarted(event); > } > RuntimeException selfReferencingException = new RuntimeException("BOOM > self"); > selfReferencingException.initCause(new Exception("BOOM cause", > selfReferencingException)); > throw selfReferencingException; > } > } > {code} > Maven hangs at the end of the build, in `DefaultExceptionHandler`. > The code in `DefaultExceptionHandler#getMessage` iterates on a given > throwable and its causes. It checks if the cause is not the same throwable, > but doesn't protect against a 'two-level' recursion like shown above. > Note that when printing a stacktrace, Java itself protects against this via > the use of a > {code:java} > Set dejaVu = Collections.newSetFromMap(new IdentityHashMap<>()); > {code} > and stops the recursion if encountering an already seen throwable. > A way to fix this would be to replace the offending cause with a replacement > with no cause, such as in > {code:java} > private static Throwable patchCircularCause(Throwable current, Throwable > parent) { > try { > Field causeField = Throwable.class.getDeclaredField("cause"); > causeField.setAccessible(true); > Throwable replacement = new Throwable("[CIRCULAR REFERENCE: " + > current + "]"); > replacement.setStackTrace(current.getStackTrace()); > causeField.set(parent, replacement); > return replacement; > } catch (NoSuchFieldException | IllegalAccessException e) { > // Couldn't replace the cause, let's return the actual exception. > return current; > } > } > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MPMD-395) Build doesn't fail for invalid CPD format
[ https://issues.apache.org/jira/browse/MPMD-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852708#comment-17852708 ] ASF GitHub Bot commented on MPMD-395: - michael-o commented on code in PR #150: URL: https://github.com/apache/maven-pmd-plugin/pull/150#discussion_r1629162067 ## src/test/java/org/apache/maven/plugins/pmd/CpdReportTest.java: ## @@ -130,7 +130,8 @@ public void testInvalidFormat() throws Exception { fail("MavenReportException must be thrown"); } catch (Exception e) { -assertTrue(true); +assertMavenReportException("There were 1 errors while executing CPD", e); Review Comment: Can we make that better for singular and plural... ## src/main/java/org/apache/maven/plugins/pmd/exec/CpdReportConsumer.java: ## @@ -0,0 +1,118 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.plugins.pmd.exec; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.util.function.Consumer; +import java.util.function.Predicate; + +import net.sourceforge.pmd.cpd.CPDReport; +import net.sourceforge.pmd.cpd.CPDReportRenderer; +import net.sourceforge.pmd.cpd.Match; +import net.sourceforge.pmd.cpd.XMLRenderer; +import org.apache.maven.plugins.pmd.ExcludeDuplicationsFromFile; +import org.apache.maven.reporting.MavenReportException; +import org.codehaus.plexus.util.FileUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +class CpdReportConsumer implements Consumer { +private static final Logger LOG = LoggerFactory.getLogger(CpdReportConsumer.class); + +private final CpdRequest request; +private final ExcludeDuplicationsFromFile excludeDuplicationsFromFile; + +CpdReportConsumer(CpdRequest request, ExcludeDuplicationsFromFile excludeDuplicationsFromFile) { +this.request = request; +this.excludeDuplicationsFromFile = excludeDuplicationsFromFile; +} + +@Override +public void accept(CPDReport report) { +try { +// always create XML format. we need to output it even if the file list is empty or we have no +// duplications so that the "check" goals can check for violations +writeXmlReport(report); + +// HTML format is handled by maven site report, XML format has already been rendered. +// a renderer is only needed for other formats +String format = request.getFormat(); +if (!"html".equals(format) && !"xml".equals(format)) { +writeFormattedReport(report); +} +} catch (IOException | MavenReportException e) { +// Exceptions happening during this consumer are logged by PMD +// through the CPDConfiguration's reporter. Review Comment: Where? I don't see it. ## src/main/java/org/apache/maven/plugins/pmd/exec/CpdReportConsumer.java: ## @@ -0,0 +1,118 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.plugins.pmd.exec; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.util.function.Consumer; +import java.util.function.Predicate; + +import
[jira] [Commented] (MNG-8142) If JDK profile activator gets "invalid" JDK version for whatever reason, it chokes but does not tell why
[ https://issues.apache.org/jira/browse/MNG-8142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852707#comment-17852707 ] ASF GitHub Bot commented on MNG-8142: - cstamas commented on PR #1557: URL: https://github.com/apache/maven/pull/1557#issuecomment-2151862969 Added UT: before this PR, the code in UT would throw `NumberFormatEx`, but now it cleanly remains inactive and tells the problem. > If JDK profile activator gets "invalid" JDK version for whatever reason, it > chokes but does not tell why > > > Key: MNG-8142 > URL: https://issues.apache.org/jira/browse/MNG-8142 > Project: Maven > Issue Type: Bug > Components: Core >Reporter: Tamas Cservenak >Assignee: Tamas Cservenak >Priority: Major > Fix For: 4.0.0, 3.9.8, 4.0.0-beta-4 > > > The JDK profile activator uses property {{java.version}} to determine is > profile active or not, but if you look at MNG-3746 you can see that Maven > _allows overriding that property_ by user, but also, today some "weird > formatted" version may pop up in the wild. > The JDK profile activator is not prepared for these cases, and will just > throw (NumberFormatEx), without telling why it did belly up. > Improve the message why it throw. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MPMD-395) Build doesn't fail for invalid CPD format
[ https://issues.apache.org/jira/browse/MPMD-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852706#comment-17852706 ] ASF GitHub Bot commented on MPMD-395: - michael-o commented on code in PR #150: URL: https://github.com/apache/maven-pmd-plugin/pull/150#discussion_r1629157354 ## src/main/java/org/apache/maven/plugins/pmd/exec/PmdErrorMessageReporter.java: ## @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.plugins.pmd.exec; + +import java.util.ArrayList; +import java.util.List; + +import net.sourceforge.pmd.util.log.PmdReporter; +import org.apache.maven.reporting.MavenReportException; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.slf4j.event.Level; + +class PmdErrorMessageReporter implements PmdReporter { +private final PmdReporter delegate; +private List errors = new ArrayList<>(); + +PmdErrorMessageReporter(PmdReporter delegate) { +this.delegate = delegate; +} + +@Override +public boolean isLoggable(Level level) { +return delegate.isLoggable(level); +} + +@Override +public void logEx(Level level, @Nullable String message, Object[] formatArgs, @Nullable Throwable error) { +if (error != null) { +if (error instanceof RuntimeException && error.getCause() instanceof MavenReportException) { +errors.add(error.getCause()); +} else { +errors.add(error); +} +} + +delegate.logEx(level, message, formatArgs, error); +} + +@Override +public int numErrors() { +return delegate.numErrors(); +} + +public void rethrowErrorsAsMavenReportException() throws MavenReportException { +if (errors.isEmpty()) { +return; +} + +final MavenReportException exception; + +Throwable firstError = errors.get(0); Review Comment: This reminds me bit of Enforcer... ## src/main/java/org/apache/maven/plugins/pmd/exec/PmdErrorMessageReporter.java: ## @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.plugins.pmd.exec; + +import java.util.ArrayList; +import java.util.List; + +import net.sourceforge.pmd.util.log.PmdReporter; +import org.apache.maven.reporting.MavenReportException; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.slf4j.event.Level; + +class PmdErrorMessageReporter implements PmdReporter { +private final PmdReporter delegate; +private List errors = new ArrayList<>(); + +PmdErrorMessageReporter(PmdReporter delegate) { +this.delegate = delegate; +} + +@Override +public boolean isLoggable(Level level) { +return delegate.isLoggable(level); +} + +@Override +public void logEx(Level level, @Nullable String message, Object[] formatArgs, @Nullable Throwable error) { +if (error != null) { +if (error instanceof RuntimeException && error.getCause() instanceof MavenReportException) { +errors.add(error.getCause()); +} else { +errors.add(error); +} +} + +delegate.logEx(level, message, formatArgs, error); +} + +@Override +public int numErrors() { +return delegate.numErrors(); +} + +public
[jira] [Commented] (MNG-7758) o.e.aether.resolution.ArtifactResolutionException incorrectly examined when multiple repositories are involved
[ https://issues.apache.org/jira/browse/MNG-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852705#comment-17852705 ] ASF GitHub Bot commented on MNG-7758: - michael-o commented on code in PR #1563: URL: https://github.com/apache/maven/pull/1563#discussion_r1629141312 ## maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java: ## @@ -160,7 +160,9 @@ public DependencyResolutionResult resolve(DependencyResolutionRequest request) result.setCollectionErrors(e.getResult().getExceptions()); throw new DependencyResolutionException( -result, "Could not resolve dependencies for project " + project.getId() + ": " + e.getMessage(), e); +result, +"Could not collect dependencies for project " + project.getId(), +logger.isDebugEnabled() ? e : null); Review Comment: This is one of the reasons led me to DOXIASITETOOLS-303 ## maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java: ## @@ -160,7 +160,9 @@ public DependencyResolutionResult resolve(DependencyResolutionRequest request) result.setCollectionErrors(e.getResult().getExceptions()); throw new DependencyResolutionException( -result, "Could not resolve dependencies for project " + project.getId() + ": " + e.getMessage(), e); +result, +"Could not collect dependencies for project " + project.getId(), +logger.isDebugEnabled() ? e : null); Review Comment: This is one of the reasons led me to [DOXIASITETOOLS-303](https://issues.apache.org/jira/browse/DOXIASITETOOLS-303) > o.e.aether.resolution.ArtifactResolutionException incorrectly examined when > multiple repositories are involved > -- > > Key: MNG-7758 > URL: https://issues.apache.org/jira/browse/MNG-7758 > Project: Maven > Issue Type: Bug > Components: Artifacts and Repositories, Dependencies, Performance >Affects Versions: 3.8.8, 3.9.1, 4.0.0-alpha-5 >Reporter: Michael Osipov >Priority: Critical > Fix For: 4.0.x-candidate, 4.0.0 > > Attachments: 1.png, 2.png, Exception hierarchy.png > > > Consider you have three repos defined in your build (could be POM or > settings), evaluated in following order: > 1. repo A: serves custom artifacts with group id {{com.example}}, due to repo > partitioning in Nexus rejects requests to all other group ids with 403 > 1. repo B: serves third party artifacts without any restriction from a Nexus > repo > 1. repo C: serves Central mirror, last one quried, no restrictions > Note that order is important! Now add a non-existing dependency to your POM > and receive the following behavior: > {{ArtifactResolutionException}} will contain an {{ArtifactResult}} with three > exceptions: > - {{TransferException}} with nested {{AuthorizationException}}, > - {{ArtifactNotFoundException}}, > - {{ArtifactNotFoundException}}. > {{ArtifactResolutionException#getCause()}} will be populated with the > {{TransferException}} so will > {{org.eclipse.aether.resolution.ArtifactResult.isMissing()}} take the first > exception only into account. E.g., {{DefaultArtifactDescriptorReader}} will > do {{if (e.getCause() instanceof ArtifactNotFoundException)}} which is > deceiving. > Here is a sample for a non-existing artifact: > {noformat} > [INFO] --- maven-site-plugin:4.0.0-M7-SNAPSHOT:site (default-site) @ > mskins-222 --- > [INFO] Configuring report plugin > org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.2 > [WARNING] index report is declared twice in default reportSet > [INFO] 15 reports configured for maven-project-info-reports-plugin:3.4.2: > index, summary, dependency-info, modules, team, scm, issue-management, > mailing-lists, dependency-management, dependencies, dependency-convergence, > ci-management, plugin-management, plugins, distribution-management > [INFO] Rendering site for default locale > Downloading from lda-public: > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 3.214 s > [INFO] Finished at: 2023-04-02T12:51:02+02:00 > [INFO] > > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222:
[jira] [Commented] (MNG-7758) o.e.aether.resolution.ArtifactResolutionException incorrectly examined when multiple repositories are involved
[ https://issues.apache.org/jira/browse/MNG-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852702#comment-17852702 ] ASF GitHub Bot commented on MNG-7758: - slawekjaranowski commented on code in PR #1563: URL: https://github.com/apache/maven/pull/1563#discussion_r1629134423 ## maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java: ## @@ -160,7 +160,9 @@ public DependencyResolutionResult resolve(DependencyResolutionRequest request) result.setCollectionErrors(e.getResult().getExceptions()); throw new DependencyResolutionException( -result, "Could not resolve dependencies for project " + project.getId() + ": " + e.getMessage(), e); +result, +"Could not collect dependencies for project " + project.getId(), +logger.isDebugEnabled() ? e : null); Review Comment: detailed contains more info which is not available in `o.e.aether.resolution.ArtifactResolutionException` `ArtifactResolutionException.getMessage` returns error for last repository > o.e.aether.resolution.ArtifactResolutionException incorrectly examined when > multiple repositories are involved > -- > > Key: MNG-7758 > URL: https://issues.apache.org/jira/browse/MNG-7758 > Project: Maven > Issue Type: Bug > Components: Artifacts and Repositories, Dependencies, Performance >Affects Versions: 3.8.8, 3.9.1, 4.0.0-alpha-5 >Reporter: Michael Osipov >Priority: Critical > Fix For: 4.0.x-candidate, 4.0.0 > > Attachments: 1.png, 2.png, Exception hierarchy.png > > > Consider you have three repos defined in your build (could be POM or > settings), evaluated in following order: > 1. repo A: serves custom artifacts with group id {{com.example}}, due to repo > partitioning in Nexus rejects requests to all other group ids with 403 > 1. repo B: serves third party artifacts without any restriction from a Nexus > repo > 1. repo C: serves Central mirror, last one quried, no restrictions > Note that order is important! Now add a non-existing dependency to your POM > and receive the following behavior: > {{ArtifactResolutionException}} will contain an {{ArtifactResult}} with three > exceptions: > - {{TransferException}} with nested {{AuthorizationException}}, > - {{ArtifactNotFoundException}}, > - {{ArtifactNotFoundException}}. > {{ArtifactResolutionException#getCause()}} will be populated with the > {{TransferException}} so will > {{org.eclipse.aether.resolution.ArtifactResult.isMissing()}} take the first > exception only into account. E.g., {{DefaultArtifactDescriptorReader}} will > do {{if (e.getCause() instanceof ArtifactNotFoundException)}} which is > deceiving. > Here is a sample for a non-existing artifact: > {noformat} > [INFO] --- maven-site-plugin:4.0.0-M7-SNAPSHOT:site (default-site) @ > mskins-222 --- > [INFO] Configuring report plugin > org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.2 > [WARNING] index report is declared twice in default reportSet > [INFO] 15 reports configured for maven-project-info-reports-plugin:3.4.2: > index, summary, dependency-info, modules, team, scm, issue-management, > mailing-lists, dependency-management, dependencies, dependency-convergence, > ci-management, plugin-management, plugins, distribution-management > [INFO] Rendering site for default locale > Downloading from lda-public: > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 3.214 s > [INFO] Finished at: 2023-04-02T12:51:02+02:00 > [INFO] > > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222: SiteToolException: The site descriptor > cannot be resolved from the repository: Unable to locate site descriptor: > Could not transfer artifact org.apache:apache:xml:site:29 from/to lda-public > (https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/): > authorization failed for > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml, > status: 403 Forbidden -> [Help 1] > [ERROR] > [ERROR] To see the full stack trace of the errors, re-run Maven with the -e > switch. > [ERROR] Re-run Maven using the -X switch to enable full debug logging. > [ERROR] > [ERROR] For more
[jira] [Commented] (MPMD-395) Build doesn't fail for invalid CPD format
[ https://issues.apache.org/jira/browse/MPMD-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852683#comment-17852683 ] ASF GitHub Bot commented on MPMD-395: - michael-o commented on PR #150: URL: https://github.com/apache/maven-pmd-plugin/pull/150#issuecomment-2151711151 @adangel thanks for the rework, will review again. > Build doesn't fail for invalid CPD format > - > > Key: MPMD-395 > URL: https://issues.apache.org/jira/browse/MPMD-395 > Project: Maven PMD Plugin > Issue Type: Bug > Components: CPD >Affects Versions: 3.22.0 >Reporter: Andreas Dangel >Assignee: Andreas Dangel >Priority: Major > Fix For: next-version > > > See > [https://github.com/apache/maven-pmd-plugin/pull/144#issuecomment-2094371392] > > If an exception occurs while the CPD report is created, the exception is only > logged but doesn't fail the build. This means, that build appears to be > successful, although it didn't produce all expected build artifacts. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-7758) o.e.aether.resolution.ArtifactResolutionException incorrectly examined when multiple repositories are involved
[ https://issues.apache.org/jira/browse/MNG-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852682#comment-17852682 ] ASF GitHub Bot commented on MNG-7758: - gnodet commented on code in PR #1563: URL: https://github.com/apache/maven/pull/1563#discussion_r1629018214 ## maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java: ## @@ -160,7 +160,9 @@ public DependencyResolutionResult resolve(DependencyResolutionRequest request) result.setCollectionErrors(e.getResult().getExceptions()); throw new DependencyResolutionException( -result, "Could not resolve dependencies for project " + project.getId() + ": " + e.getMessage(), e); +result, +"Could not collect dependencies for project " + project.getId(), +logger.isDebugEnabled() ? e : null); Review Comment: If we have more detailed info at debug level, especially in case of an error, it may make sense to indicate so in the non detailed error message ? > o.e.aether.resolution.ArtifactResolutionException incorrectly examined when > multiple repositories are involved > -- > > Key: MNG-7758 > URL: https://issues.apache.org/jira/browse/MNG-7758 > Project: Maven > Issue Type: Bug > Components: Artifacts and Repositories, Dependencies, Performance >Affects Versions: 3.8.8, 3.9.1, 4.0.0-alpha-5 >Reporter: Michael Osipov >Priority: Critical > Fix For: 4.0.x-candidate, 4.0.0 > > Attachments: 1.png, 2.png, Exception hierarchy.png > > > Consider you have three repos defined in your build (could be POM or > settings), evaluated in following order: > 1. repo A: serves custom artifacts with group id {{com.example}}, due to repo > partitioning in Nexus rejects requests to all other group ids with 403 > 1. repo B: serves third party artifacts without any restriction from a Nexus > repo > 1. repo C: serves Central mirror, last one quried, no restrictions > Note that order is important! Now add a non-existing dependency to your POM > and receive the following behavior: > {{ArtifactResolutionException}} will contain an {{ArtifactResult}} with three > exceptions: > - {{TransferException}} with nested {{AuthorizationException}}, > - {{ArtifactNotFoundException}}, > - {{ArtifactNotFoundException}}. > {{ArtifactResolutionException#getCause()}} will be populated with the > {{TransferException}} so will > {{org.eclipse.aether.resolution.ArtifactResult.isMissing()}} take the first > exception only into account. E.g., {{DefaultArtifactDescriptorReader}} will > do {{if (e.getCause() instanceof ArtifactNotFoundException)}} which is > deceiving. > Here is a sample for a non-existing artifact: > {noformat} > [INFO] --- maven-site-plugin:4.0.0-M7-SNAPSHOT:site (default-site) @ > mskins-222 --- > [INFO] Configuring report plugin > org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.2 > [WARNING] index report is declared twice in default reportSet > [INFO] 15 reports configured for maven-project-info-reports-plugin:3.4.2: > index, summary, dependency-info, modules, team, scm, issue-management, > mailing-lists, dependency-management, dependencies, dependency-convergence, > ci-management, plugin-management, plugins, distribution-management > [INFO] Rendering site for default locale > Downloading from lda-public: > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 3.214 s > [INFO] Finished at: 2023-04-02T12:51:02+02:00 > [INFO] > > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222: SiteToolException: The site descriptor > cannot be resolved from the repository: Unable to locate site descriptor: > Could not transfer artifact org.apache:apache:xml:site:29 from/to lda-public > (https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/): > authorization failed for > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml, > status: 403 Forbidden -> [Help 1] > [ERROR] > [ERROR] To see the full stack trace of the errors, re-run Maven with the -e > switch. > [ERROR] Re-run Maven using the -X switch to enable full debug logging. > [ERROR] > [ERROR] For more information about the errors and possible solutions,
[jira] [Commented] (MNG-7758) o.e.aether.resolution.ArtifactResolutionException incorrectly examined when multiple repositories are involved
[ https://issues.apache.org/jira/browse/MNG-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852681#comment-17852681 ] ASF GitHub Bot commented on MNG-7758: - michael-o commented on code in PR #1563: URL: https://github.com/apache/maven/pull/1563#discussion_r1629016815 ## maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java: ## @@ -160,7 +160,9 @@ public DependencyResolutionResult resolve(DependencyResolutionRequest request) result.setCollectionErrors(e.getResult().getExceptions()); throw new DependencyResolutionException( -result, "Could not resolve dependencies for project " + project.getId() + ": " + e.getMessage(), e); +result, +"Could not collect dependencies for project " + project.getId(), +logger.isDebugEnabled() ? e : null); Review Comment: But isn't that a problem of the catcher, not the thrower? > o.e.aether.resolution.ArtifactResolutionException incorrectly examined when > multiple repositories are involved > -- > > Key: MNG-7758 > URL: https://issues.apache.org/jira/browse/MNG-7758 > Project: Maven > Issue Type: Bug > Components: Artifacts and Repositories, Dependencies, Performance >Affects Versions: 3.8.8, 3.9.1, 4.0.0-alpha-5 >Reporter: Michael Osipov >Priority: Critical > Fix For: 4.0.x-candidate, 4.0.0 > > Attachments: 1.png, 2.png, Exception hierarchy.png > > > Consider you have three repos defined in your build (could be POM or > settings), evaluated in following order: > 1. repo A: serves custom artifacts with group id {{com.example}}, due to repo > partitioning in Nexus rejects requests to all other group ids with 403 > 1. repo B: serves third party artifacts without any restriction from a Nexus > repo > 1. repo C: serves Central mirror, last one quried, no restrictions > Note that order is important! Now add a non-existing dependency to your POM > and receive the following behavior: > {{ArtifactResolutionException}} will contain an {{ArtifactResult}} with three > exceptions: > - {{TransferException}} with nested {{AuthorizationException}}, > - {{ArtifactNotFoundException}}, > - {{ArtifactNotFoundException}}. > {{ArtifactResolutionException#getCause()}} will be populated with the > {{TransferException}} so will > {{org.eclipse.aether.resolution.ArtifactResult.isMissing()}} take the first > exception only into account. E.g., {{DefaultArtifactDescriptorReader}} will > do {{if (e.getCause() instanceof ArtifactNotFoundException)}} which is > deceiving. > Here is a sample for a non-existing artifact: > {noformat} > [INFO] --- maven-site-plugin:4.0.0-M7-SNAPSHOT:site (default-site) @ > mskins-222 --- > [INFO] Configuring report plugin > org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.2 > [WARNING] index report is declared twice in default reportSet > [INFO] 15 reports configured for maven-project-info-reports-plugin:3.4.2: > index, summary, dependency-info, modules, team, scm, issue-management, > mailing-lists, dependency-management, dependencies, dependency-convergence, > ci-management, plugin-management, plugins, distribution-management > [INFO] Rendering site for default locale > Downloading from lda-public: > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 3.214 s > [INFO] Finished at: 2023-04-02T12:51:02+02:00 > [INFO] > > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222: SiteToolException: The site descriptor > cannot be resolved from the repository: Unable to locate site descriptor: > Could not transfer artifact org.apache:apache:xml:site:29 from/to lda-public > (https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/): > authorization failed for > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml, > status: 403 Forbidden -> [Help 1] > [ERROR] > [ERROR] To see the full stack trace of the errors, re-run Maven with the -e > switch. > [ERROR] Re-run Maven using the -X switch to enable full debug logging. > [ERROR] > [ERROR] For more information about the errors and possible solutions, please > read the following articles: > [ERROR] [Help 1] >
[jira] [Commented] (MPMD-395) Build doesn't fail for invalid CPD format
[ https://issues.apache.org/jira/browse/MPMD-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852678#comment-17852678 ] ASF GitHub Bot commented on MPMD-395: - adangel commented on code in PR #150: URL: https://github.com/apache/maven-pmd-plugin/pull/150#discussion_r1629003414 ## src/main/java/org/apache/maven/plugins/pmd/exec/PmdErrorMessageReporter.java: ## @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.plugins.pmd.exec; + +import java.util.ArrayList; +import java.util.List; + +import net.sourceforge.pmd.util.log.PmdReporter; +import org.apache.maven.reporting.MavenReportException; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.slf4j.event.Level; + +class PmdErrorMessageReporter implements PmdReporter { +private final PmdReporter delegate; +private List errors = new ArrayList<>(); + +PmdErrorMessageReporter(PmdReporter delegate) { +this.delegate = delegate; +} + +@Override +public boolean isLoggable(Level level) { +return delegate.isLoggable(level); +} + +@Override +public void logEx(Level level, @Nullable String message, Object[] formatArgs, @Nullable Throwable error) { +if (error != null) { +if (error instanceof RuntimeException && error.getCause() instanceof MavenReportException) { +errors.add(error.getCause()); +} else { +errors.add(error); +} +} + +delegate.logEx(level, message, formatArgs, error); +} + +@Override +public int numErrors() { +return delegate.numErrors(); +} + +public void rethrowErrorsAsMavenReportException() throws MavenReportException { +if (errors.isEmpty()) { +return; +} + +final MavenReportException exception; + +Throwable firstError = errors.get(0); Review Comment: I've now done another approach: just let PMD log the errors and m-pmd-p fails the build with the message "There were ... errors while executing CPD". The actual errors (e.g. "Lexical error in file ...") have been already logged, so users just need to scroll up. This also means, that these errors are logged only once and we don't need a custom PmdErrorMessageReporter. > @adangel Do you think you could add a test which invokes the exception handling and we can see the log output and `throw` combined? I've added a test case, see CpdReportTest#testWithCpdErrors. It asserts that we get the main exception which fails the build as well as the actual errors appear in the log output. > Build doesn't fail for invalid CPD format > - > > Key: MPMD-395 > URL: https://issues.apache.org/jira/browse/MPMD-395 > Project: Maven PMD Plugin > Issue Type: Bug > Components: CPD >Affects Versions: 3.22.0 >Reporter: Andreas Dangel >Assignee: Andreas Dangel >Priority: Major > Fix For: next-version > > > See > [https://github.com/apache/maven-pmd-plugin/pull/144#issuecomment-2094371392] > > If an exception occurs while the CPD report is created, the exception is only > logged but doesn't fail the build. This means, that build appears to be > successful, although it didn't produce all expected build artifacts. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-7758) o.e.aether.resolution.ArtifactResolutionException incorrectly examined when multiple repositories are involved
[ https://issues.apache.org/jira/browse/MNG-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852676#comment-17852676 ] ASF GitHub Bot commented on MNG-7758: - slawekjaranowski commented on code in PR #1563: URL: https://github.com/apache/maven/pull/1563#discussion_r1628979345 ## maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java: ## @@ -160,7 +160,9 @@ public DependencyResolutionResult resolve(DependencyResolutionRequest request) result.setCollectionErrors(e.getResult().getExceptions()); throw new DependencyResolutionException( -result, "Could not resolve dependencies for project " + project.getId() + ": " + e.getMessage(), e); +result, +"Could not collect dependencies for project " + project.getId(), +logger.isDebugEnabled() ? e : null); Review Comment: When we have exception in stack all message from all exception will be added to output in normal run we will have some information duplicate now ## maven-core/src/main/java/org/apache/maven/project/DependencyResolutionException.java: ## @@ -18,18 +18,52 @@ */ package org.apache.maven.project; +import java.util.List; + +import org.eclipse.aether.graph.Dependency; + /** */ public class DependencyResolutionException extends Exception { private final transient DependencyResolutionResult result; +private final transient String detailMessage; public DependencyResolutionException(DependencyResolutionResult result, String message, Throwable cause) { super(message, cause); this.result = result; +this.detailMessage = prepareDetailMessage(message, result); +} + +private static String prepareDetailMessage(String message, DependencyResolutionResult result) { +StringBuilder msg = new StringBuilder(message); +msg.append(System.lineSeparator()); +for (Dependency dependency : result.getUnresolvedDependencies()) { +msg.append("dependency: ").append(dependency).append(System.lineSeparator()); +List exceptions = result.getResolutionErrors(dependency); +for (Exception e : exceptions) { + msg.append("\t").append(e.getMessage()).append(System.lineSeparator()); +} +} + +for (Exception exception : result.getCollectionErrors()) { +msg.append(exception.getMessage()).append(System.lineSeparator()); +if (exception.getCause() != null) { +msg.append("\tCaused by: ") +.append(exception.getCause().getMessage()) Review Comment: right > o.e.aether.resolution.ArtifactResolutionException incorrectly examined when > multiple repositories are involved > -- > > Key: MNG-7758 > URL: https://issues.apache.org/jira/browse/MNG-7758 > Project: Maven > Issue Type: Bug > Components: Artifacts and Repositories, Dependencies, Performance >Affects Versions: 3.8.8, 3.9.1, 4.0.0-alpha-5 >Reporter: Michael Osipov >Priority: Critical > Fix For: 4.0.x-candidate, 4.0.0 > > Attachments: 1.png, 2.png, Exception hierarchy.png > > > Consider you have three repos defined in your build (could be POM or > settings), evaluated in following order: > 1. repo A: serves custom artifacts with group id {{com.example}}, due to repo > partitioning in Nexus rejects requests to all other group ids with 403 > 1. repo B: serves third party artifacts without any restriction from a Nexus > repo > 1. repo C: serves Central mirror, last one quried, no restrictions > Note that order is important! Now add a non-existing dependency to your POM > and receive the following behavior: > {{ArtifactResolutionException}} will contain an {{ArtifactResult}} with three > exceptions: > - {{TransferException}} with nested {{AuthorizationException}}, > - {{ArtifactNotFoundException}}, > - {{ArtifactNotFoundException}}. > {{ArtifactResolutionException#getCause()}} will be populated with the > {{TransferException}} so will > {{org.eclipse.aether.resolution.ArtifactResult.isMissing()}} take the first > exception only into account. E.g., {{DefaultArtifactDescriptorReader}} will > do {{if (e.getCause() instanceof ArtifactNotFoundException)}} which is > deceiving. > Here is a sample for a non-existing artifact: > {noformat} > [INFO] --- maven-site-plugin:4.0.0-M7-SNAPSHOT:site (default-site) @ > mskins-222 --- > [INFO] Configuring report plugin > org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.2 > [WARNING] index report is declared twice in default reportSet > [INFO] 15 reports configured for
[jira] [Commented] (MNG-7758) o.e.aether.resolution.ArtifactResolutionException incorrectly examined when multiple repositories are involved
[ https://issues.apache.org/jira/browse/MNG-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852665#comment-17852665 ] ASF GitHub Bot commented on MNG-7758: - michael-o commented on code in PR #1563: URL: https://github.com/apache/maven/pull/1563#discussion_r1628927252 ## maven-core/src/main/java/org/apache/maven/project/DependencyResolutionException.java: ## @@ -18,18 +18,52 @@ */ package org.apache.maven.project; +import java.util.List; + +import org.eclipse.aether.graph.Dependency; + /** */ public class DependencyResolutionException extends Exception { private final transient DependencyResolutionResult result; +private final transient String detailMessage; public DependencyResolutionException(DependencyResolutionResult result, String message, Throwable cause) { super(message, cause); this.result = result; +this.detailMessage = prepareDetailMessage(message, result); +} + +private static String prepareDetailMessage(String message, DependencyResolutionResult result) { +StringBuilder msg = new StringBuilder(message); +msg.append(System.lineSeparator()); +for (Dependency dependency : result.getUnresolvedDependencies()) { +msg.append("dependency: ").append(dependency).append(System.lineSeparator()); +List exceptions = result.getResolutionErrors(dependency); +for (Exception e : exceptions) { + msg.append("\t").append(e.getMessage()).append(System.lineSeparator()); +} +} + +for (Exception exception : result.getCollectionErrors()) { +msg.append(exception.getMessage()).append(System.lineSeparator()); +if (exception.getCause() != null) { +msg.append("\tCaused by: ") +.append(exception.getCause().getMessage()) Review Comment: This means that the call stack isn't visiable, right? > o.e.aether.resolution.ArtifactResolutionException incorrectly examined when > multiple repositories are involved > -- > > Key: MNG-7758 > URL: https://issues.apache.org/jira/browse/MNG-7758 > Project: Maven > Issue Type: Bug > Components: Artifacts and Repositories, Dependencies, Performance >Affects Versions: 3.8.8, 3.9.1, 4.0.0-alpha-5 >Reporter: Michael Osipov >Priority: Critical > Fix For: 4.0.x-candidate, 4.0.0 > > Attachments: 1.png, 2.png, Exception hierarchy.png > > > Consider you have three repos defined in your build (could be POM or > settings), evaluated in following order: > 1. repo A: serves custom artifacts with group id {{com.example}}, due to repo > partitioning in Nexus rejects requests to all other group ids with 403 > 1. repo B: serves third party artifacts without any restriction from a Nexus > repo > 1. repo C: serves Central mirror, last one quried, no restrictions > Note that order is important! Now add a non-existing dependency to your POM > and receive the following behavior: > {{ArtifactResolutionException}} will contain an {{ArtifactResult}} with three > exceptions: > - {{TransferException}} with nested {{AuthorizationException}}, > - {{ArtifactNotFoundException}}, > - {{ArtifactNotFoundException}}. > {{ArtifactResolutionException#getCause()}} will be populated with the > {{TransferException}} so will > {{org.eclipse.aether.resolution.ArtifactResult.isMissing()}} take the first > exception only into account. E.g., {{DefaultArtifactDescriptorReader}} will > do {{if (e.getCause() instanceof ArtifactNotFoundException)}} which is > deceiving. > Here is a sample for a non-existing artifact: > {noformat} > [INFO] --- maven-site-plugin:4.0.0-M7-SNAPSHOT:site (default-site) @ > mskins-222 --- > [INFO] Configuring report plugin > org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.2 > [WARNING] index report is declared twice in default reportSet > [INFO] 15 reports configured for maven-project-info-reports-plugin:3.4.2: > index, summary, dependency-info, modules, team, scm, issue-management, > mailing-lists, dependency-management, dependencies, dependency-convergence, > ci-management, plugin-management, plugins, distribution-management > [INFO] Rendering site for default locale > Downloading from lda-public: > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 3.214 s > [INFO] Finished at: 2023-04-02T12:51:02+02:00 > [INFO] >
[jira] [Commented] (MNG-7758) o.e.aether.resolution.ArtifactResolutionException incorrectly examined when multiple repositories are involved
[ https://issues.apache.org/jira/browse/MNG-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852664#comment-17852664 ] ASF GitHub Bot commented on MNG-7758: - michael-o commented on code in PR #1563: URL: https://github.com/apache/maven/pull/1563#discussion_r1628924460 ## maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java: ## @@ -160,7 +160,9 @@ public DependencyResolutionResult resolve(DependencyResolutionRequest request) result.setCollectionErrors(e.getResult().getExceptions()); throw new DependencyResolutionException( -result, "Could not resolve dependencies for project " + project.getId() + ": " + e.getMessage(), e); +result, +"Could not collect dependencies for project " + project.getId(), +logger.isDebugEnabled() ? e : null); Review Comment: Why omitting the exception? > o.e.aether.resolution.ArtifactResolutionException incorrectly examined when > multiple repositories are involved > -- > > Key: MNG-7758 > URL: https://issues.apache.org/jira/browse/MNG-7758 > Project: Maven > Issue Type: Bug > Components: Artifacts and Repositories, Dependencies, Performance >Affects Versions: 3.8.8, 3.9.1, 4.0.0-alpha-5 >Reporter: Michael Osipov >Priority: Critical > Fix For: 4.0.x-candidate, 4.0.0 > > Attachments: 1.png, 2.png, Exception hierarchy.png > > > Consider you have three repos defined in your build (could be POM or > settings), evaluated in following order: > 1. repo A: serves custom artifacts with group id {{com.example}}, due to repo > partitioning in Nexus rejects requests to all other group ids with 403 > 1. repo B: serves third party artifacts without any restriction from a Nexus > repo > 1. repo C: serves Central mirror, last one quried, no restrictions > Note that order is important! Now add a non-existing dependency to your POM > and receive the following behavior: > {{ArtifactResolutionException}} will contain an {{ArtifactResult}} with three > exceptions: > - {{TransferException}} with nested {{AuthorizationException}}, > - {{ArtifactNotFoundException}}, > - {{ArtifactNotFoundException}}. > {{ArtifactResolutionException#getCause()}} will be populated with the > {{TransferException}} so will > {{org.eclipse.aether.resolution.ArtifactResult.isMissing()}} take the first > exception only into account. E.g., {{DefaultArtifactDescriptorReader}} will > do {{if (e.getCause() instanceof ArtifactNotFoundException)}} which is > deceiving. > Here is a sample for a non-existing artifact: > {noformat} > [INFO] --- maven-site-plugin:4.0.0-M7-SNAPSHOT:site (default-site) @ > mskins-222 --- > [INFO] Configuring report plugin > org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.2 > [WARNING] index report is declared twice in default reportSet > [INFO] 15 reports configured for maven-project-info-reports-plugin:3.4.2: > index, summary, dependency-info, modules, team, scm, issue-management, > mailing-lists, dependency-management, dependencies, dependency-convergence, > ci-management, plugin-management, plugins, distribution-management > [INFO] Rendering site for default locale > Downloading from lda-public: > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 3.214 s > [INFO] Finished at: 2023-04-02T12:51:02+02:00 > [INFO] > > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222: SiteToolException: The site descriptor > cannot be resolved from the repository: Unable to locate site descriptor: > Could not transfer artifact org.apache:apache:xml:site:29 from/to lda-public > (https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/): > authorization failed for > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml, > status: 403 Forbidden -> [Help 1] > [ERROR] > [ERROR] To see the full stack trace of the errors, re-run Maven with the -e > switch. > [ERROR] Re-run Maven using the -X switch to enable full debug logging. > [ERROR] > [ERROR] For more information about the errors and possible solutions, please > read the following articles: > [ERROR] [Help 1] >
[jira] [Commented] (MPMD-395) Build doesn't fail for invalid CPD format
[ https://issues.apache.org/jira/browse/MPMD-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852656#comment-17852656 ] ASF GitHub Bot commented on MPMD-395: - adangel commented on code in PR #150: URL: https://github.com/apache/maven-pmd-plugin/pull/150#discussion_r1628874773 ## src/main/java/org/apache/maven/plugins/pmd/exec/PmdErrorMessageReporter.java: ## @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.plugins.pmd.exec; + +import java.util.ArrayList; +import java.util.List; + +import net.sourceforge.pmd.util.log.PmdReporter; +import org.apache.maven.reporting.MavenReportException; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.slf4j.event.Level; + +class PmdErrorMessageReporter implements PmdReporter { +private final PmdReporter delegate; +private List errors = new ArrayList<>(); + +PmdErrorMessageReporter(PmdReporter delegate) { +this.delegate = delegate; +} + +@Override +public boolean isLoggable(Level level) { +return delegate.isLoggable(level); +} + +@Override +public void logEx(Level level, @Nullable String message, Object[] formatArgs, @Nullable Throwable error) { +if (error != null) { +if (error instanceof RuntimeException && error.getCause() instanceof MavenReportException) { +errors.add(error.getCause()); +} else { +errors.add(error); +} +} + +delegate.logEx(level, message, formatArgs, error); +} + +@Override +public int numErrors() { +return delegate.numErrors(); +} + +public void rethrowErrorsAsMavenReportException() throws MavenReportException { +if (errors.isEmpty()) { +return; +} + +final MavenReportException exception; + +Throwable firstError = errors.get(0); Review Comment: Multiple exception can potentially occur. E.g. if someone tries to run CPD on java files, that don't compile and are not valid java source - each file would produce an exception. And right, as I delegate it to the original PmdReporter, it will have been logged (through slf4j) already, when we rethrow the exception(s). The whole goal of this exercise is, that the build fails, when some exceptions occurred, that potentially mean, that not all files have been analyzed. Who reads the logs, if in the end it says "BUILD SUCCESS"? When this plugin was created, it never failed when there was any problem while executing PMD - some files where then just silently not analyzed. For the pmd:pmd goal, the parameter "skipPmdError" was introduced with the sake for compatibility defaulting to the old behavior (just ignoring any errors). The cpd:cpd goal doesn't have such an option and I don't know how this behaved earlier. But if any errors occur during analysis, IMHO the build must fail. > Build doesn't fail for invalid CPD format > - > > Key: MPMD-395 > URL: https://issues.apache.org/jira/browse/MPMD-395 > Project: Maven PMD Plugin > Issue Type: Bug > Components: CPD >Affects Versions: 3.22.0 >Reporter: Andreas Dangel >Assignee: Andreas Dangel >Priority: Major > Fix For: next-version > > > See > [https://github.com/apache/maven-pmd-plugin/pull/144#issuecomment-2094371392] > > If an exception occurs while the CPD report is created, the exception is only > logged but doesn't fail the build. This means, that build appears to be > successful, although it didn't produce all expected build artifacts. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MPMD-395) Build doesn't fail for invalid CPD format
[ https://issues.apache.org/jira/browse/MPMD-395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852657#comment-17852657 ] ASF GitHub Bot commented on MPMD-395: - adangel commented on code in PR #150: URL: https://github.com/apache/maven-pmd-plugin/pull/150#discussion_r1628875525 ## src/main/java/org/apache/maven/plugins/pmd/exec/PmdErrorMessageReporter.java: ## @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.plugins.pmd.exec; + +import java.util.ArrayList; +import java.util.List; + +import net.sourceforge.pmd.util.log.PmdReporter; +import org.apache.maven.reporting.MavenReportException; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.slf4j.event.Level; + +class PmdErrorMessageReporter implements PmdReporter { +private final PmdReporter delegate; +private List errors = new ArrayList<>(); + +PmdErrorMessageReporter(PmdReporter delegate) { +this.delegate = delegate; +} + +@Override +public boolean isLoggable(Level level) { +return delegate.isLoggable(level); +} + +@Override +public void logEx(Level level, @Nullable String message, Object[] formatArgs, @Nullable Throwable error) { Review Comment: That can't be changed here, as that's an interface method to be implemented. > Build doesn't fail for invalid CPD format > - > > Key: MPMD-395 > URL: https://issues.apache.org/jira/browse/MPMD-395 > Project: Maven PMD Plugin > Issue Type: Bug > Components: CPD >Affects Versions: 3.22.0 >Reporter: Andreas Dangel >Assignee: Andreas Dangel >Priority: Major > Fix For: next-version > > > See > [https://github.com/apache/maven-pmd-plugin/pull/144#issuecomment-2094371392] > > If an exception occurs while the CPD report is created, the exception is only > logged but doesn't fail the build. This means, that build appears to be > successful, although it didn't produce all expected build artifacts. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-7758) o.e.aether.resolution.ArtifactResolutionException incorrectly examined when multiple repositories are involved
[ https://issues.apache.org/jira/browse/MNG-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852644#comment-17852644 ] ASF GitHub Bot commented on MNG-7758: - slawekjaranowski commented on PR #1563: URL: https://github.com/apache/maven/pull/1563#issuecomment-2151489028 I also would like to cherry pick it to 3.9.x > o.e.aether.resolution.ArtifactResolutionException incorrectly examined when > multiple repositories are involved > -- > > Key: MNG-7758 > URL: https://issues.apache.org/jira/browse/MNG-7758 > Project: Maven > Issue Type: Bug > Components: Artifacts and Repositories, Dependencies, Performance >Affects Versions: 3.8.8, 3.9.1, 4.0.0-alpha-5 >Reporter: Michael Osipov >Priority: Critical > Fix For: 4.0.x-candidate, 4.0.0 > > Attachments: 1.png, 2.png, Exception hierarchy.png > > > Consider you have three repos defined in your build (could be POM or > settings), evaluated in following order: > 1. repo A: serves custom artifacts with group id {{com.example}}, due to repo > partitioning in Nexus rejects requests to all other group ids with 403 > 1. repo B: serves third party artifacts without any restriction from a Nexus > repo > 1. repo C: serves Central mirror, last one quried, no restrictions > Note that order is important! Now add a non-existing dependency to your POM > and receive the following behavior: > {{ArtifactResolutionException}} will contain an {{ArtifactResult}} with three > exceptions: > - {{TransferException}} with nested {{AuthorizationException}}, > - {{ArtifactNotFoundException}}, > - {{ArtifactNotFoundException}}. > {{ArtifactResolutionException#getCause()}} will be populated with the > {{TransferException}} so will > {{org.eclipse.aether.resolution.ArtifactResult.isMissing()}} take the first > exception only into account. E.g., {{DefaultArtifactDescriptorReader}} will > do {{if (e.getCause() instanceof ArtifactNotFoundException)}} which is > deceiving. > Here is a sample for a non-existing artifact: > {noformat} > [INFO] --- maven-site-plugin:4.0.0-M7-SNAPSHOT:site (default-site) @ > mskins-222 --- > [INFO] Configuring report plugin > org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.2 > [WARNING] index report is declared twice in default reportSet > [INFO] 15 reports configured for maven-project-info-reports-plugin:3.4.2: > index, summary, dependency-info, modules, team, scm, issue-management, > mailing-lists, dependency-management, dependencies, dependency-convergence, > ci-management, plugin-management, plugins, distribution-management > [INFO] Rendering site for default locale > Downloading from lda-public: > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 3.214 s > [INFO] Finished at: 2023-04-02T12:51:02+02:00 > [INFO] > > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222: SiteToolException: The site descriptor > cannot be resolved from the repository: Unable to locate site descriptor: > Could not transfer artifact org.apache:apache:xml:site:29 from/to lda-public > (https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/): > authorization failed for > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml, > status: 403 Forbidden -> [Help 1] > [ERROR] > [ERROR] To see the full stack trace of the errors, re-run Maven with the -e > switch. > [ERROR] Re-run Maven using the -X switch to enable full debug logging. > [ERROR] > [ERROR] For more information about the errors and possible solutions, please > read the following articles: > [ERROR] [Help 1] > http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException > {noformat} > for a dependency: > {noformat} > [INFO] org.apache.maven.cli.event.ExecutionEventLogger - > > [ERROR] org.apache.maven.cli.MavenCli - Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222: Failed to get report for > org.apache.maven.plugins:maven-project-plugin: Plugin > org.apache.maven.plugins:maven-project-plugin:3.4.2 or one of its > dependencies could not be resolved: Failed to read artifact descriptor for >
[jira] [Commented] (MNG-7758) o.e.aether.resolution.ArtifactResolutionException incorrectly examined when multiple repositories are involved
[ https://issues.apache.org/jira/browse/MNG-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852588#comment-17852588 ] ASF GitHub Bot commented on MNG-7758: - slawekjaranowski commented on PR #1563: URL: https://github.com/apache/maven/pull/1563#issuecomment-2151005203 IT `MavenITmng3477DependencyResolutionErrorMessageTest` to fix > o.e.aether.resolution.ArtifactResolutionException incorrectly examined when > multiple repositories are involved > -- > > Key: MNG-7758 > URL: https://issues.apache.org/jira/browse/MNG-7758 > Project: Maven > Issue Type: Bug > Components: Artifacts and Repositories, Dependencies, Performance >Affects Versions: 3.8.8, 3.9.1, 4.0.0-alpha-5 >Reporter: Michael Osipov >Priority: Critical > Fix For: 4.0.x-candidate, 4.0.0 > > Attachments: 1.png, 2.png, Exception hierarchy.png > > > Consider you have three repos defined in your build (could be POM or > settings), evaluated in following order: > 1. repo A: serves custom artifacts with group id {{com.example}}, due to repo > partitioning in Nexus rejects requests to all other group ids with 403 > 1. repo B: serves third party artifacts without any restriction from a Nexus > repo > 1. repo C: serves Central mirror, last one quried, no restrictions > Note that order is important! Now add a non-existing dependency to your POM > and receive the following behavior: > {{ArtifactResolutionException}} will contain an {{ArtifactResult}} with three > exceptions: > - {{TransferException}} with nested {{AuthorizationException}}, > - {{ArtifactNotFoundException}}, > - {{ArtifactNotFoundException}}. > {{ArtifactResolutionException#getCause()}} will be populated with the > {{TransferException}} so will > {{org.eclipse.aether.resolution.ArtifactResult.isMissing()}} take the first > exception only into account. E.g., {{DefaultArtifactDescriptorReader}} will > do {{if (e.getCause() instanceof ArtifactNotFoundException)}} which is > deceiving. > Here is a sample for a non-existing artifact: > {noformat} > [INFO] --- maven-site-plugin:4.0.0-M7-SNAPSHOT:site (default-site) @ > mskins-222 --- > [INFO] Configuring report plugin > org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.2 > [WARNING] index report is declared twice in default reportSet > [INFO] 15 reports configured for maven-project-info-reports-plugin:3.4.2: > index, summary, dependency-info, modules, team, scm, issue-management, > mailing-lists, dependency-management, dependencies, dependency-convergence, > ci-management, plugin-management, plugins, distribution-management > [INFO] Rendering site for default locale > Downloading from lda-public: > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 3.214 s > [INFO] Finished at: 2023-04-02T12:51:02+02:00 > [INFO] > > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222: SiteToolException: The site descriptor > cannot be resolved from the repository: Unable to locate site descriptor: > Could not transfer artifact org.apache:apache:xml:site:29 from/to lda-public > (https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/): > authorization failed for > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml, > status: 403 Forbidden -> [Help 1] > [ERROR] > [ERROR] To see the full stack trace of the errors, re-run Maven with the -e > switch. > [ERROR] Re-run Maven using the -X switch to enable full debug logging. > [ERROR] > [ERROR] For more information about the errors and possible solutions, please > read the following articles: > [ERROR] [Help 1] > http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException > {noformat} > for a dependency: > {noformat} > [INFO] org.apache.maven.cli.event.ExecutionEventLogger - > > [ERROR] org.apache.maven.cli.MavenCli - Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222: Failed to get report for > org.apache.maven.plugins:maven-project-plugin: Plugin > org.apache.maven.plugins:maven-project-plugin:3.4.2 or one of its > dependencies could not be resolved: Failed to read artifact descriptor for >
[jira] [Commented] (MNG-7758) o.e.aether.resolution.ArtifactResolutionException incorrectly examined when multiple repositories are involved
[ https://issues.apache.org/jira/browse/MNG-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852587#comment-17852587 ] ASF GitHub Bot commented on MNG-7758: - slawekjaranowski commented on PR #1563: URL: https://github.com/apache/maven/pull/1563#issuecomment-2151002683 Now looks: ``` [ERROR] Failed to execute goal on project test-artifact: Could not resolve dependencies for project test-group:test-artifact:jar:1: The following artifacts could not be resolved: org.apache.test:test1:jar:1.0 (absent), org.apache.test:test2:jar:1.0 (absent): Could not find artifact org.apache.test:test1:jar:1.0 in repo.apache-stage (https://repository.apache.org/content/groups/staging/) -> [Help 1] ``` ``` [ERROR] Failed to execute goal on project test-artifact: Could not resolve dependencies for project test-group:test-artifact:jar:1: The following artifacts could not be resolved: org.apache.test:test1:jar:1.0 (absent), org.apache.test:test2:jar:1.0 (absent): Could not find artifact org.apache.test:test1:jar:1.0 in payu (https://artifactory.office/artifactory/group-payu/) -> [Help 1] ``` only problem with last repository is reported - everything in one line ... > o.e.aether.resolution.ArtifactResolutionException incorrectly examined when > multiple repositories are involved > -- > > Key: MNG-7758 > URL: https://issues.apache.org/jira/browse/MNG-7758 > Project: Maven > Issue Type: Bug > Components: Artifacts and Repositories, Dependencies, Performance >Affects Versions: 3.8.8, 3.9.1, 4.0.0-alpha-5 >Reporter: Michael Osipov >Priority: Critical > Fix For: 4.0.x-candidate, 4.0.0 > > Attachments: 1.png, 2.png, Exception hierarchy.png > > > Consider you have three repos defined in your build (could be POM or > settings), evaluated in following order: > 1. repo A: serves custom artifacts with group id {{com.example}}, due to repo > partitioning in Nexus rejects requests to all other group ids with 403 > 1. repo B: serves third party artifacts without any restriction from a Nexus > repo > 1. repo C: serves Central mirror, last one quried, no restrictions > Note that order is important! Now add a non-existing dependency to your POM > and receive the following behavior: > {{ArtifactResolutionException}} will contain an {{ArtifactResult}} with three > exceptions: > - {{TransferException}} with nested {{AuthorizationException}}, > - {{ArtifactNotFoundException}}, > - {{ArtifactNotFoundException}}. > {{ArtifactResolutionException#getCause()}} will be populated with the > {{TransferException}} so will > {{org.eclipse.aether.resolution.ArtifactResult.isMissing()}} take the first > exception only into account. E.g., {{DefaultArtifactDescriptorReader}} will > do {{if (e.getCause() instanceof ArtifactNotFoundException)}} which is > deceiving. > Here is a sample for a non-existing artifact: > {noformat} > [INFO] --- maven-site-plugin:4.0.0-M7-SNAPSHOT:site (default-site) @ > mskins-222 --- > [INFO] Configuring report plugin > org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.2 > [WARNING] index report is declared twice in default reportSet > [INFO] 15 reports configured for maven-project-info-reports-plugin:3.4.2: > index, summary, dependency-info, modules, team, scm, issue-management, > mailing-lists, dependency-management, dependencies, dependency-convergence, > ci-management, plugin-management, plugins, distribution-management > [INFO] Rendering site for default locale > Downloading from lda-public: > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 3.214 s > [INFO] Finished at: 2023-04-02T12:51:02+02:00 > [INFO] > > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222: SiteToolException: The site descriptor > cannot be resolved from the repository: Unable to locate site descriptor: > Could not transfer artifact org.apache:apache:xml:site:29 from/to lda-public > (https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/): > authorization failed for > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml, > status: 403 Forbidden -> [Help 1] > [ERROR] > [ERROR] To see the full stack trace of the errors, re-run Maven with the -e > switch. > [ERROR] Re-run Maven
[jira] [Commented] (MNG-7758) o.e.aether.resolution.ArtifactResolutionException incorrectly examined when multiple repositories are involved
[ https://issues.apache.org/jira/browse/MNG-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852580#comment-17852580 ] ASF GitHub Bot commented on MNG-7758: - michael-o commented on PR #1563: URL: https://github.com/apache/maven/pull/1563#issuecomment-2150971215 How does it look now? > o.e.aether.resolution.ArtifactResolutionException incorrectly examined when > multiple repositories are involved > -- > > Key: MNG-7758 > URL: https://issues.apache.org/jira/browse/MNG-7758 > Project: Maven > Issue Type: Bug > Components: Artifacts and Repositories, Dependencies, Performance >Affects Versions: 3.8.8, 3.9.1, 4.0.0-alpha-5 >Reporter: Michael Osipov >Priority: Critical > Fix For: 4.0.x-candidate, 4.0.0 > > Attachments: 1.png, 2.png, Exception hierarchy.png > > > Consider you have three repos defined in your build (could be POM or > settings), evaluated in following order: > 1. repo A: serves custom artifacts with group id {{com.example}}, due to repo > partitioning in Nexus rejects requests to all other group ids with 403 > 1. repo B: serves third party artifacts without any restriction from a Nexus > repo > 1. repo C: serves Central mirror, last one quried, no restrictions > Note that order is important! Now add a non-existing dependency to your POM > and receive the following behavior: > {{ArtifactResolutionException}} will contain an {{ArtifactResult}} with three > exceptions: > - {{TransferException}} with nested {{AuthorizationException}}, > - {{ArtifactNotFoundException}}, > - {{ArtifactNotFoundException}}. > {{ArtifactResolutionException#getCause()}} will be populated with the > {{TransferException}} so will > {{org.eclipse.aether.resolution.ArtifactResult.isMissing()}} take the first > exception only into account. E.g., {{DefaultArtifactDescriptorReader}} will > do {{if (e.getCause() instanceof ArtifactNotFoundException)}} which is > deceiving. > Here is a sample for a non-existing artifact: > {noformat} > [INFO] --- maven-site-plugin:4.0.0-M7-SNAPSHOT:site (default-site) @ > mskins-222 --- > [INFO] Configuring report plugin > org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.2 > [WARNING] index report is declared twice in default reportSet > [INFO] 15 reports configured for maven-project-info-reports-plugin:3.4.2: > index, summary, dependency-info, modules, team, scm, issue-management, > mailing-lists, dependency-management, dependencies, dependency-convergence, > ci-management, plugin-management, plugins, distribution-management > [INFO] Rendering site for default locale > Downloading from lda-public: > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 3.214 s > [INFO] Finished at: 2023-04-02T12:51:02+02:00 > [INFO] > > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222: SiteToolException: The site descriptor > cannot be resolved from the repository: Unable to locate site descriptor: > Could not transfer artifact org.apache:apache:xml:site:29 from/to lda-public > (https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/): > authorization failed for > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml, > status: 403 Forbidden -> [Help 1] > [ERROR] > [ERROR] To see the full stack trace of the errors, re-run Maven with the -e > switch. > [ERROR] Re-run Maven using the -X switch to enable full debug logging. > [ERROR] > [ERROR] For more information about the errors and possible solutions, please > read the following articles: > [ERROR] [Help 1] > http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException > {noformat} > for a dependency: > {noformat} > [INFO] org.apache.maven.cli.event.ExecutionEventLogger - > > [ERROR] org.apache.maven.cli.MavenCli - Failed to execute goal > org.apache.maven.plugins:maven-site-plugin:4.0.0-M7-SNAPSHOT:site > (default-site) on project mskins-222: Failed to get report for > org.apache.maven.plugins:maven-project-plugin: Plugin > org.apache.maven.plugins:maven-project-plugin:3.4.2 or one of its > dependencies could not be resolved: Failed to read artifact descriptor for > org.apache.maven.plugins:maven-project-plugin:jar:3.4.2: Could not
[jira] [Commented] (MDEP-900) dependency:resolve fails for multi-module project
[ https://issues.apache.org/jira/browse/MDEP-900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852579#comment-17852579 ] ASF GitHub Bot commented on MDEP-900: - michael-o commented on PR #406: URL: https://github.com/apache/maven-dependency-plugin/pull/406#issuecomment-2150966364 I have the reason and the reason is valid and I believe that 0bb4c5917222c4f4a6df53bbc70dd770507a3d4d must be reverted. The goal is called `resolve`, the other one should have been called `resolve-sources`. The source code clearly says: ``` // dependencies:collect won't download jars if (artifact.getFile() != null) { ModuleDescriptor moduleDescriptor = getModuleDescriptor(artifact.getFile()); if (moduleDescriptor != null) { messageBuilder.project(" > dependency:resolve fails for multi-module project > - > > Key: MDEP-900 > URL: https://issues.apache.org/jira/browse/MDEP-900 > Project: Maven Dependency Plugin > Issue Type: Bug > Components: resolve >Affects Versions: 3.6.1 >Reporter: Gerd Aschemann >Assignee: Slawomir Jaranowski >Priority: Critical > Fix For: 3.7.0 > > > When executing {{mvn dependency:resolve}} on a multi-module project it fails > to retrieve artifacts for the modules themselves (which is not necessary as > these can be installed by {{mvn install}} any time). > This can be seen on an [OSS multi-module > project|https://github.com/WASdev/sample.daytrader7]: > {code:java} > mvn dependency:resolve > [INFO] Scanning for projects... > [INFO] > > [INFO] Reactor Build Order: > [INFO] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EJB Module > [jar] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - Web Module > [war] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample > [pom] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EAR > [ear] > [INFO] > [INFO] --< net.wasdev.wlp.sample:daytrader-ee7-ejb > >--- > [INFO] Building WAS Liberty Sample - Java EE7 Benchmark Sample - EJB Module > 1.0-SNAPSHOT [1/4] > [INFO] from daytrader-ee7-ejb/pom.xml > [INFO] [ jar > ]- > [INFO] > [INFO] --- dependency:3.6.0:resolve (default-cli) @ daytrader-ee7-ejb --- > [INFO] > [INFO] The following files have been resolved: > [INFO] javax:javaee-api:jar:7.0:provided -- module javaee.api (auto) > [INFO] com.sun.mail:javax.mail:jar:1.5.0:provided -- module javax.mail > (auto) > [INFO] javax.activation:activation:jar:1.1:provided -- module activation > (auto) > [INFO] javax.annotation:javax.annotation-api:jar:1.3.2:provided -- module > java.annotation [auto] > [INFO] > [INFO] > [INFO] --< net.wasdev.wlp.sample:daytrader-ee7-web > >--- > [INFO] Building WAS Liberty Sample - Java EE7 Benchmark Sample - Web Module > 1.0-SNAPSHOT [2/4] > [INFO] from daytrader-ee7-web/pom.xml > [INFO] [ war > ]- > [INFO] > > [INFO] Reactor Summary for WAS Liberty Sample - Java EE7 Benchmark Sample > 1.0-SNAPSHOT: > [INFO] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EJB Module SUCCESS [ > 0.402 s] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - Web Module FAILURE [ > 0.012 s] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample . SKIPPED > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EAR SKIPPED > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 0.552 s > [INFO] Finished at: 2023-11-14T12:37:02+01:00 > [INFO] > > [ERROR] Failed to execute goal on project daytrader-ee7-web: Could not > resolve dependencies for project > net.wasdev.wlp.sample:daytrader-ee7-web:war:1.0-SNAPSHOT: The following > artifacts could not be resolved: > net.wasdev.wlp.sample:daytrader-ee7-ejb:jar:1.0-SNAPSHOT (absent): Could not > find artifact net.wasdev.wlp.sample:daytrader-ee7-ejb:jar:1.0-SNAPSHOT -> > [Help 1]{code} > This is similar to the behaviour of MDEP-409, and MDEP-895 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-7758) o.e.aether.resolution.ArtifactResolutionException incorrectly examined when multiple repositories are involved
[ https://issues.apache.org/jira/browse/MNG-7758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852577#comment-17852577 ] ASF GitHub Bot commented on MNG-7758: - slawekjaranowski opened a new pull request, #1563: URL: https://github.com/apache/maven/pull/1563 The build result will be as: ``` [ERROR] Failed to execute goal on project test-artifact: Could not resolve dependencies for project test-group:test-artifact:jar:1 [ERROR] dependency: org.apache.test:test1:jar:1.0 (compile) [ERROR] Could not find artifact org.apache.test:test1:jar:1.0 in central (https://repo.maven.apache.org/maven2) [ERROR] Could not find artifact org.apache.test:test1:jar:1.0 in repo.apache-stage (https://repository.apache.org/content/groups/staging/) [ERROR] dependency: org.apache.test:test2:jar:1.0 (compile) [ERROR] Could not find artifact org.apache.test:test2:jar:1.0 in central (https://repo.maven.apache.org/maven2) [ERROR] Could not find artifact org.apache.test:test2:jar:1.0 in repo.apache-stage (https://repository.apache.org/content/groups/staging/) ``` ``` [ERROR] Failed to execute goal on project test-artifact: Could not resolve dependencies for project test-group:test-artifact:jar:1 [ERROR] dependency: org.apache.test:test1:jar:1.0 (compile) [ERROR] Prefix org/apache/test NOT allowed from mirror (https://artifactory.office.../artifactory/remote-repos/, default, releases) [ERROR] Could not find artifact org.apache.test:test1:jar:1.0 in payu (https://artifactory.office.../artifactory/group-payu/) [ERROR] dependency: org.apache.test:test2:jar:1.0 (compile) [ERROR] Prefix org/apache/test NOT allowed from mirror (https://artifactory.office.../artifactory/remote-repos/, default, releases) [ERROR] Could not find artifact org.apache.test:test2:jar:1.0 in payu (https://artifactory.office/artifactory/group-payu/) ``` > o.e.aether.resolution.ArtifactResolutionException incorrectly examined when > multiple repositories are involved > -- > > Key: MNG-7758 > URL: https://issues.apache.org/jira/browse/MNG-7758 > Project: Maven > Issue Type: Bug > Components: Artifacts and Repositories, Dependencies, Performance >Affects Versions: 3.8.8, 3.9.1, 4.0.0-alpha-5 >Reporter: Michael Osipov >Priority: Critical > Fix For: 4.0.x-candidate, 4.0.0 > > Attachments: 1.png, 2.png, Exception hierarchy.png > > > Consider you have three repos defined in your build (could be POM or > settings), evaluated in following order: > 1. repo A: serves custom artifacts with group id {{com.example}}, due to repo > partitioning in Nexus rejects requests to all other group ids with 403 > 1. repo B: serves third party artifacts without any restriction from a Nexus > repo > 1. repo C: serves Central mirror, last one quried, no restrictions > Note that order is important! Now add a non-existing dependency to your POM > and receive the following behavior: > {{ArtifactResolutionException}} will contain an {{ArtifactResult}} with three > exceptions: > - {{TransferException}} with nested {{AuthorizationException}}, > - {{ArtifactNotFoundException}}, > - {{ArtifactNotFoundException}}. > {{ArtifactResolutionException#getCause()}} will be populated with the > {{TransferException}} so will > {{org.eclipse.aether.resolution.ArtifactResult.isMissing()}} take the first > exception only into account. E.g., {{DefaultArtifactDescriptorReader}} will > do {{if (e.getCause() instanceof ArtifactNotFoundException)}} which is > deceiving. > Here is a sample for a non-existing artifact: > {noformat} > [INFO] --- maven-site-plugin:4.0.0-M7-SNAPSHOT:site (default-site) @ > mskins-222 --- > [INFO] Configuring report plugin > org.apache.maven.plugins:maven-project-info-reports-plugin:3.4.2 > [WARNING] index report is declared twice in default reportSet > [INFO] 15 reports configured for maven-project-info-reports-plugin:3.4.2: > index, summary, dependency-info, modules, team, scm, issue-management, > mailing-lists, dependency-management, dependencies, dependency-convergence, > ci-management, plugin-management, plugins, distribution-management > [INFO] Rendering site for default locale > Downloading from lda-public: > https://deblndw011x.ad001.siemens.net/nexus/content/groups/lda-public/org/apache/apache/29/apache-29-site.xml > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 3.214 s > [INFO] Finished at: 2023-04-02T12:51:02+02:00 > [INFO] >
[jira] [Commented] (MDEP-900) dependency:resolve fails for multi-module project
[ https://issues.apache.org/jira/browse/MDEP-900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852576#comment-17852576 ] ASF GitHub Bot commented on MDEP-900: - michael-o commented on PR #406: URL: https://github.com/apache/maven-dependency-plugin/pull/406#issuecomment-2150942293 > ups existing tests failed ... I am running locally, will report... > dependency:resolve fails for multi-module project > - > > Key: MDEP-900 > URL: https://issues.apache.org/jira/browse/MDEP-900 > Project: Maven Dependency Plugin > Issue Type: Bug > Components: resolve >Affects Versions: 3.6.1 >Reporter: Gerd Aschemann >Assignee: Slawomir Jaranowski >Priority: Critical > Fix For: 3.7.0 > > > When executing {{mvn dependency:resolve}} on a multi-module project it fails > to retrieve artifacts for the modules themselves (which is not necessary as > these can be installed by {{mvn install}} any time). > This can be seen on an [OSS multi-module > project|https://github.com/WASdev/sample.daytrader7]: > {code:java} > mvn dependency:resolve > [INFO] Scanning for projects... > [INFO] > > [INFO] Reactor Build Order: > [INFO] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EJB Module > [jar] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - Web Module > [war] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample > [pom] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EAR > [ear] > [INFO] > [INFO] --< net.wasdev.wlp.sample:daytrader-ee7-ejb > >--- > [INFO] Building WAS Liberty Sample - Java EE7 Benchmark Sample - EJB Module > 1.0-SNAPSHOT [1/4] > [INFO] from daytrader-ee7-ejb/pom.xml > [INFO] [ jar > ]- > [INFO] > [INFO] --- dependency:3.6.0:resolve (default-cli) @ daytrader-ee7-ejb --- > [INFO] > [INFO] The following files have been resolved: > [INFO] javax:javaee-api:jar:7.0:provided -- module javaee.api (auto) > [INFO] com.sun.mail:javax.mail:jar:1.5.0:provided -- module javax.mail > (auto) > [INFO] javax.activation:activation:jar:1.1:provided -- module activation > (auto) > [INFO] javax.annotation:javax.annotation-api:jar:1.3.2:provided -- module > java.annotation [auto] > [INFO] > [INFO] > [INFO] --< net.wasdev.wlp.sample:daytrader-ee7-web > >--- > [INFO] Building WAS Liberty Sample - Java EE7 Benchmark Sample - Web Module > 1.0-SNAPSHOT [2/4] > [INFO] from daytrader-ee7-web/pom.xml > [INFO] [ war > ]- > [INFO] > > [INFO] Reactor Summary for WAS Liberty Sample - Java EE7 Benchmark Sample > 1.0-SNAPSHOT: > [INFO] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EJB Module SUCCESS [ > 0.402 s] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - Web Module FAILURE [ > 0.012 s] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample . SKIPPED > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EAR SKIPPED > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 0.552 s > [INFO] Finished at: 2023-11-14T12:37:02+01:00 > [INFO] > > [ERROR] Failed to execute goal on project daytrader-ee7-web: Could not > resolve dependencies for project > net.wasdev.wlp.sample:daytrader-ee7-web:war:1.0-SNAPSHOT: The following > artifacts could not be resolved: > net.wasdev.wlp.sample:daytrader-ee7-ejb:jar:1.0-SNAPSHOT (absent): Could not > find artifact net.wasdev.wlp.sample:daytrader-ee7-ejb:jar:1.0-SNAPSHOT -> > [Help 1]{code} > This is similar to the behaviour of MDEP-409, and MDEP-895 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MDEP-900) dependency:resolve fails for multi-module project
[ https://issues.apache.org/jira/browse/MDEP-900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852575#comment-17852575 ] ASF GitHub Bot commented on MDEP-900: - slawekjaranowski commented on PR #406: URL: https://github.com/apache/maven-dependency-plugin/pull/406#issuecomment-2150939535 ups existing tests failed ... > dependency:resolve fails for multi-module project > - > > Key: MDEP-900 > URL: https://issues.apache.org/jira/browse/MDEP-900 > Project: Maven Dependency Plugin > Issue Type: Bug > Components: resolve >Affects Versions: 3.6.1 >Reporter: Gerd Aschemann >Assignee: Slawomir Jaranowski >Priority: Critical > Fix For: 3.7.0 > > > When executing {{mvn dependency:resolve}} on a multi-module project it fails > to retrieve artifacts for the modules themselves (which is not necessary as > these can be installed by {{mvn install}} any time). > This can be seen on an [OSS multi-module > project|https://github.com/WASdev/sample.daytrader7]: > {code:java} > mvn dependency:resolve > [INFO] Scanning for projects... > [INFO] > > [INFO] Reactor Build Order: > [INFO] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EJB Module > [jar] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - Web Module > [war] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample > [pom] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EAR > [ear] > [INFO] > [INFO] --< net.wasdev.wlp.sample:daytrader-ee7-ejb > >--- > [INFO] Building WAS Liberty Sample - Java EE7 Benchmark Sample - EJB Module > 1.0-SNAPSHOT [1/4] > [INFO] from daytrader-ee7-ejb/pom.xml > [INFO] [ jar > ]- > [INFO] > [INFO] --- dependency:3.6.0:resolve (default-cli) @ daytrader-ee7-ejb --- > [INFO] > [INFO] The following files have been resolved: > [INFO] javax:javaee-api:jar:7.0:provided -- module javaee.api (auto) > [INFO] com.sun.mail:javax.mail:jar:1.5.0:provided -- module javax.mail > (auto) > [INFO] javax.activation:activation:jar:1.1:provided -- module activation > (auto) > [INFO] javax.annotation:javax.annotation-api:jar:1.3.2:provided -- module > java.annotation [auto] > [INFO] > [INFO] > [INFO] --< net.wasdev.wlp.sample:daytrader-ee7-web > >--- > [INFO] Building WAS Liberty Sample - Java EE7 Benchmark Sample - Web Module > 1.0-SNAPSHOT [2/4] > [INFO] from daytrader-ee7-web/pom.xml > [INFO] [ war > ]- > [INFO] > > [INFO] Reactor Summary for WAS Liberty Sample - Java EE7 Benchmark Sample > 1.0-SNAPSHOT: > [INFO] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EJB Module SUCCESS [ > 0.402 s] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - Web Module FAILURE [ > 0.012 s] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample . SKIPPED > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EAR SKIPPED > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 0.552 s > [INFO] Finished at: 2023-11-14T12:37:02+01:00 > [INFO] > > [ERROR] Failed to execute goal on project daytrader-ee7-web: Could not > resolve dependencies for project > net.wasdev.wlp.sample:daytrader-ee7-web:war:1.0-SNAPSHOT: The following > artifacts could not be resolved: > net.wasdev.wlp.sample:daytrader-ee7-ejb:jar:1.0-SNAPSHOT (absent): Could not > find artifact net.wasdev.wlp.sample:daytrader-ee7-ejb:jar:1.0-SNAPSHOT -> > [Help 1]{code} > This is similar to the behaviour of MDEP-409, and MDEP-895 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MDEP-900) dependency:resolve fails for multi-module project
[ https://issues.apache.org/jira/browse/MDEP-900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852569#comment-17852569 ] ASF GitHub Bot commented on MDEP-900: - michael-o commented on PR #406: URL: https://github.com/apache/maven-dependency-plugin/pull/406#issuecomment-2150923370 @slawekjaranowski Can we use the IT from https://github.com/apache/maven-dependency-plugin/pull/349? > dependency:resolve fails for multi-module project > - > > Key: MDEP-900 > URL: https://issues.apache.org/jira/browse/MDEP-900 > Project: Maven Dependency Plugin > Issue Type: Bug > Components: resolve >Affects Versions: 3.6.1 >Reporter: Gerd Aschemann >Assignee: Slawomir Jaranowski >Priority: Critical > Fix For: 3.7.0 > > > When executing {{mvn dependency:resolve}} on a multi-module project it fails > to retrieve artifacts for the modules themselves (which is not necessary as > these can be installed by {{mvn install}} any time). > This can be seen on an [OSS multi-module > project|https://github.com/WASdev/sample.daytrader7]: > {code:java} > mvn dependency:resolve > [INFO] Scanning for projects... > [INFO] > > [INFO] Reactor Build Order: > [INFO] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EJB Module > [jar] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - Web Module > [war] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample > [pom] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EAR > [ear] > [INFO] > [INFO] --< net.wasdev.wlp.sample:daytrader-ee7-ejb > >--- > [INFO] Building WAS Liberty Sample - Java EE7 Benchmark Sample - EJB Module > 1.0-SNAPSHOT [1/4] > [INFO] from daytrader-ee7-ejb/pom.xml > [INFO] [ jar > ]- > [INFO] > [INFO] --- dependency:3.6.0:resolve (default-cli) @ daytrader-ee7-ejb --- > [INFO] > [INFO] The following files have been resolved: > [INFO] javax:javaee-api:jar:7.0:provided -- module javaee.api (auto) > [INFO] com.sun.mail:javax.mail:jar:1.5.0:provided -- module javax.mail > (auto) > [INFO] javax.activation:activation:jar:1.1:provided -- module activation > (auto) > [INFO] javax.annotation:javax.annotation-api:jar:1.3.2:provided -- module > java.annotation [auto] > [INFO] > [INFO] > [INFO] --< net.wasdev.wlp.sample:daytrader-ee7-web > >--- > [INFO] Building WAS Liberty Sample - Java EE7 Benchmark Sample - Web Module > 1.0-SNAPSHOT [2/4] > [INFO] from daytrader-ee7-web/pom.xml > [INFO] [ war > ]- > [INFO] > > [INFO] Reactor Summary for WAS Liberty Sample - Java EE7 Benchmark Sample > 1.0-SNAPSHOT: > [INFO] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EJB Module SUCCESS [ > 0.402 s] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - Web Module FAILURE [ > 0.012 s] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample . SKIPPED > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EAR SKIPPED > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 0.552 s > [INFO] Finished at: 2023-11-14T12:37:02+01:00 > [INFO] > > [ERROR] Failed to execute goal on project daytrader-ee7-web: Could not > resolve dependencies for project > net.wasdev.wlp.sample:daytrader-ee7-web:war:1.0-SNAPSHOT: The following > artifacts could not be resolved: > net.wasdev.wlp.sample:daytrader-ee7-ejb:jar:1.0-SNAPSHOT (absent): Could not > find artifact net.wasdev.wlp.sample:daytrader-ee7-ejb:jar:1.0-SNAPSHOT -> > [Help 1]{code} > This is similar to the behaviour of MDEP-409, and MDEP-895 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MDEP-900) dependency:resolve fails for multi-module project
[ https://issues.apache.org/jira/browse/MDEP-900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852567#comment-17852567 ] ASF GitHub Bot commented on MDEP-900: - michael-o opened a new pull request, #406: URL: https://github.com/apache/maven-dependency-plugin/pull/406 Following this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MDEP) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[MDEP-XXX] - Fixes bug in ApproximateQuantiles`, where you replace `MDEP-XXX` with the appropriate JIRA issue. Best practice is to use the JIRA issue title in the pull request title and in the first line of the commit message. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] You have run the integration tests successfully (`mvn -Prun-its clean verify`). If your pull request is about ~20 lines of code you don't need to sign an [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure please ask on the developers list. To make clear that you license your contribution under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) you have to acknowledge this by using the following check-box. - [ ] I hereby declare this contribution to be licensed under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). > dependency:resolve fails for multi-module project > - > > Key: MDEP-900 > URL: https://issues.apache.org/jira/browse/MDEP-900 > Project: Maven Dependency Plugin > Issue Type: Bug > Components: resolve >Affects Versions: 3.6.1 >Reporter: Gerd Aschemann >Assignee: Slawomir Jaranowski >Priority: Critical > Fix For: 3.7.0 > > > When executing {{mvn dependency:resolve}} on a multi-module project it fails > to retrieve artifacts for the modules themselves (which is not necessary as > these can be installed by {{mvn install}} any time). > This can be seen on an [OSS multi-module > project|https://github.com/WASdev/sample.daytrader7]: > {code:java} > mvn dependency:resolve > [INFO] Scanning for projects... > [INFO] > > [INFO] Reactor Build Order: > [INFO] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EJB Module > [jar] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - Web Module > [war] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample > [pom] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EAR > [ear] > [INFO] > [INFO] --< net.wasdev.wlp.sample:daytrader-ee7-ejb > >--- > [INFO] Building WAS Liberty Sample - Java EE7 Benchmark Sample - EJB Module > 1.0-SNAPSHOT [1/4] > [INFO] from daytrader-ee7-ejb/pom.xml > [INFO] [ jar > ]- > [INFO] > [INFO] --- dependency:3.6.0:resolve (default-cli) @ daytrader-ee7-ejb --- > [INFO] > [INFO] The following files have been resolved: > [INFO] javax:javaee-api:jar:7.0:provided -- module javaee.api (auto) > [INFO] com.sun.mail:javax.mail:jar:1.5.0:provided -- module javax.mail > (auto) > [INFO] javax.activation:activation:jar:1.1:provided -- module activation > (auto) > [INFO] javax.annotation:javax.annotation-api:jar:1.3.2:provided -- module > java.annotation [auto] > [INFO] > [INFO] > [INFO] --< net.wasdev.wlp.sample:daytrader-ee7-web > >--- > [INFO] Building WAS Liberty Sample - Java EE7 Benchmark Sample - Web Module > 1.0-SNAPSHOT [2/4] > [INFO] from daytrader-ee7-web/pom.xml > [INFO] [ war > ]- > [INFO] > > [INFO] Reactor Summary for WAS Liberty Sample - Java EE7 Benchmark Sample > 1.0-SNAPSHOT: > [INFO] > [INFO] WAS Liberty
[jira] [Commented] (MDEP-900) dependency:resolve fails for multi-module project
[ https://issues.apache.org/jira/browse/MDEP-900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852568#comment-17852568 ] ASF GitHub Bot commented on MDEP-900: - michael-o commented on PR #406: URL: https://github.com/apache/maven-dependency-plugin/pull/406#issuecomment-2150922174 This one lacks a test... > dependency:resolve fails for multi-module project > - > > Key: MDEP-900 > URL: https://issues.apache.org/jira/browse/MDEP-900 > Project: Maven Dependency Plugin > Issue Type: Bug > Components: resolve >Affects Versions: 3.6.1 >Reporter: Gerd Aschemann >Assignee: Slawomir Jaranowski >Priority: Critical > Fix For: 3.7.0 > > > When executing {{mvn dependency:resolve}} on a multi-module project it fails > to retrieve artifacts for the modules themselves (which is not necessary as > these can be installed by {{mvn install}} any time). > This can be seen on an [OSS multi-module > project|https://github.com/WASdev/sample.daytrader7]: > {code:java} > mvn dependency:resolve > [INFO] Scanning for projects... > [INFO] > > [INFO] Reactor Build Order: > [INFO] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EJB Module > [jar] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - Web Module > [war] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample > [pom] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EAR > [ear] > [INFO] > [INFO] --< net.wasdev.wlp.sample:daytrader-ee7-ejb > >--- > [INFO] Building WAS Liberty Sample - Java EE7 Benchmark Sample - EJB Module > 1.0-SNAPSHOT [1/4] > [INFO] from daytrader-ee7-ejb/pom.xml > [INFO] [ jar > ]- > [INFO] > [INFO] --- dependency:3.6.0:resolve (default-cli) @ daytrader-ee7-ejb --- > [INFO] > [INFO] The following files have been resolved: > [INFO] javax:javaee-api:jar:7.0:provided -- module javaee.api (auto) > [INFO] com.sun.mail:javax.mail:jar:1.5.0:provided -- module javax.mail > (auto) > [INFO] javax.activation:activation:jar:1.1:provided -- module activation > (auto) > [INFO] javax.annotation:javax.annotation-api:jar:1.3.2:provided -- module > java.annotation [auto] > [INFO] > [INFO] > [INFO] --< net.wasdev.wlp.sample:daytrader-ee7-web > >--- > [INFO] Building WAS Liberty Sample - Java EE7 Benchmark Sample - Web Module > 1.0-SNAPSHOT [2/4] > [INFO] from daytrader-ee7-web/pom.xml > [INFO] [ war > ]- > [INFO] > > [INFO] Reactor Summary for WAS Liberty Sample - Java EE7 Benchmark Sample > 1.0-SNAPSHOT: > [INFO] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EJB Module SUCCESS [ > 0.402 s] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - Web Module FAILURE [ > 0.012 s] > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample . SKIPPED > [INFO] WAS Liberty Sample - Java EE7 Benchmark Sample - EAR SKIPPED > [INFO] > > [INFO] BUILD FAILURE > [INFO] > > [INFO] Total time: 0.552 s > [INFO] Finished at: 2023-11-14T12:37:02+01:00 > [INFO] > > [ERROR] Failed to execute goal on project daytrader-ee7-web: Could not > resolve dependencies for project > net.wasdev.wlp.sample:daytrader-ee7-web:war:1.0-SNAPSHOT: The following > artifacts could not be resolved: > net.wasdev.wlp.sample:daytrader-ee7-ejb:jar:1.0-SNAPSHOT (absent): Could not > find artifact net.wasdev.wlp.sample:daytrader-ee7-ejb:jar:1.0-SNAPSHOT -> > [Help 1]{code} > This is similar to the behaviour of MDEP-409, and MDEP-895 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (SUREFIRE-2232) [REGRESSION] StatelessXmlReporter fails to process failed result without a throwable
[ https://issues.apache.org/jira/browse/SUREFIRE-2232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852562#comment-17852562 ] ASF GitHub Bot commented on SUREFIRE-2232: -- michael-o commented on PR #716: URL: https://github.com/apache/maven-surefire/pull/716#issuecomment-2150904406 I need to refresh my schema foo with https://www.xfront.com/SchemaVersioning.html and https://www.xfront.com/Versioning.pdf > [REGRESSION] StatelessXmlReporter fails to process failed result without a > throwable > > > Key: SUREFIRE-2232 > URL: https://issues.apache.org/jira/browse/SUREFIRE-2232 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 3.0.0-M6, 3.2.3, 3.2.5 >Reporter: Artem Yak >Assignee: Michael Osipov >Priority: Minor > Fix For: 3.3.0 > > > > A regression bug appeared in 3.0.0-M6: > A testNG test class has a listener which updates results from SUCCESS to > FAILURE: > > {noformat} > @Override > public void onTestSuccess(ITestResult result) { > result.setStatus(ITestResult.FAILURE); > result.getTestContext().getPassedTests().removeResult(result); > result.getTestContext().getFailedTests().addResult(result); > }{noformat} > > Surefire fails to process a failed test result without a throwable and > reports 0 total tests. > {code:java} > ForkStarter IOException: java.util.NoSuchElementException. > org.apache.maven.plugin.surefire.booterclient.output.MultipleFailureException: > java.util.NoSuchElementException > at > org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.(ThreadedStreamConsumer.java:59) > at > org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer.(ThreadedStreamConsumer.java:107) > at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:546) > at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:285) > at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:250) > {code} > > Reproducible unit test. > {code:java} > package org.apache.maven.plugin.surefire.report; > import java.io.File; > import java.util.HashMap; > import java.util.concurrent.atomic.AtomicInteger; > import junit.framework.TestCase; > import > org.apache.maven.plugin.surefire.booterclient.output.DeserializedStacktraceWriter; > import org.apache.maven.surefire.api.report.SimpleReportEntry; > import org.apache.maven.surefire.api.report.StackTraceWriter; > import static org.apache.maven.plugin.surefire.report.ReportEntryType.ERROR; > import static org.apache.maven.surefire.api.report.RunMode.NORMAL_RUN; > @SuppressWarnings({"ResultOfMethodCallIgnored", "checkstyle:magicnumber"}) > public class StatelessXmlReporter2Test extends TestCase { > private static final String XSD = > > "https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd;; > private static final AtomicInteger FOLDER_POSTFIX = new AtomicInteger(); > private File reportDir; > @Override > protected void setUp() throws Exception { > File basedir = new File("."); > File target = new File(basedir.getCanonicalFile(), "target"); > target.mkdir(); > String reportRelDir = getClass().getSimpleName() + "-" + > FOLDER_POSTFIX.incrementAndGet(); > reportDir = new File(target, reportRelDir); > reportDir.mkdir(); > } > @Override > protected void tearDown() { > } > public void testOutputFailedTestWithoutThrowable() { > StackTraceWriter stackTraceWriterOne = new > DeserializedStacktraceWriter(null, null, ""); > WrappedReportEntry testReport = new WrappedReportEntry( > new SimpleReportEntry( > NORMAL_RUN, 1L, getClass().getName(), null, "a test name", > null, stackTraceWriterOne, 5), > ERROR, > 5, > null, > null); > TestSetStats testSetStats = new TestSetStats(false, false); > testSetStats.testError(testReport); > StatelessXmlReporter reporter = new StatelessXmlReporter( > reportDir, null, false, 1, new HashMap<>(), XSD, "3.0", false, > false, false, false); > reporter.testSetCompleted(testReport, testSetStats); > } > } {code} > > > > {code:java} > java.util.NoSuchElementException > at java.base/java.util.StringTokenizer.nextToken(StringTokenizer.java:349) > at > org.apache.maven.plugin.surefire.report.StatelessXmlReporter.getTestProblems(StatelessXmlReporter.java:454) > at >
[jira] [Commented] (SUREFIRE-2232) [REGRESSION] StatelessXmlReporter fails to process failed result without a throwable
[ https://issues.apache.org/jira/browse/SUREFIRE-2232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852561#comment-17852561 ] ASF GitHub Bot commented on SUREFIRE-2232: -- michael-o commented on PR #716: URL: https://github.com/apache/maven-surefire/pull/716#issuecomment-2150903376 @dr29bart First PR: https://github.com/apache/maven-surefire/pull/745 > [REGRESSION] StatelessXmlReporter fails to process failed result without a > throwable > > > Key: SUREFIRE-2232 > URL: https://issues.apache.org/jira/browse/SUREFIRE-2232 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 3.0.0-M6, 3.2.3, 3.2.5 >Reporter: Artem Yak >Assignee: Michael Osipov >Priority: Minor > Fix For: 3.3.0 > > > > A regression bug appeared in 3.0.0-M6: > A testNG test class has a listener which updates results from SUCCESS to > FAILURE: > > {noformat} > @Override > public void onTestSuccess(ITestResult result) { > result.setStatus(ITestResult.FAILURE); > result.getTestContext().getPassedTests().removeResult(result); > result.getTestContext().getFailedTests().addResult(result); > }{noformat} > > Surefire fails to process a failed test result without a throwable and > reports 0 total tests. > {code:java} > ForkStarter IOException: java.util.NoSuchElementException. > org.apache.maven.plugin.surefire.booterclient.output.MultipleFailureException: > java.util.NoSuchElementException > at > org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.(ThreadedStreamConsumer.java:59) > at > org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer.(ThreadedStreamConsumer.java:107) > at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:546) > at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:285) > at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:250) > {code} > > Reproducible unit test. > {code:java} > package org.apache.maven.plugin.surefire.report; > import java.io.File; > import java.util.HashMap; > import java.util.concurrent.atomic.AtomicInteger; > import junit.framework.TestCase; > import > org.apache.maven.plugin.surefire.booterclient.output.DeserializedStacktraceWriter; > import org.apache.maven.surefire.api.report.SimpleReportEntry; > import org.apache.maven.surefire.api.report.StackTraceWriter; > import static org.apache.maven.plugin.surefire.report.ReportEntryType.ERROR; > import static org.apache.maven.surefire.api.report.RunMode.NORMAL_RUN; > @SuppressWarnings({"ResultOfMethodCallIgnored", "checkstyle:magicnumber"}) > public class StatelessXmlReporter2Test extends TestCase { > private static final String XSD = > > "https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd;; > private static final AtomicInteger FOLDER_POSTFIX = new AtomicInteger(); > private File reportDir; > @Override > protected void setUp() throws Exception { > File basedir = new File("."); > File target = new File(basedir.getCanonicalFile(), "target"); > target.mkdir(); > String reportRelDir = getClass().getSimpleName() + "-" + > FOLDER_POSTFIX.incrementAndGet(); > reportDir = new File(target, reportRelDir); > reportDir.mkdir(); > } > @Override > protected void tearDown() { > } > public void testOutputFailedTestWithoutThrowable() { > StackTraceWriter stackTraceWriterOne = new > DeserializedStacktraceWriter(null, null, ""); > WrappedReportEntry testReport = new WrappedReportEntry( > new SimpleReportEntry( > NORMAL_RUN, 1L, getClass().getName(), null, "a test name", > null, stackTraceWriterOne, 5), > ERROR, > 5, > null, > null); > TestSetStats testSetStats = new TestSetStats(false, false); > testSetStats.testError(testReport); > StatelessXmlReporter reporter = new StatelessXmlReporter( > reportDir, null, false, 1, new HashMap<>(), XSD, "3.0", false, > false, false, false); > reporter.testSetCompleted(testReport, testSetStats); > } > } {code} > > > > {code:java} > java.util.NoSuchElementException > at java.base/java.util.StringTokenizer.nextToken(StringTokenizer.java:349) > at > org.apache.maven.plugin.surefire.report.StatelessXmlReporter.getTestProblems(StatelessXmlReporter.java:454) > at > org.apache.maven.plugin.surefire.report.StatelessXmlReporter.serializeTestClassWithRerun(StatelessXmlReporter.java:256) > at >
[jira] [Commented] (MBUILDCACHE-87) Checksum should consider plugin dependencies
[ https://issues.apache.org/jira/browse/MBUILDCACHE-87?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852556#comment-17852556 ] ASF GitHub Bot commented on MBUILDCACHE-87: --- AlexanderAshitkin commented on code in PR #146: URL: https://github.com/apache/maven-build-cache-extension/pull/146#discussion_r1623253391 ## src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java: ## @@ -620,14 +631,26 @@ private static boolean isReadable(Path entry) throws IOException { } private SortedMap getMutableDependencies() throws IOException { +return getMutableDependenciesHashes("", project.getDependencies()); +} + +private SortedMap getMutablePluginDependencies() throws IOException { +SortedMap fullMap = new TreeMap<>(); +for (Plugin plugin : project.getBuildPlugins()) { +if (config.isPluginDependenciesExcluded(plugin)) { +continue; +} +fullMap.putAll(getMutableDependenciesHashes( + KeyUtils.getVersionlessArtifactKey(repoSystem.createPluginArtifact(plugin)) + "|", Review Comment: Maven allows the same plugin to run more than once with different dependency sets. In this case, the last plugin declaration wins, the dependencies of the first plugin are discarded, and the checksum might be incorrect. Every plugin declaration must contribute to the checksum—instead of the map, the result should be a list of items. > Checksum should consider plugin dependencies > > > Key: MBUILDCACHE-87 > URL: https://issues.apache.org/jira/browse/MBUILDCACHE-87 > Project: Maven Build Cache Extension > Issue Type: Improvement >Reporter: Réda Housni Alaoui >Priority: Major > Labels: pull-request-available > > I have a multi module project where module A is used as a dependency of > maven-dependency-plugin:unpack declared in module B. > {{buildinfo.xml}} of module B does not consider module A as a dependency. > Maybe something similar to > https://github.com/apache/maven-build-cache-extension/blob/6eb05e61fdfa7be1ad44cf6afc13958b0c6ea4a6/src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java#L602 > should be added for plugin dependencies? -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-7902) Sort plugins in validation report
[ https://issues.apache.org/jira/browse/MNG-7902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852524#comment-17852524 ] ASF GitHub Bot commented on MNG-7902: - slawekjaranowski merged PR #1562: URL: https://github.com/apache/maven/pull/1562 > Sort plugins in validation report > - > > Key: MNG-7902 > URL: https://issues.apache.org/jira/browse/MNG-7902 > Project: Maven > Issue Type: Improvement > Components: Core >Reporter: Michael Keppler >Priority: Minor > Fix For: 4.0.0, 3.9.8, 4.0.0-beta-4 > > Attachments: image-2023-10-07-13-33-27-762.png > > > Please don't ever output the content of a Set for consumption by humans > without sorting it first. The order is otherwise "random". Sorting (case > insensitive) makes the same output easier to read, especially when trying to > find one specific entry (e.g. "Did we fix plugin foo already?") > !image-2023-10-07-13-33-27-762.png! -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-7902) Sort plugins in validation report
[ https://issues.apache.org/jira/browse/MNG-7902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852516#comment-17852516 ] ASF GitHub Bot commented on MNG-7902: - slawekjaranowski opened a new pull request, #1562: URL: https://github.com/apache/maven/pull/1562 (cherry picked from commit dd9679450e00d08caf4f042d92c22acd38585bd5) > Sort plugins in validation report > - > > Key: MNG-7902 > URL: https://issues.apache.org/jira/browse/MNG-7902 > Project: Maven > Issue Type: Improvement > Components: Core >Reporter: Michael Keppler >Priority: Minor > Fix For: 4.0.0-beta-4 > > Attachments: image-2023-10-07-13-33-27-762.png > > > Please don't ever output the content of a Set for consumption by humans > without sorting it first. The order is otherwise "random". Sorting (case > insensitive) makes the same output easier to read, especially when trying to > find one specific entry (e.g. "Did we fix plugin foo already?") > !image-2023-10-07-13-33-27-762.png! -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (SUREFIRE-2232) [REGRESSION] StatelessXmlReporter fails to process failed result without a throwable
[ https://issues.apache.org/jira/browse/SUREFIRE-2232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852510#comment-17852510 ] ASF GitHub Bot commented on SUREFIRE-2232: -- michael-o commented on code in PR #716: URL: https://github.com/apache/maven-surefire/pull/716#discussion_r1628075126 ## maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java: ## @@ -451,7 +451,9 @@ private static void getTestProblems( String type = delimiter == -1 ? stackTrace : stackTrace.substring(0, delimiter); ppw.addAttribute("type", type); } else { -ppw.addAttribute("type", new StringTokenizer(stackTrace).nextToken()); +ppw.addAttribute( +"type", +isBlank(stackTrace) ? "UndefinedException" : new StringTokenizer(stackTrace).nextToken()); Review Comment: Let me then prepare a PR with that change and you can build up on it. > [REGRESSION] StatelessXmlReporter fails to process failed result without a > throwable > > > Key: SUREFIRE-2232 > URL: https://issues.apache.org/jira/browse/SUREFIRE-2232 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 3.0.0-M6, 3.2.3, 3.2.5 >Reporter: Artem Yak >Assignee: Michael Osipov >Priority: Minor > Fix For: 3.3.0 > > > > A regression bug appeared in 3.0.0-M6: > A testNG test class has a listener which updates results from SUCCESS to > FAILURE: > > {noformat} > @Override > public void onTestSuccess(ITestResult result) { > result.setStatus(ITestResult.FAILURE); > result.getTestContext().getPassedTests().removeResult(result); > result.getTestContext().getFailedTests().addResult(result); > }{noformat} > > Surefire fails to process a failed test result without a throwable and > reports 0 total tests. > {code:java} > ForkStarter IOException: java.util.NoSuchElementException. > org.apache.maven.plugin.surefire.booterclient.output.MultipleFailureException: > java.util.NoSuchElementException > at > org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.(ThreadedStreamConsumer.java:59) > at > org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer.(ThreadedStreamConsumer.java:107) > at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:546) > at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:285) > at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:250) > {code} > > Reproducible unit test. > {code:java} > package org.apache.maven.plugin.surefire.report; > import java.io.File; > import java.util.HashMap; > import java.util.concurrent.atomic.AtomicInteger; > import junit.framework.TestCase; > import > org.apache.maven.plugin.surefire.booterclient.output.DeserializedStacktraceWriter; > import org.apache.maven.surefire.api.report.SimpleReportEntry; > import org.apache.maven.surefire.api.report.StackTraceWriter; > import static org.apache.maven.plugin.surefire.report.ReportEntryType.ERROR; > import static org.apache.maven.surefire.api.report.RunMode.NORMAL_RUN; > @SuppressWarnings({"ResultOfMethodCallIgnored", "checkstyle:magicnumber"}) > public class StatelessXmlReporter2Test extends TestCase { > private static final String XSD = > > "https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd;; > private static final AtomicInteger FOLDER_POSTFIX = new AtomicInteger(); > private File reportDir; > @Override > protected void setUp() throws Exception { > File basedir = new File("."); > File target = new File(basedir.getCanonicalFile(), "target"); > target.mkdir(); > String reportRelDir = getClass().getSimpleName() + "-" + > FOLDER_POSTFIX.incrementAndGet(); > reportDir = new File(target, reportRelDir); > reportDir.mkdir(); > } > @Override > protected void tearDown() { > } > public void testOutputFailedTestWithoutThrowable() { > StackTraceWriter stackTraceWriterOne = new > DeserializedStacktraceWriter(null, null, ""); > WrappedReportEntry testReport = new WrappedReportEntry( > new SimpleReportEntry( > NORMAL_RUN, 1L, getClass().getName(), null, "a test name", > null, stackTraceWriterOne, 5), > ERROR, > 5, > null, > null); > TestSetStats testSetStats = new TestSetStats(false, false); > testSetStats.testError(testReport); >
[jira] [Commented] (MNG-8135) Profile activation based on OS properties is no longer case insensitive
[ https://issues.apache.org/jira/browse/MNG-8135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852505#comment-17852505 ] ASF GitHub Bot commented on MNG-8135: - cstamas merged PR #1561: URL: https://github.com/apache/maven/pull/1561 > Profile activation based on OS properties is no longer case insensitive > --- > > Key: MNG-8135 > URL: https://issues.apache.org/jira/browse/MNG-8135 > Project: Maven > Issue Type: Bug > Components: Profiles >Affects Versions: 3.9.7 >Reporter: Lijia Liu >Priority: Major > Fix For: 4.0.0, 3.9.8, 4.0.0-beta-4 > > > This BUG is introduced by MNG-5726. Prior that change the os name, arch and > version comparison was always case-insensitive. Afterwards it needs to match > the lower-case variants. > When OS name, arch or version has capital letters, it won't activate the > profile. > For example: > {code:java} > > > Mac OS X > aarch64 > > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (SUREFIRE-2232) [REGRESSION] StatelessXmlReporter fails to process failed result without a throwable
[ https://issues.apache.org/jira/browse/SUREFIRE-2232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852499#comment-17852499 ] ASF GitHub Bot commented on SUREFIRE-2232: -- dr29bart commented on code in PR #716: URL: https://github.com/apache/maven-surefire/pull/716#discussion_r1628020762 ## maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java: ## @@ -451,7 +451,9 @@ private static void getTestProblems( String type = delimiter == -1 ? stackTrace : stackTrace.substring(0, delimiter); ppw.addAttribute("type", type); } else { -ppw.addAttribute("type", new StringTokenizer(stackTrace).nextToken()); +ppw.addAttribute( +"type", +isBlank(stackTrace) ? "UndefinedException" : new StringTokenizer(stackTrace).nextToken()); Review Comment: > I can remove the requried in the schema and bump to 3.1.0. I like this idea. it is the easiest option to implement. > [REGRESSION] StatelessXmlReporter fails to process failed result without a > throwable > > > Key: SUREFIRE-2232 > URL: https://issues.apache.org/jira/browse/SUREFIRE-2232 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 3.0.0-M6, 3.2.3, 3.2.5 >Reporter: Artem Yak >Assignee: Michael Osipov >Priority: Minor > Fix For: 3.3.0 > > > > A regression bug appeared in 3.0.0-M6: > A testNG test class has a listener which updates results from SUCCESS to > FAILURE: > > {noformat} > @Override > public void onTestSuccess(ITestResult result) { > result.setStatus(ITestResult.FAILURE); > result.getTestContext().getPassedTests().removeResult(result); > result.getTestContext().getFailedTests().addResult(result); > }{noformat} > > Surefire fails to process a failed test result without a throwable and > reports 0 total tests. > {code:java} > ForkStarter IOException: java.util.NoSuchElementException. > org.apache.maven.plugin.surefire.booterclient.output.MultipleFailureException: > java.util.NoSuchElementException > at > org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.(ThreadedStreamConsumer.java:59) > at > org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer.(ThreadedStreamConsumer.java:107) > at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:546) > at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:285) > at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:250) > {code} > > Reproducible unit test. > {code:java} > package org.apache.maven.plugin.surefire.report; > import java.io.File; > import java.util.HashMap; > import java.util.concurrent.atomic.AtomicInteger; > import junit.framework.TestCase; > import > org.apache.maven.plugin.surefire.booterclient.output.DeserializedStacktraceWriter; > import org.apache.maven.surefire.api.report.SimpleReportEntry; > import org.apache.maven.surefire.api.report.StackTraceWriter; > import static org.apache.maven.plugin.surefire.report.ReportEntryType.ERROR; > import static org.apache.maven.surefire.api.report.RunMode.NORMAL_RUN; > @SuppressWarnings({"ResultOfMethodCallIgnored", "checkstyle:magicnumber"}) > public class StatelessXmlReporter2Test extends TestCase { > private static final String XSD = > > "https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd;; > private static final AtomicInteger FOLDER_POSTFIX = new AtomicInteger(); > private File reportDir; > @Override > protected void setUp() throws Exception { > File basedir = new File("."); > File target = new File(basedir.getCanonicalFile(), "target"); > target.mkdir(); > String reportRelDir = getClass().getSimpleName() + "-" + > FOLDER_POSTFIX.incrementAndGet(); > reportDir = new File(target, reportRelDir); > reportDir.mkdir(); > } > @Override > protected void tearDown() { > } > public void testOutputFailedTestWithoutThrowable() { > StackTraceWriter stackTraceWriterOne = new > DeserializedStacktraceWriter(null, null, ""); > WrappedReportEntry testReport = new WrappedReportEntry( > new SimpleReportEntry( > NORMAL_RUN, 1L, getClass().getName(), null, "a test name", > null, stackTraceWriterOne, 5), > ERROR, > 5, > null, > null); > TestSetStats testSetStats = new TestSetStats(false, false); >
[jira] [Commented] (MNG-8135) Profile activation based on OS properties is no longer case insensitive
[ https://issues.apache.org/jira/browse/MNG-8135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852494#comment-17852494 ] ASF GitHub Bot commented on MNG-8135: - kwin merged PR #538: URL: https://github.com/apache/maven-site/pull/538 > Profile activation based on OS properties is no longer case insensitive > --- > > Key: MNG-8135 > URL: https://issues.apache.org/jira/browse/MNG-8135 > Project: Maven > Issue Type: Bug > Components: Profiles >Affects Versions: 3.9.7 >Reporter: Lijia Liu >Priority: Major > Fix For: 4.0.0, 3.9.8, 4.0.0-beta-4 > > > This BUG is introduced by MNG-5726. Prior that change the os name, arch and > version comparison was always case-insensitive. Afterwards it needs to match > the lower-case variants. > When OS name, arch or version has capital letters, it won't activate the > profile. > For example: > {code:java} > > > Mac OS X > aarch64 > > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (SUREFIRE-2232) [REGRESSION] StatelessXmlReporter fails to process failed result without a throwable
[ https://issues.apache.org/jira/browse/SUREFIRE-2232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852493#comment-17852493 ] ASF GitHub Bot commented on SUREFIRE-2232: -- michael-o commented on code in PR #716: URL: https://github.com/apache/maven-surefire/pull/716#discussion_r1627988457 ## maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java: ## @@ -451,7 +451,9 @@ private static void getTestProblems( String type = delimiter == -1 ? stackTrace : stackTrace.substring(0, delimiter); ppw.addAttribute("type", type); } else { -ppw.addAttribute("type", new StringTokenizer(stackTrace).nextToken()); +ppw.addAttribute( +"type", +isBlank(stackTrace) ? "UndefinedException" : new StringTokenizer(stackTrace).nextToken()); Review Comment: I looked at this again and I want to address for 3.3.0. I have option D for you: Since this is an oversight and `strackTrace` can be truly null of `t.getMessage()` is `null`, we should not write non-sense or empty to `type`, but leave it out. Rather no output than bad output. My proposal: Since we know that `type` can be null, I can remove the `requried` in the schema and bump to 3.1.0. WDYT? > [REGRESSION] StatelessXmlReporter fails to process failed result without a > throwable > > > Key: SUREFIRE-2232 > URL: https://issues.apache.org/jira/browse/SUREFIRE-2232 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Plugin >Affects Versions: 3.0.0-M6, 3.2.3 >Reporter: Artem Yak >Assignee: Michael Osipov >Priority: Minor > Fix For: 3.3.0 > > > > A regression bug appeared in 3.0.0-M6: > A testNG test class has a listener which updates results from SUCCESS to > FAILURE: > > {noformat} > @Override > public void onTestSuccess(ITestResult result) { > result.setStatus(ITestResult.FAILURE); > result.getTestContext().getPassedTests().removeResult(result); > result.getTestContext().getFailedTests().addResult(result); > }{noformat} > > Surefire fails to process a failed test result without a throwable and > reports 0 total tests. > {code:java} > ForkStarter IOException: java.util.NoSuchElementException. > org.apache.maven.plugin.surefire.booterclient.output.MultipleFailureException: > java.util.NoSuchElementException > at > org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.(ThreadedStreamConsumer.java:59) > at > org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer.(ThreadedStreamConsumer.java:107) > at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:546) > at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:285) > at > org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:250) > {code} > > Reproducible unit test. > {code:java} > package org.apache.maven.plugin.surefire.report; > import java.io.File; > import java.util.HashMap; > import java.util.concurrent.atomic.AtomicInteger; > import junit.framework.TestCase; > import > org.apache.maven.plugin.surefire.booterclient.output.DeserializedStacktraceWriter; > import org.apache.maven.surefire.api.report.SimpleReportEntry; > import org.apache.maven.surefire.api.report.StackTraceWriter; > import static org.apache.maven.plugin.surefire.report.ReportEntryType.ERROR; > import static org.apache.maven.surefire.api.report.RunMode.NORMAL_RUN; > @SuppressWarnings({"ResultOfMethodCallIgnored", "checkstyle:magicnumber"}) > public class StatelessXmlReporter2Test extends TestCase { > private static final String XSD = > > "https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd;; > private static final AtomicInteger FOLDER_POSTFIX = new AtomicInteger(); > private File reportDir; > @Override > protected void setUp() throws Exception { > File basedir = new File("."); > File target = new File(basedir.getCanonicalFile(), "target"); > target.mkdir(); > String reportRelDir = getClass().getSimpleName() + "-" + > FOLDER_POSTFIX.incrementAndGet(); > reportDir = new File(target, reportRelDir); > reportDir.mkdir(); > } > @Override > protected void tearDown() { > } > public void testOutputFailedTestWithoutThrowable() { > StackTraceWriter stackTraceWriterOne = new > DeserializedStacktraceWriter(null, null, ""); > WrappedReportEntry testReport = new WrappedReportEntry( > new
[jira] [Commented] (MNG-8135) Profile activation based on OS properties is no longer case insensitive
[ https://issues.apache.org/jira/browse/MNG-8135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852483#comment-17852483 ] ASF GitHub Bot commented on MNG-8135: - kwin opened a new pull request, #538: URL: https://github.com/apache/maven-site/pull/538 (no comment) > Profile activation based on OS properties is no longer case insensitive > --- > > Key: MNG-8135 > URL: https://issues.apache.org/jira/browse/MNG-8135 > Project: Maven > Issue Type: Bug > Components: Profiles >Affects Versions: 3.9.7 >Reporter: Lijia Liu >Priority: Major > Fix For: 4.0.0, 3.9.8, 4.0.0-beta-4 > > > This BUG is introduced by MNG-5726. Prior that change the os name, arch and > version comparison was always case-insensitive. Afterwards it needs to match > the lower-case variants. > When OS name, arch or version has capital letters, it won't activate the > profile. > For example: > {code:java} > > > Mac OS X > aarch64 > > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MSHARED-1301) Upgrade to Parent 42 and Maven 3.6.3
[ https://issues.apache.org/jira/browse/MSHARED-1301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852474#comment-17852474 ] ASF GitHub Bot commented on MSHARED-1301: - asfgit closed pull request #36: [MSHARED-1301] Upgrade to Parent 42 and Maven 3.6.3 URL: https://github.com/apache/maven-common-artifact-filters/pull/36 > Upgrade to Parent 42 and Maven 3.6.3 > > > Key: MSHARED-1301 > URL: https://issues.apache.org/jira/browse/MSHARED-1301 > Project: Maven Shared Components > Issue Type: Dependency upgrade > Components: maven-common-artifact-filters >Reporter: Elliotte Rusty Harold >Assignee: Michael Osipov >Priority: Major > Labels: up-for-grabs > Fix For: maven-common-artifact-filters-3.4.0 > > Attachments: maven_parent_poms.300.png > > > will require a spotless run -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8135) Profile activation based on OS properties is no longer case insensitive
[ https://issues.apache.org/jira/browse/MNG-8135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852470#comment-17852470 ] ASF GitHub Bot commented on MNG-8135: - kwin commented on PR #1561: URL: https://github.com/apache/maven/pull/1561#issuecomment-2150185700 This needs adjustment, because Maven 3.x is still on JUnit4! > Profile activation based on OS properties is no longer case insensitive > --- > > Key: MNG-8135 > URL: https://issues.apache.org/jira/browse/MNG-8135 > Project: Maven > Issue Type: Bug > Components: Profiles >Affects Versions: 3.9.7 >Reporter: Lijia Liu >Priority: Major > Fix For: 4.0.0, 3.9.8, 4.0.0-beta-4 > > > This BUG is introduced by MNG-5726. Prior that change the os name, arch and > version comparison was always case-insensitive. Afterwards it needs to match > the lower-case variants. > When OS name, arch or version has capital letters, it won't activate the > profile. > For example: > {code:java} > > > Mac OS X > aarch64 > > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8135) Profile activation based on OS properties is no longer case insensitive
[ https://issues.apache.org/jira/browse/MNG-8135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852469#comment-17852469 ] ASF GitHub Bot commented on MNG-8135: - cstamas opened a new pull request, #1561: URL: https://github.com/apache/maven/pull/1561 …e insensitive Bacport of 0456c7c629d6fc872073268faeb77d2bde9a1b7d --- https://issues.apache.org/jira/browse/MNG-8135 > Profile activation based on OS properties is no longer case insensitive > --- > > Key: MNG-8135 > URL: https://issues.apache.org/jira/browse/MNG-8135 > Project: Maven > Issue Type: Bug > Components: Profiles >Affects Versions: 3.9.7 >Reporter: Lijia Liu >Priority: Major > Fix For: 4.0.0, 3.9.8, 4.0.0-beta-4 > > > This BUG is introduced by MNG-5726. Prior that change the os name, arch and > version comparison was always case-insensitive. Afterwards it needs to match > the lower-case variants. > When OS name has capital letters, it can not activate the profile. > For example: > {code:java} > > > Mac OS X > aarch64 > > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8134) Provide an annotation that can be used to inject dependencies resolution/collection in mojos
[ https://issues.apache.org/jira/browse/MNG-8134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852465#comment-17852465 ] ASF GitHub Bot commented on MNG-8134: - cstamas commented on PR #1559: URL: https://github.com/apache/maven/pull/1559#issuecomment-2150142854 This then opens interesting possibilities for Mojos... > Provide an annotation that can be used to inject dependencies > resolution/collection in mojos > > > Key: MNG-8134 > URL: https://issues.apache.org/jira/browse/MNG-8134 > Project: Maven > Issue Type: Task >Reporter: Guillaume Nodet >Priority: Major > Fix For: 4.0.0 > > > See > https://github.com/apache/maven-plugin-tools/pull/286#discussion_r1620871349 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8134) Provide an annotation that can be used to inject dependencies resolution/collection in mojos
[ https://issues.apache.org/jira/browse/MNG-8134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852464#comment-17852464 ] ASF GitHub Bot commented on MNG-8134: - gnodet commented on PR #1559: URL: https://github.com/apache/maven/pull/1559#issuecomment-2150138460 > > Can a mojo have 2 or more fields annotated like this? Yes, the mojo descriptor contains a `List`, each `Dependencies` object containing the field name and the pathScope value (null meaning a collection rather than a resolution). > Provide an annotation that can be used to inject dependencies > resolution/collection in mojos > > > Key: MNG-8134 > URL: https://issues.apache.org/jira/browse/MNG-8134 > Project: Maven > Issue Type: Task >Reporter: Guillaume Nodet >Priority: Major > Fix For: 4.0.0 > > > See > https://github.com/apache/maven-plugin-tools/pull/286#discussion_r1620871349 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8135) Activate profile by capital OS name fail
[ https://issues.apache.org/jira/browse/MNG-8135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852463#comment-17852463 ] ASF GitHub Bot commented on MNG-8135: - kwin merged PR #1549: URL: https://github.com/apache/maven/pull/1549 > Activate profile by capital OS name fail > > > Key: MNG-8135 > URL: https://issues.apache.org/jira/browse/MNG-8135 > Project: Maven > Issue Type: Bug > Components: Profiles >Affects Versions: 3.9.7 >Reporter: Lijia Liu >Priority: Major > Fix For: 4.0.0, 3.9.8, 4.0.0-beta-4 > > > This BUG is introduced by MNG-5726. Prior that change the os name, arch and > version comparison was always case-insensitive. Afterwards it needs to match > the lower-case variants. > When OS name has capital letters, it can not activate the profile. > For example: > {code:java} > > > Mac OS X > aarch64 > > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8134) Provide an annotation that can be used to inject dependencies resolution/collection in mojos
[ https://issues.apache.org/jira/browse/MNG-8134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852461#comment-17852461 ] ASF GitHub Bot commented on MNG-8134: - cstamas commented on PR #1559: URL: https://github.com/apache/maven/pull/1559#issuecomment-2150088035 Can a mojo have 2 or more fields annotated like this? > Provide an annotation that can be used to inject dependencies > resolution/collection in mojos > > > Key: MNG-8134 > URL: https://issues.apache.org/jira/browse/MNG-8134 > Project: Maven > Issue Type: Task >Reporter: Guillaume Nodet >Priority: Major > Fix For: 4.0.0 > > > See > https://github.com/apache/maven-plugin-tools/pull/286#discussion_r1620871349 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8135) Activate profile by capital OS name fail
[ https://issues.apache.org/jira/browse/MNG-8135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852454#comment-17852454 ] ASF GitHub Bot commented on MNG-8135: - cstamas commented on PR #1549: URL: https://github.com/apache/maven/pull/1549#issuecomment-2149984615 Can we have a backport of this PR against `maven-3.9.x` branch? Or if pretty much trivial (as it is same code) I can cherry pick it back once merged. > Activate profile by capital OS name fail > > > Key: MNG-8135 > URL: https://issues.apache.org/jira/browse/MNG-8135 > Project: Maven > Issue Type: Bug > Components: Profiles >Affects Versions: 3.9.7 >Reporter: Lijia Liu >Priority: Major > Fix For: 4.0.0, 3.9.8, 4.0.0-beta-4 > > > This BUG is introduced by MNG-5726. Prior that change the os name, arch and > version comparison was always case-insensitive. Afterwards it needs to match > the lower-case variants. > When OS name has capital letters, it can not activate the profile. > For example: > {code:java} > > > Mac OS X > aarch64 > > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8134) Provide an annotation that can be used to inject dependencies resolution/collection in mojos
[ https://issues.apache.org/jira/browse/MNG-8134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852451#comment-17852451 ] ASF GitHub Bot commented on MNG-8134: - gnodet opened a new pull request, #1559: URL: https://github.com/apache/maven/pull/1559 (no comment) > Provide an annotation that can be used to inject dependencies > resolution/collection in mojos > > > Key: MNG-8134 > URL: https://issues.apache.org/jira/browse/MNG-8134 > Project: Maven > Issue Type: Task >Reporter: Guillaume Nodet >Priority: Major > Fix For: 4.0.0 > > > See > https://github.com/apache/maven-plugin-tools/pull/286#discussion_r1620871349 -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8066) Maven hangs on self-referencing exceptions
[ https://issues.apache.org/jira/browse/MNG-8066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852448#comment-17852448 ] ASF GitHub Bot commented on MNG-8066: - cstamas opened a new pull request, #1558: URL: https://github.com/apache/maven/pull/1558 If there is a recursion in throwable causes, Maven will hang forever, instead to return. --- https://issues.apache.org/jira/browse/MNG-8066 > Maven hangs on self-referencing exceptions > -- > > Key: MNG-8066 > URL: https://issues.apache.org/jira/browse/MNG-8066 > Project: Maven > Issue Type: Bug >Reporter: François Guillot >Assignee: Tamas Cservenak >Priority: Major > Fix For: 4.0.0, 3.9.8, 4.0.0-beta-4 > > > If the code executed by Maven throws a self-referencing exception, such as > {code:java} > RuntimeException selfReferencingException = new RuntimeException("BOOM self"); > selfReferencingException.initCause(new Exception("BOOM cause", > selfReferencingException)); > throw selfReferencingException; > {code} > For instance, if this code is added to an `AbstractExecutionListener`, which > is added to the running build: > {code:java} > import org.apache.maven.execution.AbstractExecutionListener; > import org.apache.maven.execution.ExecutionListener; > import org.apache.maven.execution.ExecutionEvent; > public class FailingExecutionListener extends AbstractExecutionListener { > private final ExecutionListener delegate; > public FailingExecutionListener(ExecutionListener delegate) { > this.delegate = delegate; > } > @Override > public void sessionStarted(ExecutionEvent event) { > if (delegate != null) { > delegate.sessionStarted(event); > } > RuntimeException selfReferencingException = new RuntimeException("BOOM > self"); > selfReferencingException.initCause(new Exception("BOOM cause", > selfReferencingException)); > throw selfReferencingException; > } > } > {code} > Maven hangs at the end of the build, in `DefaultExceptionHandler`. > The code in `DefaultExceptionHandler#getMessage` iterates on a given > throwable and its causes. It checks if the cause is not the same throwable, > but doesn't protect against a 'two-level' recursion like shown above. > Note that when printing a stacktrace, Java itself protects against this via > the use of a > {code:java} > Set dejaVu = Collections.newSetFromMap(new IdentityHashMap<>()); > {code} > and stops the recursion if encountering an already seen throwable. > A way to fix this would be to replace the offending cause with a replacement > with no cause, such as in > {code:java} > private static Throwable patchCircularCause(Throwable current, Throwable > parent) { > try { > Field causeField = Throwable.class.getDeclaredField("cause"); > causeField.setAccessible(true); > Throwable replacement = new Throwable("[CIRCULAR REFERENCE: " + > current + "]"); > replacement.setStackTrace(current.getStackTrace()); > causeField.set(parent, replacement); > return replacement; > } catch (NoSuchFieldException | IllegalAccessException e) { > // Couldn't replace the cause, let's return the actual exception. > return current; > } > } > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8142) If JDK profile activator gets "invalid" JDK version for whatever reason, it chokes but does not tell why
[ https://issues.apache.org/jira/browse/MNG-8142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852436#comment-17852436 ] ASF GitHub Bot commented on MNG-8142: - cstamas commented on PR #1557: URL: https://github.com/apache/maven/pull/1557#issuecomment-2149772564 If this PR gets merged, the #1555 will become fixed as well, as there will be no more ERRORs, as NumberformatEx is reported here as model builder warnings with proper message. The fact that these warnings are nowhere reported is totally different thing, and probably a good cause for yet another PR, but it is out of scope of 3.9.8 > If JDK profile activator gets "invalid" JDK version for whatever reason, it > chokes but does not tell why > > > Key: MNG-8142 > URL: https://issues.apache.org/jira/browse/MNG-8142 > Project: Maven > Issue Type: Bug > Components: Core >Reporter: Tamas Cservenak >Assignee: Tamas Cservenak >Priority: Major > Fix For: 3.9.8, 4.0.0-beta-4 > > > The JDK profile activator uses property {{java.version}} to determine is > profile active or not, but if you look at MNG-3746 you can see that Maven > _allows overriding that property_ by user, but also, today some "weird > formatted" version may pop up in the wild. > The JDK profile activator is not prepared for these cases, and will just > throw (NumberFormatEx), without telling why it did belly up. > Improve the message why it throw. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8142) If JDK profile activator gets "invalid" JDK version for whatever reason, it chokes but does not tell why
[ https://issues.apache.org/jira/browse/MNG-8142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852435#comment-17852435 ] ASF GitHub Bot commented on MNG-8142: - michael-o commented on PR #1557: URL: https://github.com/apache/maven/pull/1557#issuecomment-2149767044 > If property `java.version` is in unexpected format, the activator throws NumberFormatEx, that in turn, is caught and reported by DefaultProfileSelector w/o any cause. > > These should be cleanly reported instead: report that `java.version` property is in "unexpected format", and also report why was there are failure to evaluate a properrty activation. > > Note1: Maven allows `-Djava.version` override, this is exactly what IT [MNG-3746](https://issues.apache.org/jira/browse/MNG-3746) exactly does, but the NumberFormatEx went unnoticed (was swallowed). > > Note2: This bug was revealed by #1555 as it reported the issue, and later "asserted error free log" which was not error-free. Hence, this bug was simply revealed by improved logging on unrelated issue. > > https://issues.apache.org/jira/browse/MNG-8142 That is the reason why user properties should *NEVER* be promoted to system properties. It causes chaos. > If JDK profile activator gets "invalid" JDK version for whatever reason, it > chokes but does not tell why > > > Key: MNG-8142 > URL: https://issues.apache.org/jira/browse/MNG-8142 > Project: Maven > Issue Type: Bug > Components: Core >Reporter: Tamas Cservenak >Assignee: Tamas Cservenak >Priority: Major > Fix For: 3.9.8, 4.0.0-beta-4 > > > The JDK profile activator uses property {{java.version}} to determine is > profile active or not, but if you look at MNG-3746 you can see that Maven > _allows overriding that property_ by user, but also, today some "weird > formatted" version may pop up in the wild. > The JDK profile activator is not prepared for these cases, and will just > throw (NumberFormatEx), without telling why it did belly up. > Improve the message why it throw. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8142) If JDK profile activator gets "invalid" JDK version for whatever reason, it chokes but does not tell why
[ https://issues.apache.org/jira/browse/MNG-8142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852433#comment-17852433 ] ASF GitHub Bot commented on MNG-8142: - cstamas commented on PR #1557: URL: https://github.com/apache/maven/pull/1557#issuecomment-2149764735 The IT w/ #1555 failed due this output (in debug, as IT uses Maven with -X): ``` [WARNING] The POM for org.apache.commons:commons-lang3:jar:3.8.1 is invalid, transitive dependencies (if any) will not be available: 3 problems were encountered while building the effective model for org.apache.commons:commons-lang3:3.8.1 [ERROR] Failed to determine activation for profile java9+ @ [ERROR] Failed to determine activation for profile java11+ @ [ERROR] Failed to determine activation for profile jdk7-plugin-fix-version @ org.apache.commons:commons-parent:47 ``` And these ERRORS were actually due NumberFormatEx caused by the fact that IT MNG-3746 uses on purpose `-Djava.version=cli` to test is profile activation used properties overridden or not. > If JDK profile activator gets "invalid" JDK version for whatever reason, it > chokes but does not tell why > > > Key: MNG-8142 > URL: https://issues.apache.org/jira/browse/MNG-8142 > Project: Maven > Issue Type: Bug > Components: Core >Reporter: Tamas Cservenak >Assignee: Tamas Cservenak >Priority: Major > Fix For: 3.9.8, 4.0.0-beta-4 > > > The JDK profile activator uses property {{java.version}} to determine is > profile active or not, but if you look at MNG-3746 you can see that Maven > _allows overriding that property_ by user, but also, today some "weird > formatted" version may pop up in the wild. > The JDK profile activator is not prepared for these cases, and will just > throw (NumberFormatEx), without telling why it did belly up. > Improve the message why it throw. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8142) If JDK profile activator gets "invalid" JDK version for whatever reason, it chokes but does not tell why
[ https://issues.apache.org/jira/browse/MNG-8142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852428#comment-17852428 ] ASF GitHub Bot commented on MNG-8142: - cstamas opened a new pull request, #1557: URL: https://github.com/apache/maven/pull/1557 If property `java.version` is in unexpected format, the activator throws NumberFormatEx, that in turn, is caught and reported by DefaultProfileSelector w/o any cause. These should be cleanly reported instead: report that `java.version` property is in "unexpected format", and also report why was there are failure to evaluate a properrty activation. Note1: Maven allows `-Djava.version` override, this is exactly what IT MNG-3746 exactly does, but the NumberFormatEx went unnoticed (was swallowed). Note2: This bug was revealed by #1555 as it reported the issue, and later "asserted error free log" which was not error-free. Hence, this bug was simply revealed by improved logging on unrelated issue. --- https://issues.apache.org/jira/browse/MNG-8142 > If JDK profile activator gets "invalid" JDK version for whatever reason, it > chokes but does not tell why > > > Key: MNG-8142 > URL: https://issues.apache.org/jira/browse/MNG-8142 > Project: Maven > Issue Type: Bug > Components: Core >Reporter: Tamas Cservenak >Assignee: Tamas Cservenak >Priority: Major > Fix For: 3.9.8, 4.0.0-beta-4 > > > The JDK profile activator uses property {{java.version}} to determine is > profile active or not, but if you look at MNG-3746 you can see that Maven > _allows overriding that property_ by user, but also, today some "weird > formatted" version may pop up in the wild. > The JDK profile activator is not prepared for these cases, and will just > throw (NumberFormatEx), without telling why it did belly up. > Improve the message why it throw. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (SUREFIRE-1939) Build fails if java.home has <=2 path components
[ https://issues.apache.org/jira/browse/SUREFIRE-1939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852425#comment-17852425 ] ASF GitHub Bot commented on SUREFIRE-1939: -- michael-o commented on PR #743: URL: https://github.com/apache/maven-surefire/pull/743#issuecomment-2149687879 @CMoH @slawekjaranowski > Build fails if java.home has <=2 path components > > > Key: SUREFIRE-1939 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1939 > Project: Maven Surefire > Issue Type: Bug > Environment: Gentoo Linux openjdk-bin-11.0.11_p9 >Reporter: Ciprian Ciubotariu >Assignee: Michael Osipov >Priority: Trivial > Fix For: 3.3.0 > > > For {{JAVA_HOME=/opt/openjdk-bin-11.0.11_p9}}, > {{SystemUtilsTest.PlainUnitTests.incorrectJdkPath()}} throws a NPE at > {{SystemUtils.toJdkHomeFromJvmExec(SystemUtils.java:91)}}. > Trivial fix will follow soon -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (SUREFIRE-1939) Build fails if java.home has <=2 path components
[ https://issues.apache.org/jira/browse/SUREFIRE-1939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852424#comment-17852424 ] ASF GitHub Bot commented on SUREFIRE-1939: -- michael-o commented on PR #387: URL: https://github.com/apache/maven-surefire/pull/387#issuecomment-2149685198 I have created a new PR addressing this: #743. @CMoH, your approach is appreciated, but it solves only the symptom, not the cause. Look at the signature: https://github.com/apache/maven-surefire/blob/e166d93e13191b52c26291f6d5ef0bf83a5b97c8/surefire-booter/src/main/java/org/apache/maven/surefire/booter/SystemUtils.java#L148. It expects a path to the Java executable and nothing else, not a JDK/JRE/Java home. Therefore, invalid data leads to undefined behavior, you see an NPE in this case. > Build fails if java.home has <=2 path components > > > Key: SUREFIRE-1939 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1939 > Project: Maven Surefire > Issue Type: Bug > Environment: Gentoo Linux openjdk-bin-11.0.11_p9 >Reporter: Ciprian Ciubotariu >Assignee: Michael Osipov >Priority: Trivial > Fix For: 3.3.0 > > > For {{JAVA_HOME=/opt/openjdk-bin-11.0.11_p9}}, > {{SystemUtilsTest.PlainUnitTests.incorrectJdkPath()}} throws a NPE at > {{SystemUtils.toJdkHomeFromJvmExec(SystemUtils.java:91)}}. > Trivial fix will follow soon -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (SUREFIRE-1939) Build fails if java.home has <=2 path components
[ https://issues.apache.org/jira/browse/SUREFIRE-1939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852423#comment-17852423 ] ASF GitHub Bot commented on SUREFIRE-1939: -- michael-o opened a new pull request, #743: URL: https://github.com/apache/maven-surefire/pull/743 Removes an invalid test which passes a JDK or JRE home to a method which expects the path to the Java executable. Therefore the invalid input leads to an exception. This closes #743 Following this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SUREFIRE) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[SUREFIRE-XXX] - Fixes bug in ApproximateQuantiles`, where you replace `SUREFIRE-XXX` with the appropriate JIRA issue. Best practice is to use the JIRA issue title in the pull request title and in the first line of the commit message. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `mvn clean install` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] You have run the integration tests successfully (`mvn -Prun-its clean install`). If your pull request is about ~20 lines of code you don't need to sign an [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure please ask on the developers list. To make clear that you license your contribution under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) you have to acknowledge this by using the following check-box. - [ ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). > Build fails if java.home has <=2 path components > > > Key: SUREFIRE-1939 > URL: https://issues.apache.org/jira/browse/SUREFIRE-1939 > Project: Maven Surefire > Issue Type: Bug > Environment: Gentoo Linux openjdk-bin-11.0.11_p9 >Reporter: Ciprian Ciubotariu >Assignee: Michael Osipov >Priority: Trivial > Fix For: 3.3.0 > > > For {{JAVA_HOME=/opt/openjdk-bin-11.0.11_p9}}, > {{SystemUtilsTest.PlainUnitTests.incorrectJdkPath()}} throws a NPE at > {{SystemUtils.toJdkHomeFromJvmExec(SystemUtils.java:91)}}. > Trivial fix will follow soon -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MNG-8140) When a model is discarded (by model builder) for whatever reason, show why it happened
[ https://issues.apache.org/jira/browse/MNG-8140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852409#comment-17852409 ] ASF GitHub Bot commented on MNG-8140: - cstamas commented on PR #1555: URL: https://github.com/apache/maven/pull/1555#issuecomment-2149622982 Lol, 2 ITs failed, one was due this PR that immediately revealed this issue: parent POM has no pom packaging (btw, fixed on master as mvn4 also spotted this): https://github.com/apache/maven-integration-testing/blob/maven-3.9.x/core-it-suite/src/test/resources/mng-7819-file-locking-with-snapshots/repo/org/apache/maven/its/mng7819/parent/1.0.0-SNAPSHOT/parent-1.0.0-20221014.203717-12.pom And the IT simply assert there are no unwanted level output in logs. I bet something similar happens in other failed IT. > 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: 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)