[jira] [Commented] (MSHARED-831) Configuration in reporting section not taken into account when running from cli
[ https://issues.apache.org/jira/browse/MSHARED-831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543574#comment-17543574 ] Herve Boutemy commented on MSHARED-831: --- it would be useful to have feedback on usage: doc is fixed, that was the minimum, but learning on the interest of trying to change > Configuration in reporting section not taken into account when running from > cli > --- > > Key: MSHARED-831 > URL: https://issues.apache.org/jira/browse/MSHARED-831 > Project: Maven Shared Components > Issue Type: Improvement > Components: maven-reporting-impl >Affects Versions: maven-reporting-impl 3.0 >Reporter: Hans Aikema >Assignee: Michael Osipov >Priority: Major > Fix For: waiting-for-feedback > > > Investigating on [https://github.com/jeremylong/DependencyCheck/issues/1444] > my conclusion is that plugin configuration using the reporting section does > not work as documented on > [https://maven.apache.org/guides/mini/guide-configuring-plugins.html#Using_the_reporting_Tag_VS_build_Tag] > When configuring the plugin using the reporting section of the pom the > configuration is not applied when calling the plugin goal from the CLI > whereas the guide states that it is first looked up there and only when not > found searched for in the build section. > Don't know if this is the intended behaviour of the CLI-invocation of the > plugins (and thus a documentation bug) or an actual bug in the configuration > evaluation, but I spotted similar behaviour with the > maven-project-info-reports-plugin -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Updated] (DOXIA-651) Upgrade Flexmark to 0.50.50
[ https://issues.apache.org/jira/browse/DOXIA-651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Herve Boutemy updated DOXIA-651: Description: Changed classes: https://github.com/vsch/flexmark-java/blob/master/assets/migrations/migrate%20flexmark-java%200_42_x%20to%200_50_0.xml 0.50.50 is latest on 0.50.x series, that targets Java 8 was:Changed classes: https://github.com/vsch/flexmark-java/blob/master/assets/migrations/migrate%20flexmark-java%200_42_x%20to%200_50_0.xml > Upgrade Flexmark to 0.50.50 > --- > > Key: DOXIA-651 > URL: https://issues.apache.org/jira/browse/DOXIA-651 > Project: Maven Doxia > Issue Type: Dependency upgrade > Components: Module - Markdown >Reporter: Michael Osipov >Assignee: Michael Osipov >Priority: Major > Fix For: 2.0.0-M3 > > > Changed classes: > https://github.com/vsch/flexmark-java/blob/master/assets/migrations/migrate%20flexmark-java%200_42_x%20to%200_50_0.xml > 0.50.50 is latest on 0.50.x series, that targets Java 8 -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven-doxia] hboutemy commented on pull request #98: [DOXIA-590] Either provided element class or default class gets ignored
hboutemy commented on PR #98: URL: https://github.com/apache/maven-doxia/pull/98#issuecomment-1140401901 IIUC, currently BaseSink *replaces* the class attribute value with its own a or b, it should *append*? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (DOXIA-590) Either provided element class or default class gets ignored
[ https://issues.apache.org/jira/browse/DOXIA-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543586#comment-17543586 ] ASF GitHub Bot commented on DOXIA-590: -- hboutemy commented on PR #98: URL: https://github.com/apache/maven-doxia/pull/98#issuecomment-1140401901 IIUC, currently BaseSink *replaces* the class attribute value with its own a or b, it should *append*? > Either provided element class or default class gets ignored > --- > > Key: DOXIA-590 > URL: https://issues.apache.org/jira/browse/DOXIA-590 > Project: Maven Doxia > Issue Type: Bug > Components: Core >Affects Versions: 1.8 >Reporter: Fred Eckertson >Assignee: Michael Osipov >Priority: Major > Fix For: 2.0.0-M3, 1.11.2 > > Attachments: image-2022-05-18-21-57-40-619.png > > > The following construct is somewhat common in doxia-core > att.addAttribute( Attribute.CLASS, "a" ); > The documentation says that basic attributes (including CLASS) are supported. > However in cases like this either that "a" or the CLASS that was provided in > the attributes parameter will be ignored. The correct way to do this is to > append the provided CLASS to "a " if a CLASS attribute was provided. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Commented] (MRELEASE-1072) scm.tag removed for next snapshot during prepare
[ https://issues.apache.org/jira/browse/MRELEASE-1072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543589#comment-17543589 ] Herve Boutemy commented on MRELEASE-1072: - we used that svn release support for years without any problem: did you find in which release the issue was introduced? FYI, working on MRELEASE-1079, I found a stupid algorithm mistake in MRELEASE-988 ({{!Map.containsKey(projectId)}} is not equivalent to {{Map.get(projectId) == null}}): there may be other little bugs like that > scm.tag removed for next snapshot during prepare > > > Key: MRELEASE-1072 > URL: https://issues.apache.org/jira/browse/MRELEASE-1072 > Project: Maven Release Plugin > Issue Type: Bug > Components: prepare >Reporter: Konrad Windszus >Priority: Major > Fix For: 3.0.0-M6 > > > In case that the original {{project.scm}} section contains a tag element > (e.g. with value "trunk") this is removed during prepare for the next > snapshot version. The tagged/release version contains the properly adjusted > tag element. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven] michael-o commented on a diff in pull request #746: [MNG-7486] Create a multiline message helper for boxed log messages
michael-o commented on code in PR #746: URL: https://github.com/apache/maven/pull/746#discussion_r884234997 ## maven-core/src/main/java/org/apache/maven/internal/MultilineMessageHelper.java: ## @@ -0,0 +1,91 @@ +package org.apache.maven.internal; + +/* + * 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. + */ + +import java.util.ArrayList; +import java.util.List; + +/** + * Helper class to format multiline messages to the console + */ +public class MultilineMessageHelper +{ + +private static final int DEFAULT_MAX_SIZE = 65; +private static final char BOX_CHAR = '*'; + +public static String separatorLine() +{ +StringBuilder sb = new StringBuilder( DEFAULT_MAX_SIZE ); +repeat( sb, '*', DEFAULT_MAX_SIZE ); +return sb.toString(); +} + +public static List format( String... lines ) +{ +int size = DEFAULT_MAX_SIZE; +int rem = size - 4; // 4 chars = 2 box_char + 2 spaces +List result = new ArrayList<>(); +StringBuilder sb = new StringBuilder( size ); +// first line +sb.setLength( 0 ); +repeat( sb, BOX_CHAR, size ); +result.add( sb.toString() ); +// lines +for ( String line : lines ) +{ +sb.setLength( 0 ); +String[] words = line.split( " " ); Review Comment: Done. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven] michael-o commented on pull request #746: [MNG-7486] Create a multiline message helper for boxed log messages
michael-o commented on PR #746: URL: https://github.com/apache/maven/pull/746#issuecomment-1140405016 From my PoV this is now done. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (MNG-7486) Create a multiline message helper for boxed log messages
[ https://issues.apache.org/jira/browse/MNG-7486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543593#comment-17543593 ] ASF GitHub Bot commented on MNG-7486: - michael-o commented on PR #746: URL: https://github.com/apache/maven/pull/746#issuecomment-1140405016 From my PoV this is now done. > Create a multiline message helper for boxed log messages > > > Key: MNG-7486 > URL: https://issues.apache.org/jira/browse/MNG-7486 > Project: Maven > Issue Type: New Feature >Reporter: Michael Osipov >Assignee: Guillaume Nodet >Priority: Major > Fix For: 3.8.6, 3.9.0, 4.0.0-alpha-1, 4.0.0 > > > Simplify the way how boxed messages, e.g., for non-threadsafe plugins is > created. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Commented] (MNG-7486) Create a multiline message helper for boxed log messages
[ https://issues.apache.org/jira/browse/MNG-7486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543592#comment-17543592 ] ASF GitHub Bot commented on MNG-7486: - michael-o commented on code in PR #746: URL: https://github.com/apache/maven/pull/746#discussion_r884234997 ## maven-core/src/main/java/org/apache/maven/internal/MultilineMessageHelper.java: ## @@ -0,0 +1,91 @@ +package org.apache.maven.internal; + +/* + * 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. + */ + +import java.util.ArrayList; +import java.util.List; + +/** + * Helper class to format multiline messages to the console + */ +public class MultilineMessageHelper +{ + +private static final int DEFAULT_MAX_SIZE = 65; +private static final char BOX_CHAR = '*'; + +public static String separatorLine() +{ +StringBuilder sb = new StringBuilder( DEFAULT_MAX_SIZE ); +repeat( sb, '*', DEFAULT_MAX_SIZE ); +return sb.toString(); +} + +public static List format( String... lines ) +{ +int size = DEFAULT_MAX_SIZE; +int rem = size - 4; // 4 chars = 2 box_char + 2 spaces +List result = new ArrayList<>(); +StringBuilder sb = new StringBuilder( size ); +// first line +sb.setLength( 0 ); +repeat( sb, BOX_CHAR, size ); +result.add( sb.toString() ); +// lines +for ( String line : lines ) +{ +sb.setLength( 0 ); +String[] words = line.split( " " ); Review Comment: Done. > Create a multiline message helper for boxed log messages > > > Key: MNG-7486 > URL: https://issues.apache.org/jira/browse/MNG-7486 > Project: Maven > Issue Type: New Feature >Reporter: Michael Osipov >Assignee: Guillaume Nodet >Priority: Major > Fix For: 3.8.6, 3.9.0, 4.0.0-alpha-1, 4.0.0 > > > Simplify the way how boxed messages, e.g., for non-threadsafe plugins is > created. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven-doxia] michael-o commented on pull request #98: [DOXIA-590] Either provided element class or default class gets ignored
michael-o commented on PR #98: URL: https://github.com/apache/maven-doxia/pull/98#issuecomment-1140406686 > IIUC, currently BaseSink _replaces_ the class attribute value with its own a or b, it should _append_? I think a well named method could make sense Yes, it blindly replaces instead taking care of the additive semantics of `class`. That is logically wrong. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (DOXIA-590) Either provided element class or default class gets ignored
[ https://issues.apache.org/jira/browse/DOXIA-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543599#comment-17543599 ] ASF GitHub Bot commented on DOXIA-590: -- michael-o commented on PR #98: URL: https://github.com/apache/maven-doxia/pull/98#issuecomment-1140406686 > IIUC, currently BaseSink _replaces_ the class attribute value with its own a or b, it should _append_? I think a well named method could make sense Yes, it blindly replaces instead taking care of the additive semantics of `class`. That is logically wrong. > Either provided element class or default class gets ignored > --- > > Key: DOXIA-590 > URL: https://issues.apache.org/jira/browse/DOXIA-590 > Project: Maven Doxia > Issue Type: Bug > Components: Core >Affects Versions: 1.8 >Reporter: Fred Eckertson >Assignee: Michael Osipov >Priority: Major > Fix For: 2.0.0-M3, 1.11.2 > > Attachments: image-2022-05-18-21-57-40-619.png > > > The following construct is somewhat common in doxia-core > att.addAttribute( Attribute.CLASS, "a" ); > The documentation says that basic attributes (including CLASS) are supported. > However in cases like this either that "a" or the CLASS that was provided in > the attributes parameter will be ignored. The correct way to do this is to > append the provided CLASS to "a " if a CLASS attribute was provided. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven-doxia] asfgit merged pull request #102: [DOXIA-652] Drop build-info.properties in favor of default pom.proper…
asfgit merged PR #102: URL: https://github.com/apache/maven-doxia/pull/102 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (DOXIA-652) Drop build-info.properties in favor of default pom.properties
[ https://issues.apache.org/jira/browse/DOXIA-652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543602#comment-17543602 ] ASF GitHub Bot commented on DOXIA-652: -- asfgit merged PR #102: URL: https://github.com/apache/maven-doxia/pull/102 > Drop build-info.properties in favor of default pom.properties > - > > Key: DOXIA-652 > URL: https://issues.apache.org/jira/browse/DOXIA-652 > Project: Maven Doxia > Issue Type: Task > Components: Core >Affects Versions: 2.0.0-M2 >Reporter: Michael Osipov >Assignee: Michael Osipov >Priority: Major > Fix For: 2.0.0-M3 > > -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Closed] (DOXIA-652) Drop build-info.properties in favor of default pom.properties
[ https://issues.apache.org/jira/browse/DOXIA-652?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Osipov closed DOXIA-652. Resolution: Fixed Fixed with [74bfa2a315617425c1786373c913a570a7297105|https://gitbox.apache.org/repos/asf?p=maven-doxia.git;a=commit;h=74bfa2a315617425c1786373c913a570a7297105]. > Drop build-info.properties in favor of default pom.properties > - > > Key: DOXIA-652 > URL: https://issues.apache.org/jira/browse/DOXIA-652 > Project: Maven Doxia > Issue Type: Task > Components: Core >Affects Versions: 2.0.0-M2 >Reporter: Michael Osipov >Assignee: Michael Osipov >Priority: Major > Fix For: 2.0.0-M3 > > -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven-doxia] asfgit closed pull request #101: [DOXIA-651] Upgrade Flexmark to 0.50.50
asfgit closed pull request #101: [DOXIA-651] Upgrade Flexmark to 0.50.50 URL: https://github.com/apache/maven-doxia/pull/101 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (DOXIA-651) Upgrade Flexmark to 0.50.50
[ https://issues.apache.org/jira/browse/DOXIA-651?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543605#comment-17543605 ] ASF GitHub Bot commented on DOXIA-651: -- asfgit closed pull request #101: [DOXIA-651] Upgrade Flexmark to 0.50.50 URL: https://github.com/apache/maven-doxia/pull/101 > Upgrade Flexmark to 0.50.50 > --- > > Key: DOXIA-651 > URL: https://issues.apache.org/jira/browse/DOXIA-651 > Project: Maven Doxia > Issue Type: Dependency upgrade > Components: Module - Markdown >Reporter: Michael Osipov >Assignee: Michael Osipov >Priority: Major > Fix For: 2.0.0-M3 > > > Changed classes: > https://github.com/vsch/flexmark-java/blob/master/assets/migrations/migrate%20flexmark-java%200_42_x%20to%200_50_0.xml > 0.50.50 is latest on 0.50.x series, that targets Java 8 -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Closed] (DOXIA-651) Upgrade Flexmark to 0.50.50
[ https://issues.apache.org/jira/browse/DOXIA-651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Osipov closed DOXIA-651. Resolution: Fixed Fixed with [5508c6962434e9829ef36938e4a2a03290e3917d|https://gitbox.apache.org/repos/asf?p=maven-doxia.git;a=commit;h=5508c6962434e9829ef36938e4a2a03290e3917d]. > Upgrade Flexmark to 0.50.50 > --- > > Key: DOXIA-651 > URL: https://issues.apache.org/jira/browse/DOXIA-651 > Project: Maven Doxia > Issue Type: Dependency upgrade > Components: Module - Markdown >Reporter: Michael Osipov >Assignee: Michael Osipov >Priority: Major > Fix For: 2.0.0-M3 > > > Changed classes: > https://github.com/vsch/flexmark-java/blob/master/assets/migrations/migrate%20flexmark-java%200_42_x%20to%200_50_0.xml > 0.50.50 is latest on 0.50.x series, that targets Java 8 -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Commented] (MRELEASE-1072) scm.tag removed for next snapshot during prepare
[ https://issues.apache.org/jira/browse/MRELEASE-1072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543606#comment-17543606 ] Konrad Windszus commented on MRELEASE-1072: --- I am not sure this is a regression as using the tag in svn branches is an edge case. Still it should work, though > scm.tag removed for next snapshot during prepare > > > Key: MRELEASE-1072 > URL: https://issues.apache.org/jira/browse/MRELEASE-1072 > Project: Maven Release Plugin > Issue Type: Bug > Components: prepare >Reporter: Konrad Windszus >Priority: Major > Fix For: 3.0.0-M6 > > > In case that the original {{project.scm}} section contains a tag element > (e.g. with value "trunk") this is removed during prepare for the next > snapshot version. The tagged/release version contains the properly adjusted > tag element. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Updated] (MRELEASE-1097) clarify goal vs phase terms in output and documentation
[ https://issues.apache.org/jira/browse/MRELEASE-1097?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Herve Boutemy updated MRELEASE-1097: Description: {noformat}$ mvn release:prepare -DdryRun [INFO] Scanning for projects... [INFO] [INFO] ---< groupId:artifactId >--- [INFO] Building Name 1.4.2-SNAPSHOT [INFO] [ jar ]- [INFO] [INFO] --- maven-release-plugin:3.0.0-M5:prepare (default-cli) @ artifactId --- [INFO] phase verify-release-configuration (dry-run) [INFO] starting prepare goal in dry-run mode, composed of 17 phases: check-poms, scm-check-modifications, check-dependency-snapshots, create-backup-poms, map-release-versions, input-variables, map-development-versions, rewrite-poms-for-release, generate-release-poms, run-preparation-goals, scm-commit-release, scm-tag, rewrite-poms-for-development, remove-release-poms, run-completion-goals, scm-commit-development, end-release {noformat} "phase verify-release-configuration" but "starting prepare goal in dry-run mode, composed of 17 phases" {noformat}$ mvn release:perform -DdryRun [INFO] Scanning for projects... [INFO] [INFO] ---< groupId:artifactId >--- [INFO] Building Name 1.4.2-SNAPSHOT [INFO] [ jar ]- [INFO] [INFO] --- maven-release-plugin:3.0.0-M5:perform (default-cli) @ artifactId --- [INFO] phase verify-release-configuration (dry-run) [INFO] starting perform goal in dry-run mode, composed of 3 phases: verify-completed-prepare-phases, checkout-project-from-scm, run-perform-goals {noformat} same "phase verify-release-configuration" than previously was: {noformat}$ mvn release:prepare -DdryRun [INFO] Scanning for projects... [INFO] [INFO] ---< groupId:artifactId >--- [INFO] Building Name 1.4.2-SNAPSHOT [INFO] [ jar ]- [INFO] [INFO] --- maven-release-plugin:3.0.0-M5:prepare (default-cli) @ artifactId --- [INFO] phase verify-release-configuration (dry-run) [INFO] starting prepare goal in dry-run mode, composed of 17 phases: check-poms, scm-check-modifications, check-dependency-snapshots, create-backup-poms, map-release-versions, input-variables, map-development-versions, rewrite-poms-for-release, generate-release-poms, run-preparation-goals, scm-commit-release, scm-tag, rewrite-poms-for-development, remove-release-poms, run-completion-goals, scm-commit-development, end-release {noformat} "phase verify-release-configuration" but "starting prepare goal in dry-run mode, composed of 17 phases" {nofomat}$ mvn release:perform -DdryRun [INFO] Scanning for projects... [INFO] [INFO] ---< groupId:artifactId >--- [INFO] Building Name 1.4.2-SNAPSHOT [INFO] [ jar ]- [INFO] [INFO] --- maven-release-plugin:3.0.0-M5:perform (default-cli) @ artifactId --- [INFO] phase verify-release-configuration (dry-run) [INFO] starting perform goal in dry-run mode, composed of 3 phases: verify-completed-prepare-phases, checkout-project-from-scm, run-perform-goals {noformat} same "phase verify-release-configuration" than previously > clarify goal vs phase terms in output and documentation > --- > > Key: MRELEASE-1097 > URL: https://issues.apache.org/jira/browse/MRELEASE-1097 > Project: Maven Release Plugin > Issue Type: Improvement >Affects Versions: 3.0.0-M5 >Reporter: Herve Boutemy >Priority: Major > Fix For: 3.0.0-M6 > > > {noformat}$ mvn release:prepare -DdryRun > [INFO] Scanning for projects... > [INFO] > [INFO] ---< groupId:artifactId >--- > [INFO] Building Name 1.4.2-SNAPSHOT > [INFO] [ jar > ]- > [INFO] > [INFO] --- maven-release-plugin:3.0.0-M5:prepare (default-cli) @ artifactId > --- > [INFO] phase verify-release-configuration (dry-run) > [INFO] starting prepare goal in dry-run mode, composed of 17 phases: > check-poms, scm-check-modifications, check-dependency-snapshots, > create-backup-poms, map-release-versions, input-variables, > map-development-versions, rewrite-poms-for-release, generate-release-poms, > run-preparation-goals, scm-commit-release, scm-tag, > rewrite-poms-for-development, remove-release-poms, run-completion-goals, > scm-commit-development, end-release > {noformat} > "phase verify-release-configuration" but "starting prepare goal in dry-run > mode, composed of 17 phases" > {noformat}$ mvn release:perform -DdryRun > [INFO] Scanning for projects... > [INFO] > [INFO] ---< groupId:artifactId >--- > [INFO] Building Name 1.4.2-SNAPSHOT > [INFO] ---
[jira] [Created] (MRELEASE-1097) clarify goal vs phase terms in output and documentation
Herve Boutemy created MRELEASE-1097: --- Summary: clarify goal vs phase terms in output and documentation Key: MRELEASE-1097 URL: https://issues.apache.org/jira/browse/MRELEASE-1097 Project: Maven Release Plugin Issue Type: Improvement Affects Versions: 3.0.0-M5 Reporter: Herve Boutemy Fix For: 3.0.0-M6 {noformat}$ mvn release:prepare -DdryRun [INFO] Scanning for projects... [INFO] [INFO] ---< groupId:artifactId >--- [INFO] Building Name 1.4.2-SNAPSHOT [INFO] [ jar ]- [INFO] [INFO] --- maven-release-plugin:3.0.0-M5:prepare (default-cli) @ artifactId --- [INFO] phase verify-release-configuration (dry-run) [INFO] starting prepare goal in dry-run mode, composed of 17 phases: check-poms, scm-check-modifications, check-dependency-snapshots, create-backup-poms, map-release-versions, input-variables, map-development-versions, rewrite-poms-for-release, generate-release-poms, run-preparation-goals, scm-commit-release, scm-tag, rewrite-poms-for-development, remove-release-poms, run-completion-goals, scm-commit-development, end-release {noformat} "phase verify-release-configuration" but "starting prepare goal in dry-run mode, composed of 17 phases" {nofomat}$ mvn release:perform -DdryRun [INFO] Scanning for projects... [INFO] [INFO] ---< groupId:artifactId >--- [INFO] Building Name 1.4.2-SNAPSHOT [INFO] [ jar ]- [INFO] [INFO] --- maven-release-plugin:3.0.0-M5:perform (default-cli) @ artifactId --- [INFO] phase verify-release-configuration (dry-run) [INFO] starting perform goal in dry-run mode, composed of 3 phases: verify-completed-prepare-phases, checkout-project-from-scm, run-perform-goals {noformat} same "phase verify-release-configuration" than previously -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven-release] nielsbasjes commented on pull request #104: [MRELEASE-1078] Conventional commits
nielsbasjes commented on PR #104: URL: https://github.com/apache/maven-release/pull/104#issuecomment-1140416016 > > The Conventional Commits part has specific configuration. That "next version calculator" is a plugin for the maven-release plugin. > > I know see, it is not a plugin in Maven sense, since it is not a Maven plugin with mojos. Correct, this VersionPolicy is not a maven plugin, and as a consequence my editor (IntelliJ) does not support me in setting the right options. > You simply provide a new implementation for an interface pluggable at runtime, no? Yes, and for this implementation there can be implementation specific configuration. I would like to offer settings configuration in the pom.xml of the project at hand. Right now (and this is the best I was able to get running) you can see in `maven-release-plugin/src/it/projects/prepare/ccsemver-policy/pom.xml` that the config for this VersionPolicy is a single string in projectVersionPolicyConfig which contains an XML as CDATA... which I don't really like. My question is simply: Is there a better way to do this? ``` CCSemVerVersionPolicy ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven] mthmulders commented on a diff in pull request #746: [MNG-7486] Create a multiline message helper for boxed log messages
mthmulders commented on code in PR #746: URL: https://github.com/apache/maven/pull/746#discussion_r884245248 ## maven-core/src/main/java/org/apache/maven/internal/MultilineMessageHelper.java: ## @@ -0,0 +1,91 @@ +package org.apache.maven.internal; + +/* + * 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. + */ + +import java.util.ArrayList; +import java.util.List; + +/** + * Helper class to format multiline messages to the console + */ +public class MultilineMessageHelper +{ + +private static final int DEFAULT_MAX_SIZE = 65; +private static final char BOX_CHAR = '*'; + +public static String separatorLine() +{ +StringBuilder sb = new StringBuilder( DEFAULT_MAX_SIZE ); +repeat( sb, '*', DEFAULT_MAX_SIZE ); +return sb.toString(); +} + +public static List format( String... lines ) +{ +int size = DEFAULT_MAX_SIZE; +int rem = size - 4; // 4 chars = 2 box_char + 2 spaces +List result = new ArrayList<>(); +StringBuilder sb = new StringBuilder( size ); +// first line +sb.setLength( 0 ); +repeat( sb, BOX_CHAR, size ); +result.add( sb.toString() ); +// lines +for ( String line : lines ) +{ +sb.setLength( 0 ); +String[] words = line.split( " " ); +for ( String word : words ) +{ +if ( sb.length() >= rem - word.length() - ( sb.length() > 0 ? 1 : 0 ) ) Review Comment: This would only happen for words longer than 65 - 4 characters. I guess this only happens in German ;-). As I said, not too likely for Maven. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (MNG-7486) Create a multiline message helper for boxed log messages
[ https://issues.apache.org/jira/browse/MNG-7486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543609#comment-17543609 ] ASF GitHub Bot commented on MNG-7486: - mthmulders commented on code in PR #746: URL: https://github.com/apache/maven/pull/746#discussion_r884245248 ## maven-core/src/main/java/org/apache/maven/internal/MultilineMessageHelper.java: ## @@ -0,0 +1,91 @@ +package org.apache.maven.internal; + +/* + * 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. + */ + +import java.util.ArrayList; +import java.util.List; + +/** + * Helper class to format multiline messages to the console + */ +public class MultilineMessageHelper +{ + +private static final int DEFAULT_MAX_SIZE = 65; +private static final char BOX_CHAR = '*'; + +public static String separatorLine() +{ +StringBuilder sb = new StringBuilder( DEFAULT_MAX_SIZE ); +repeat( sb, '*', DEFAULT_MAX_SIZE ); +return sb.toString(); +} + +public static List format( String... lines ) +{ +int size = DEFAULT_MAX_SIZE; +int rem = size - 4; // 4 chars = 2 box_char + 2 spaces +List result = new ArrayList<>(); +StringBuilder sb = new StringBuilder( size ); +// first line +sb.setLength( 0 ); +repeat( sb, BOX_CHAR, size ); +result.add( sb.toString() ); +// lines +for ( String line : lines ) +{ +sb.setLength( 0 ); +String[] words = line.split( " " ); +for ( String word : words ) +{ +if ( sb.length() >= rem - word.length() - ( sb.length() > 0 ? 1 : 0 ) ) Review Comment: This would only happen for words longer than 65 - 4 characters. I guess this only happens in German ;-). As I said, not too likely for Maven. > Create a multiline message helper for boxed log messages > > > Key: MNG-7486 > URL: https://issues.apache.org/jira/browse/MNG-7486 > Project: Maven > Issue Type: New Feature >Reporter: Michael Osipov >Assignee: Guillaume Nodet >Priority: Major > Fix For: 3.8.6, 3.9.0, 4.0.0-alpha-1, 4.0.0 > > > Simplify the way how boxed messages, e.g., for non-threadsafe plugins is > created. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven] michael-o commented on a diff in pull request #746: [MNG-7486] Create a multiline message helper for boxed log messages
michael-o commented on code in PR #746: URL: https://github.com/apache/maven/pull/746#discussion_r884245787 ## maven-core/src/main/java/org/apache/maven/internal/MultilineMessageHelper.java: ## @@ -0,0 +1,91 @@ +package org.apache.maven.internal; + +/* + * 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. + */ + +import java.util.ArrayList; +import java.util.List; + +/** + * Helper class to format multiline messages to the console + */ +public class MultilineMessageHelper +{ + +private static final int DEFAULT_MAX_SIZE = 65; +private static final char BOX_CHAR = '*'; + +public static String separatorLine() +{ +StringBuilder sb = new StringBuilder( DEFAULT_MAX_SIZE ); +repeat( sb, '*', DEFAULT_MAX_SIZE ); +return sb.toString(); +} + +public static List format( String... lines ) +{ +int size = DEFAULT_MAX_SIZE; +int rem = size - 4; // 4 chars = 2 box_char + 2 spaces +List result = new ArrayList<>(); +StringBuilder sb = new StringBuilder( size ); +// first line +sb.setLength( 0 ); +repeat( sb, BOX_CHAR, size ); +result.add( sb.toString() ); +// lines +for ( String line : lines ) +{ +sb.setLength( 0 ); +String[] words = line.split( " " ); +for ( String word : words ) +{ +if ( sb.length() >= rem - word.length() - ( sb.length() > 0 ? 1 : 0 ) ) Review Comment: I can easily provide those -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (MNG-7486) Create a multiline message helper for boxed log messages
[ https://issues.apache.org/jira/browse/MNG-7486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543610#comment-17543610 ] ASF GitHub Bot commented on MNG-7486: - michael-o commented on code in PR #746: URL: https://github.com/apache/maven/pull/746#discussion_r884245787 ## maven-core/src/main/java/org/apache/maven/internal/MultilineMessageHelper.java: ## @@ -0,0 +1,91 @@ +package org.apache.maven.internal; + +/* + * 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. + */ + +import java.util.ArrayList; +import java.util.List; + +/** + * Helper class to format multiline messages to the console + */ +public class MultilineMessageHelper +{ + +private static final int DEFAULT_MAX_SIZE = 65; +private static final char BOX_CHAR = '*'; + +public static String separatorLine() +{ +StringBuilder sb = new StringBuilder( DEFAULT_MAX_SIZE ); +repeat( sb, '*', DEFAULT_MAX_SIZE ); +return sb.toString(); +} + +public static List format( String... lines ) +{ +int size = DEFAULT_MAX_SIZE; +int rem = size - 4; // 4 chars = 2 box_char + 2 spaces +List result = new ArrayList<>(); +StringBuilder sb = new StringBuilder( size ); +// first line +sb.setLength( 0 ); +repeat( sb, BOX_CHAR, size ); +result.add( sb.toString() ); +// lines +for ( String line : lines ) +{ +sb.setLength( 0 ); +String[] words = line.split( " " ); +for ( String word : words ) +{ +if ( sb.length() >= rem - word.length() - ( sb.length() > 0 ? 1 : 0 ) ) Review Comment: I can easily provide those > Create a multiline message helper for boxed log messages > > > Key: MNG-7486 > URL: https://issues.apache.org/jira/browse/MNG-7486 > Project: Maven > Issue Type: New Feature >Reporter: Michael Osipov >Assignee: Guillaume Nodet >Priority: Major > Fix For: 3.8.6, 3.9.0, 4.0.0-alpha-1, 4.0.0 > > > Simplify the way how boxed messages, e.g., for non-threadsafe plugins is > created. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven-enforcer] slawekjaranowski opened a new pull request, #154: [MENFORCER-419] Upgrade Maven to 3.2.5
slawekjaranowski opened a new pull request, #154: URL: https://github.com/apache/maven-enforcer/pull/154 Following this checklist to help us incorporate your contribution quickly and easily: - [x] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MENFORCER) 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. - [x] Each commit in the pull request should have a meaningful subject line and body. - [x] Format the pull request title like `[MENFORCER-XXX] - Fixes bug in ApproximateQuantiles`, where you replace `MENFORCER-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. - [x] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [x] 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. - [x] 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) - [x] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] michael-o commented on pull request #104: [MRELEASE-1078] Conventional commits
michael-o commented on PR #104: URL: https://github.com/apache/maven-release/pull/104#issuecomment-1140429209 There is an option to inject an `Xpp3Dom` object into the plugin config which in turn could be passed to your class. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven] asfgit merged pull request #746: [MNG-7486] Create a multiline message helper for boxed log messages
asfgit merged PR #746: URL: https://github.com/apache/maven/pull/746 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (MNG-7486) Create a multiline message helper for boxed log messages
[ https://issues.apache.org/jira/browse/MNG-7486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543625#comment-17543625 ] ASF GitHub Bot commented on MNG-7486: - asfgit merged PR #746: URL: https://github.com/apache/maven/pull/746 > Create a multiline message helper for boxed log messages > > > Key: MNG-7486 > URL: https://issues.apache.org/jira/browse/MNG-7486 > Project: Maven > Issue Type: New Feature >Reporter: Michael Osipov >Assignee: Guillaume Nodet >Priority: Major > Fix For: 3.8.6, 3.9.0, 4.0.0-alpha-1, 4.0.0 > > > Simplify the way how boxed messages, e.g., for non-threadsafe plugins is > created. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Commented] (MRELEASE-899) release:prepare should not change the line separator but detect effective line separator from pom.xml
[ https://issues.apache.org/jira/browse/MRELEASE-899?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543626#comment-17543626 ] Alexander Kriegisch commented on MRELEASE-899: -- I have lobbied for this to be implemented, so I also want to thank you for the implementation. I have not actually build a snapshot and tried for myself, but the commit looks good to me. I would have preferred auto-detect to be the default mode, but I can live with the new user option and understand that you want to retain backward compatibility, rather seeing the previous behaviour as a feature rather than a bug like me. As soon as M6 will become available, I shall be glad to give it a spin and re-test. Thank you very much again. 👏🙂 > release:prepare should not change the line separator but detect effective > line separator from pom.xml > - > > Key: MRELEASE-899 > URL: https://issues.apache.org/jira/browse/MRELEASE-899 > Project: Maven Release Plugin > Issue Type: New Feature >Reporter: Ralph van Etten >Assignee: Michael Osipov >Priority: Major > Fix For: 3.0.0-M6 > > > Currently the plugin use the system property {{line.separator}} when it > rewrites the pom.xml. > This causes trouble, because every line in changed, when a project is > released sometimes under Windows and sometimes under Linux (because of its > different line separators). > (http://stackoverflow.com/questions/11868590/maven-release-plugin-and-windows-line-breaks) > Therefore it would be a nice feature when the plugin would not use the > systems line separator but the line separator that is already used in the > pom.xml. > On the other hand, changing the existing behaviour would maybe, also harm > someone else. > Therefore it would be an great feature when there would be an property that > define the expected behaviour, maybe in the same way it is done by the > maven-assembly-plugin's property fileSet.lineEnding > (http://maven.apache.org/plugins/maven-assembly-plugin/component.html#class_fileSet) -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Comment Edited] (MRELEASE-899) release:prepare should not change the line separator but detect effective line separator from pom.xml
[ https://issues.apache.org/jira/browse/MRELEASE-899?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543626#comment-17543626 ] Alexander Kriegisch edited comment on MRELEASE-899 at 5/29/22 11:55 AM: I have lobbied for this to be implemented, so I also want to thank you for the implementation. I have not actually built a snapshot and tried for myself, but the commit looks good to me. I would have preferred auto-detect to be the default mode, but I can live with the new user option and understand that you want to retain backward compatibility, seeing the previous behaviour as a feature rather than a bug like me. As soon as M6 will become available, I shall be glad to give it a spin and re-test. Thank you very much again. 👏🙂 was (Author: kriegaex): I have lobbied for this to be implemented, so I also want to thank you for the implementation. I have not actually build a snapshot and tried for myself, but the commit looks good to me. I would have preferred auto-detect to be the default mode, but I can live with the new user option and understand that you want to retain backward compatibility, rather seeing the previous behaviour as a feature rather than a bug like me. As soon as M6 will become available, I shall be glad to give it a spin and re-test. Thank you very much again. 👏🙂 > release:prepare should not change the line separator but detect effective > line separator from pom.xml > - > > Key: MRELEASE-899 > URL: https://issues.apache.org/jira/browse/MRELEASE-899 > Project: Maven Release Plugin > Issue Type: New Feature >Reporter: Ralph van Etten >Assignee: Michael Osipov >Priority: Major > Fix For: 3.0.0-M6 > > > Currently the plugin use the system property {{line.separator}} when it > rewrites the pom.xml. > This causes trouble, because every line in changed, when a project is > released sometimes under Windows and sometimes under Linux (because of its > different line separators). > (http://stackoverflow.com/questions/11868590/maven-release-plugin-and-windows-line-breaks) > Therefore it would be a nice feature when the plugin would not use the > systems line separator but the line separator that is already used in the > pom.xml. > On the other hand, changing the existing behaviour would maybe, also harm > someone else. > Therefore it would be an great feature when there would be an property that > define the expected behaviour, maybe in the same way it is done by the > maven-assembly-plugin's property fileSet.lineEnding > (http://maven.apache.org/plugins/maven-assembly-plugin/component.html#class_fileSet) -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Commented] (MNG-7486) Create a multiline message helper for boxed log messages
[ https://issues.apache.org/jira/browse/MNG-7486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543627#comment-17543627 ] Hudson commented on MNG-7486: - Build succeeded in Jenkins: Maven » Maven TLP » maven » MNG-7486-3.8.x #2 See https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven/job/MNG-7486-3.8.x/2/ > Create a multiline message helper for boxed log messages > > > Key: MNG-7486 > URL: https://issues.apache.org/jira/browse/MNG-7486 > Project: Maven > Issue Type: New Feature >Reporter: Michael Osipov >Assignee: Guillaume Nodet >Priority: Major > Fix For: 3.8.6, 3.9.0, 4.0.0-alpha-1, 4.0.0 > > > Simplify the way how boxed messages, e.g., for non-threadsafe plugins is > created. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Commented] (MNG-7486) Create a multiline message helper for boxed log messages
[ https://issues.apache.org/jira/browse/MNG-7486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543628#comment-17543628 ] Hudson commented on MNG-7486: - Build succeeded in Jenkins: Maven » Maven TLP » maven » MNG-7486-3.9.x #2 See https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven/job/MNG-7486-3.9.x/2/ > Create a multiline message helper for boxed log messages > > > Key: MNG-7486 > URL: https://issues.apache.org/jira/browse/MNG-7486 > Project: Maven > Issue Type: New Feature >Reporter: Michael Osipov >Assignee: Guillaume Nodet >Priority: Major > Fix For: 3.8.6, 3.9.0, 4.0.0-alpha-1, 4.0.0 > > > Simplify the way how boxed messages, e.g., for non-threadsafe plugins is > created. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Commented] (MNG-7486) Create a multiline message helper for boxed log messages
[ https://issues.apache.org/jira/browse/MNG-7486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543629#comment-17543629 ] Hudson commented on MNG-7486: - Build succeeded in Jenkins: Maven » Maven TLP » maven » PR-746 #5 See https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven/job/PR-746/5/ > Create a multiline message helper for boxed log messages > > > Key: MNG-7486 > URL: https://issues.apache.org/jira/browse/MNG-7486 > Project: Maven > Issue Type: New Feature >Reporter: Michael Osipov >Assignee: Guillaume Nodet >Priority: Major > Fix For: 3.8.6, 3.9.0, 4.0.0-alpha-1, 4.0.0 > > > Simplify the way how boxed messages, e.g., for non-threadsafe plugins is > created. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Closed] (MNG-7486) Create a multiline message helper for boxed log messages
[ https://issues.apache.org/jira/browse/MNG-7486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Osipov closed MNG-7486. --- Resolution: Fixed Fixed with [6767f2500f1d005924ccff27f04350c253858a84|https://gitbox.apache.org/repos/asf?p=maven.git;a=commit;h=6767f2500f1d005924ccff27f04350c253858a84], with [aec341a7a9e292a4fc537e1042da8b9ce867580c|https://gitbox.apache.org/repos/asf?p=maven.git;a=commit;h=aec341a7a9e292a4fc537e1042da8b9ce867580c] for {{maven-3.9.x}} branch, with [88a03f8ea53242bdcd18657b2ef10806b151f475|https://gitbox.apache.org/repos/asf?p=maven.git;a=commit;h=88a03f8ea53242bdcd18657b2ef10806b151f475] for {{maven-3.8.x}} branch. > Create a multiline message helper for boxed log messages > > > Key: MNG-7486 > URL: https://issues.apache.org/jira/browse/MNG-7486 > Project: Maven > Issue Type: New Feature >Reporter: Michael Osipov >Assignee: Guillaume Nodet >Priority: Major > Fix For: 3.8.6, 3.9.0, 4.0.0-alpha-1, 4.0.0 > > > Simplify the way how boxed messages, e.g., for non-threadsafe plugins is > created. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven-release] nielsbasjes commented on pull request #104: [MRELEASE-1078] Conventional commits
nielsbasjes commented on PR #104: URL: https://github.com/apache/maven-release/pull/104#issuecomment-1140438229 > There is an option to inject an `Xpp3Dom` object into the plugin config which in turn could be passed to your class. Cool! Can you please point me towards this option on how to do this. Possibly even an example in another project? I would really like to have this in there. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (MRELEASE-899) release:prepare should not change the line separator but detect effective line separator from pom.xml
[ https://issues.apache.org/jira/browse/MRELEASE-899?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543631#comment-17543631 ] Michael Osipov commented on MRELEASE-899: - [~kriegaex], I must admit that the fix took way too long, but making things right isn't easy either. > release:prepare should not change the line separator but detect effective > line separator from pom.xml > - > > Key: MRELEASE-899 > URL: https://issues.apache.org/jira/browse/MRELEASE-899 > Project: Maven Release Plugin > Issue Type: New Feature >Reporter: Ralph van Etten >Assignee: Michael Osipov >Priority: Major > Fix For: 3.0.0-M6 > > > Currently the plugin use the system property {{line.separator}} when it > rewrites the pom.xml. > This causes trouble, because every line in changed, when a project is > released sometimes under Windows and sometimes under Linux (because of its > different line separators). > (http://stackoverflow.com/questions/11868590/maven-release-plugin-and-windows-line-breaks) > Therefore it would be a nice feature when the plugin would not use the > systems line separator but the line separator that is already used in the > pom.xml. > On the other hand, changing the existing behaviour would maybe, also harm > someone else. > Therefore it would be an great feature when there would be an property that > define the expected behaviour, maybe in the same way it is done by the > maven-assembly-plugin's property fileSet.lineEnding > (http://maven.apache.org/plugins/maven-assembly-plugin/component.html#class_fileSet) -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven-release] michael-o commented on pull request #104: [MRELEASE-1078] Conventional commits
michael-o commented on PR #104: URL: https://github.com/apache/maven-release/pull/104#issuecomment-1140438589 Good question. I don't know an example from the top of my head, but you can search `maven-sources` multirepo for `Xpp3Dom`. I am sure this will do. In Maven Settings we use this trick to inject config for a server to Maven Wagon. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven] slawekjaranowski commented on a diff in pull request #741: [MNG-7468] Check unsupported plugins parameters in configuration
slawekjaranowski commented on code in PR #741: URL: https://github.com/apache/maven/pull/741#discussion_r882886798 ## maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java: ## @@ -108,4 +122,75 @@ private PluginExecution findPluginExecution( String executionId, Collection parametersNamesGoal = mojoDescriptor.getParameters().stream() +.flatMap( this::getParameterNames ) +.collect( Collectors.toSet() ); + +Set unknownParameters = getUnknownParameters( mojoExecution, parametersNamesGoal ); + +if ( unknownParameters.isEmpty() ) +{ +return; +} + +// second step get parameter names of all plugin goals +Set parametersNamesAll = mojoDescriptor.getPluginDescriptor().getMojos().stream() +.flatMap( m -> m.getParameters().stream() ) +.flatMap( this::getParameterNames ) +.collect( Collectors.toSet() ); + +unknownParameters = getUnknownParameters( mojoExecution, parametersNamesAll ); + +unknownParameters.forEach( +name -> +{ +MessageBuilder messageBuilder = MessageUtils.buffer() +.warning( "Parameter '" ) +.warning( name ) +.warning( "' is unknown for plugin: '" ) +.warning( mojoExecution.getArtifactId() ).warning( ":" ) +.warning( mojoExecution.getVersion() ).warning( ":" ) +.warning( mojoExecution.getGoal() ); Review Comment: dropped -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (MNG-7468) Unsupported plugins parameters in configuration should be verified
[ https://issues.apache.org/jira/browse/MNG-7468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543632#comment-17543632 ] ASF GitHub Bot commented on MNG-7468: - slawekjaranowski commented on code in PR #741: URL: https://github.com/apache/maven/pull/741#discussion_r882886798 ## maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java: ## @@ -108,4 +122,75 @@ private PluginExecution findPluginExecution( String executionId, Collection parametersNamesGoal = mojoDescriptor.getParameters().stream() +.flatMap( this::getParameterNames ) +.collect( Collectors.toSet() ); + +Set unknownParameters = getUnknownParameters( mojoExecution, parametersNamesGoal ); + +if ( unknownParameters.isEmpty() ) +{ +return; +} + +// second step get parameter names of all plugin goals +Set parametersNamesAll = mojoDescriptor.getPluginDescriptor().getMojos().stream() +.flatMap( m -> m.getParameters().stream() ) +.flatMap( this::getParameterNames ) +.collect( Collectors.toSet() ); + +unknownParameters = getUnknownParameters( mojoExecution, parametersNamesAll ); + +unknownParameters.forEach( +name -> +{ +MessageBuilder messageBuilder = MessageUtils.buffer() +.warning( "Parameter '" ) +.warning( name ) +.warning( "' is unknown for plugin: '" ) +.warning( mojoExecution.getArtifactId() ).warning( ":" ) +.warning( mojoExecution.getVersion() ).warning( ":" ) +.warning( mojoExecution.getGoal() ); Review Comment: dropped > Unsupported plugins parameters in configuration should be verified > -- > > Key: MNG-7468 > URL: https://issues.apache.org/jira/browse/MNG-7468 > Project: Maven > Issue Type: New Feature > Components: Plugins and Lifecycle >Reporter: Slawomir Jaranowski >Assignee: Slawomir Jaranowski >Priority: Major > Fix For: 3.9.0, 4.0.0-alpha-1, 4.0.0 > > > Currently we can provide any xml tags in plugin configuration even if plugin > Mojo doesn't support specific parameters. > eg we can have: > {code:xml} > > example-maven-plugin > 1.1.1 > > > > > {code} > With example configuration Mojo is executed without any warning. > Simply if parameters is not supported - build should break with some of > invalid plugin configuration exception ... -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Commented] (MNG-7486) Create a multiline message helper for boxed log messages
[ https://issues.apache.org/jira/browse/MNG-7486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543633#comment-17543633 ] Hudson commented on MNG-7486: - Build succeeded in Jenkins: Maven » Maven TLP » maven » maven-3.9.x #36 See https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven/job/maven-3.9.x/36/ > Create a multiline message helper for boxed log messages > > > Key: MNG-7486 > URL: https://issues.apache.org/jira/browse/MNG-7486 > Project: Maven > Issue Type: New Feature >Reporter: Michael Osipov >Assignee: Guillaume Nodet >Priority: Major > Fix For: 3.8.6, 3.9.0, 4.0.0-alpha-1, 4.0.0 > > > Simplify the way how boxed messages, e.g., for non-threadsafe plugins is > created. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Commented] (MNG-7486) Create a multiline message helper for boxed log messages
[ https://issues.apache.org/jira/browse/MNG-7486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543634#comment-17543634 ] Hudson commented on MNG-7486: - Build succeeded in Jenkins: Maven » Maven TLP » maven » master #53 See https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven/job/master/53/ > Create a multiline message helper for boxed log messages > > > Key: MNG-7486 > URL: https://issues.apache.org/jira/browse/MNG-7486 > Project: Maven > Issue Type: New Feature >Reporter: Michael Osipov >Assignee: Guillaume Nodet >Priority: Major > Fix For: 3.8.6, 3.9.0, 4.0.0-alpha-1, 4.0.0 > > > Simplify the way how boxed messages, e.g., for non-threadsafe plugins is > created. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Commented] (MNG-7486) Create a multiline message helper for boxed log messages
[ https://issues.apache.org/jira/browse/MNG-7486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543635#comment-17543635 ] Hudson commented on MNG-7486: - Build succeeded in Jenkins: Maven » Maven TLP » maven » maven-3.8.x #25 See https://ci-maven.apache.org/job/Maven/job/maven-box/job/maven/job/maven-3.8.x/25/ > Create a multiline message helper for boxed log messages > > > Key: MNG-7486 > URL: https://issues.apache.org/jira/browse/MNG-7486 > Project: Maven > Issue Type: New Feature >Reporter: Michael Osipov >Assignee: Guillaume Nodet >Priority: Major > Fix For: 3.8.6, 3.9.0, 4.0.0-alpha-1, 4.0.0 > > > Simplify the way how boxed messages, e.g., for non-threadsafe plugins is > created. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Commented] (MENFORCER-420) Reuse getDependenciesToCheck results across rules
[ https://issues.apache.org/jira/browse/MENFORCER-420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543638#comment-17543638 ] Joseph Walton commented on MENFORCER-420: - That makes sense; adding it to the Helper is a nice way to get an execution-scoped cache without having to thread a new object through all the calls. I've updated the PR. One downside is that it will not longer be shared _across_ executions. Our current configuration uses several distinct executions with their own {{{}{}}}. However, I think adapting our build is reasonable, and the isolation from other state is worth it. > Reuse getDependenciesToCheck results across rules > - > > Key: MENFORCER-420 > URL: https://issues.apache.org/jira/browse/MENFORCER-420 > Project: Maven Enforcer Plugin > Issue Type: Improvement > Components: Standard Rules >Reporter: Joseph Walton >Priority: Minor > > We have a build with a significant number of dependencies, and also a large > number of {{}} rules. Together, they lead to a build > where Enforcer takes tens of minutes. > Looking into bottlenecks, we found that > {{AbstractBanDependencies#getDependenciesToCheck}} was taking a significant > proportion of the build time (tens of percent). This method is called once > per rule, so it's recalculating the dependencies for every rule across every > execution. > Introducing a cache, to reuse the dependencies one they'd been calculated for > a module, dropped the time spent in banned dependency enforcement by about > 75%, which was reflected as a 60% improvement in the time of that build. > Our local implementation used the {{org.codehaus.plexus.context.Context}} to > store the dependencies keyed by the concatenation of {{MavenProject#getId}} > and {{searchTransitive}}; there may be a more appropriate scope to avoid edge > cases with complex configurations. -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven-enforcer] slawekjaranowski commented on a diff in pull request #152: MENFORCER-420: cache dependencies across rules
slawekjaranowski commented on code in PR #152: URL: https://github.com/apache/maven-enforcer/pull/152#discussion_r884274320 ## enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.java: ## @@ -131,4 +132,13 @@ List getComponentList ( String role ) * @return the container */ PlexusContainer getContainer(); + +/** + * Gets a cached value, or uses the provided producer to compute it. + * + * @param key a key to identify the value stored + * @param producer a supplier for the value if it's not already present + * @return a previously-cached or freshly-computed value + */ +Object getCache( String key, Supplier producer ); Review Comment: What do you think about use generic here?, eg ``` T getCache( String key, Supplier producer ); ``` of course we have cast in method implementation, but it will be in one place, not in every place where method will be used. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven] michael-o commented on a diff in pull request #736: [3.8.x] [MNG-7476] Display a warning when an aggregator mojo locks other mojos executions
michael-o commented on code in PR #736: URL: https://github.com/apache/maven/pull/736#discussion_r884276548 ## maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java: ## @@ -220,20 +223,44 @@ private void execute( MavenSession session, MojoExecution mojoExecution, Project * TODO: ideally, the builder should take care of the ordering in a smarter way * TODO: and concurrency issues fixed with MNG-7157 */ -private static class ProjectLock implements AutoCloseable +private class ProjectLock implements AutoCloseable { final Lock acquiredAggregatorLock; -final Lock acquiredProjectLock; +final OwnerReentrantLock acquiredProjectLock; -ProjectLock( MavenSession session, MojoDescriptor mojoDescriptor, ReadWriteLock aggregatorLock ) +ProjectLock( MavenSession session, MojoDescriptor mojoDescriptor ) { +mojos.put( Thread.currentThread(), mojoDescriptor ); Review Comment: this duplicates https://github.com/apache/maven/pull/736/files#diff-afa12cb60ed6ee8f6ad777fc0a0b4db1726b94306d7bda74f930ee95a27a9195R350. Intended? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (MNG-7476) Display a warning when an aggregator mojo is locking other mojo executions
[ https://issues.apache.org/jira/browse/MNG-7476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543642#comment-17543642 ] ASF GitHub Bot commented on MNG-7476: - michael-o commented on code in PR #736: URL: https://github.com/apache/maven/pull/736#discussion_r884276548 ## maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java: ## @@ -220,20 +223,44 @@ private void execute( MavenSession session, MojoExecution mojoExecution, Project * TODO: ideally, the builder should take care of the ordering in a smarter way * TODO: and concurrency issues fixed with MNG-7157 */ -private static class ProjectLock implements AutoCloseable +private class ProjectLock implements AutoCloseable { final Lock acquiredAggregatorLock; -final Lock acquiredProjectLock; +final OwnerReentrantLock acquiredProjectLock; -ProjectLock( MavenSession session, MojoDescriptor mojoDescriptor, ReadWriteLock aggregatorLock ) +ProjectLock( MavenSession session, MojoDescriptor mojoDescriptor ) { +mojos.put( Thread.currentThread(), mojoDescriptor ); Review Comment: this duplicates https://github.com/apache/maven/pull/736/files#diff-afa12cb60ed6ee8f6ad777fc0a0b4db1726b94306d7bda74f930ee95a27a9195R350. Intended? > Display a warning when an aggregator mojo is locking other mojo executions > -- > > Key: MNG-7476 > URL: https://issues.apache.org/jira/browse/MNG-7476 > Project: Maven > Issue Type: Improvement >Affects Versions: 3.8.5 >Reporter: Guillaume Nodet >Assignee: Guillaume Nodet >Priority: Major > Fix For: 3.8.6, 3.9.0, 4.0.0-alpha-1, 4.0.0 > > -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven] michael-o commented on pull request #736: [3.8.x] [MNG-7476] Display a warning when an aggregator mojo locks other mojos executions
michael-o commented on PR #736: URL: https://github.com/apache/maven/pull/736#issuecomment-1140458035 Moved message helper to https://github.com/apache/maven/pull/746. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (MNG-7476) Display a warning when an aggregator mojo is locking other mojo executions
[ https://issues.apache.org/jira/browse/MNG-7476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543646#comment-17543646 ] ASF GitHub Bot commented on MNG-7476: - michael-o commented on PR #736: URL: https://github.com/apache/maven/pull/736#issuecomment-1140458035 Moved message helper to https://github.com/apache/maven/pull/746. > Display a warning when an aggregator mojo is locking other mojo executions > -- > > Key: MNG-7476 > URL: https://issues.apache.org/jira/browse/MNG-7476 > Project: Maven > Issue Type: Improvement >Affects Versions: 3.8.5 >Reporter: Guillaume Nodet >Assignee: Guillaume Nodet >Priority: Major > Fix For: 3.8.6, 3.9.0, 4.0.0-alpha-1, 4.0.0 > > -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven-release] hboutemy opened a new pull request, #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
hboutemy opened a new pull request, #135: URL: https://github.com/apache/maven-release/pull/135 https://issues.apache.org/jira/browse/MRELEASE-1097 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] michael-o commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
michael-o commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884282247 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractMapVersionsPhase.java: ## @@ -308,9 +309,8 @@ else if ( releaseDescriptor.isBranchCreation() ) { messageKey = getMapversionPromptKey( releaseDescriptor ); } -String message = -MessageFormat.format( resourceBundle.getString( messageKey ), project.getName(), -projectId ); +String message = MessageFormat.format( resourceBundle.getString( messageKey ), project.getName(), Review Comment: I wonder whether those bundles were of use at all during the last couple of years. I consider then pointless because other messages are hardcoded as well. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven] michael-o commented on pull request #736: [3.8.x] [MNG-7476] Display a warning when an aggregator mojo locks other mojos executions
michael-o commented on PR #736: URL: https://github.com/apache/maven/pull/736#issuecomment-1140466025 > > > > @gnodet Can the reproducer be turned into an IT? > > > > > > > > > I suppose. The failure would lead to a deadlock. is there a timeout that can be set in the invoker ? > > > > > > @slawekjaranowski Do you know this from top of your head? > > There is no implementation for timeouts in Verifier. I have checked the source code of verifier. The lower level library supports timeouts in seconds, so we just need to wrap this with verifier. The JVM must be forked for this, so if timeout is > 0 and forkMode is auto, then autoforking must happen. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (MNG-7476) Display a warning when an aggregator mojo is locking other mojo executions
[ https://issues.apache.org/jira/browse/MNG-7476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543651#comment-17543651 ] ASF GitHub Bot commented on MNG-7476: - michael-o commented on PR #736: URL: https://github.com/apache/maven/pull/736#issuecomment-1140466025 > > > > @gnodet Can the reproducer be turned into an IT? > > > > > > > > > I suppose. The failure would lead to a deadlock. is there a timeout that can be set in the invoker ? > > > > > > @slawekjaranowski Do you know this from top of your head? > > There is no implementation for timeouts in Verifier. I have checked the source code of verifier. The lower level library supports timeouts in seconds, so we just need to wrap this with verifier. The JVM must be forked for this, so if timeout is > 0 and forkMode is auto, then autoforking must happen. > Display a warning when an aggregator mojo is locking other mojo executions > -- > > Key: MNG-7476 > URL: https://issues.apache.org/jira/browse/MNG-7476 > Project: Maven > Issue Type: Improvement >Affects Versions: 3.8.5 >Reporter: Guillaume Nodet >Assignee: Guillaume Nodet >Priority: Major > Fix For: 3.8.6, 3.9.0, 4.0.0-alpha-1, 4.0.0 > > -- This message was sent by Atlassian Jira (v8.20.7#820007)
[jira] [Updated] (MNG-7433) [REGRESSION] Multiple maven instances working on same source tree can lock each other
[ https://issues.apache.org/jira/browse/MNG-7433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Osipov updated MNG-7433: Fix Version/s: 3.8.6 3.9.0 4.0.0-alpha-1 4.0.0 > [REGRESSION] Multiple maven instances working on same source tree can lock > each other > - > > Key: MNG-7433 > URL: https://issues.apache.org/jira/browse/MNG-7433 > Project: Maven > Issue Type: Bug >Affects Versions: 3.8.5 >Reporter: Dan Tran >Assignee: Guillaume Nodet >Priority: Major > Fix For: 3.8.6, 3.9.0, 4.0.0-alpha-1, 4.0.0 > > > I have a large multi modules java maven build where: > * phase 1 - basic build + unit tests + jacoco - 40 min > * phase 2 - sonar:sonar 20 min > * phase 3 - final packaging and basic smoke-test - 20 min > To take advantage of Maven multi-threaded build, during the reactor build, > one of our maven module spins another instance of Maven to run sonar:sonar > goal right after the basic build is done. > This means our phase 2 and phase 3 run in parallel sharing the same source > tree, same local maven repo (where sonar:sonar should have all needed > dependencies at the share local maven repo to run its task) > With maven-3.8.5, parallelization is no longer possible, phase 3 is blocked > until phase 2 is done. > I am able to trace it to https://github.com/apache/maven/pull/628 where the > locking started the happen > How does the lock mechanic work? there must be a local file where both Maven > instances are watching each other. Is there an option to disable this lock? -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven-release] hboutemy commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
hboutemy commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884285645 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractMapVersionsPhase.java: ## @@ -308,9 +309,8 @@ else if ( releaseDescriptor.isBranchCreation() ) { messageKey = getMapversionPromptKey( releaseDescriptor ); } -String message = -MessageFormat.format( resourceBundle.getString( messageKey ), project.getName(), -projectId ); +String message = MessageFormat.format( resourceBundle.getString( messageKey ), project.getName(), Review Comment: this can be a simplification for later, why not -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] michael-o commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
michael-o commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884286659 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractMapVersionsPhase.java: ## @@ -308,9 +309,8 @@ else if ( releaseDescriptor.isBranchCreation() ) { messageKey = getMapversionPromptKey( releaseDescriptor ); } -String message = -MessageFormat.format( resourceBundle.getString( messageKey ), project.getName(), -projectId ); +String message = MessageFormat.format( resourceBundle.getString( messageKey ), project.getName(), Review Comment: I prefer it. It never has got traction. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] michael-o commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
michael-o commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884286863 ## maven-release-manager/pom.xml: ## @@ -238,9 +238,7 @@ - xpp3-reader Review Comment: No model necessary anymore? ## maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java: ## @@ -560,15 +559,10 @@ private ReleaseDescriptorBuilder loadReleaseDescriptorBuilder( ReleaseDescriptor { try { -updateListener( listener, "verify-release-configuration", PHASE_START ); -ReleaseDescriptorBuilder result = configStore.get().read( builder ); -updateListener( listener, "verify-release-configuration", PHASE_END ); -return result; +return configStore.get().read( builder ); } catch ( ReleaseDescriptorStoreException e ) { -updateListener( listener, e.getMessage(), ERROR ); Review Comment: Why is this information not necessary anymore? ## maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java: ## @@ -616,8 +608,6 @@ public void clean( ReleaseCleanRequest cleanRequest ) throws ReleaseFailureExcep ( (ResourceGenerator) phase ).clean( cleanRequest.getReactorProjects() ); } } - -updateListener( cleanRequest.getReleaseManagerListener(), "cleanup", PHASE_END ); Review Comment: Why is this information not necessary anymore? ## maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java: ## @@ -270,13 +270,19 @@ public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, ReleaseEnvir { ReleaseResult result = new ReleaseResult(); +MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects ); +File checkoutDirectory = +FileUtils.resolveFile( rootProject.getBasedir(), releaseDescriptor.getCheckoutDirectory() ); + if ( releaseDescriptor.isLocalCheckout() ) { -logInfo( result, "This would be a LOCAL check out to perform the release ..." ); +logInfo( result, + "This would be a LOCAL check out to perform the release from " + checkoutDirectory + "..." ); Review Comment: I prefer a strong on `local` rather than shouting it out load in upper case. ## maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java: ## @@ -726,7 +732,10 @@ private void logInfo( ReleaseResult result, String message ) private void captureException( ReleaseResult result, ReleaseManagerListener listener, Exception e ) { -updateListener( listener, e.getMessage(), ERROR ); +if ( listener != null ) +{ +listener.error( e.getMessage() ); Review Comment: Pity that exception object is lost ## maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java: ## @@ -199,9 +201,15 @@ private void transform( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment { result.setStartTime( ( startTime >= 0 ) ? startTime : System.currentTimeMillis() ); +URI root = ReleaseUtil.getRootProject( reactorProjects ).getBasedir().toURI(); + for ( MavenProject project : reactorProjects ) { -logInfo( result, "Transforming '" + project.getName() + "'..." ); +URI pom = project.getFile().toURI(); +logInfo( result, + "Transforming " + root.relativize( pom ).getPath() + ' ' Review Comment: I believe that `URI` is not necessary here, but `Path` can make it relative too, no? ## maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRunGoalsPhase.java: ## @@ -71,11 +72,12 @@ protected ReleaseResult execute( ReleaseDescriptor releaseDescriptor, ReleaseEnv String goals = getGoals( releaseDescriptor ); if ( !StringUtils.isEmpty( goals ) ) { -logInfo( result, "Executing goals '" + goals + "'..." ); -if ( logArguments && ( additionalArguments != null ) ) +logInfo( result, "Executing goals '" + buffer().strong( goals ) + "'..." ); Review Comment: Why not `#mojo()`? ## maven-release-plugin/src/site/apt/examples/perform-release.apt.vm: ## @@ -29,7 +29,7 @@ Perform a Release Performing a release runs the following release phases {{{../../maven-release-manager/#perform}by default}}: - * Checkout from an SCM URL with optional tag + * Checkout from an SCM URL with optional tag to <<>> (<<>> by default) Review Comment: I'd prefer to use the official property instead of default `target`. ##
[GitHub] [maven-release] hboutemy commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
hboutemy commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884299737 ## maven-release-manager/pom.xml: ## @@ -238,9 +238,7 @@ - xpp3-reader Review Comment: model is useful, ie java classes but there is no XML read/write with XPP3 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] hboutemy commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
hboutemy commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884299924 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java: ## @@ -560,15 +559,10 @@ private ReleaseDescriptorBuilder loadReleaseDescriptorBuilder( ReleaseDescriptor { try { -updateListener( listener, "verify-release-configuration", PHASE_START ); -ReleaseDescriptorBuilder result = configStore.get().read( builder ); -updateListener( listener, "verify-release-configuration", PHASE_END ); -return result; Review Comment: the log is not useful, and it's even confusing because it writes as a phase, but it's not = the initial intent of this whole Jira issue -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] hboutemy commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
hboutemy commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884300187 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java: ## @@ -560,15 +559,10 @@ private ReleaseDescriptorBuilder loadReleaseDescriptorBuilder( ReleaseDescriptor { try { -updateListener( listener, "verify-release-configuration", PHASE_START ); -ReleaseDescriptorBuilder result = configStore.get().read( builder ); -updateListener( listener, "verify-release-configuration", PHASE_END ); -return result; +return configStore.get().read( builder ); } catch ( ReleaseDescriptorStoreException e ) { -updateListener( listener, e.getMessage(), ERROR ); Review Comment: same as previous: it's not a phase and the error will be reported in the exception -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] hboutemy commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
hboutemy commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884300250 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java: ## @@ -592,8 +586,6 @@ protected void clean( AbstractReleaseRequest releaseRequest ) throws ReleaseFai @Override public void clean( ReleaseCleanRequest cleanRequest ) throws ReleaseFailureException { -updateListener( cleanRequest.getReleaseManagerListener(), "cleanup", PHASE_START ); Review Comment: same "non phase" message that creates confusion when it looks as a phase ## maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java: ## @@ -592,8 +586,6 @@ protected void clean( AbstractReleaseRequest releaseRequest ) throws ReleaseFai @Override public void clean( ReleaseCleanRequest cleanRequest ) throws ReleaseFailureException { -updateListener( cleanRequest.getReleaseManagerListener(), "cleanup", PHASE_START ); Review Comment: same "non phase" message that creates confusion when it looks like a phase -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] hboutemy commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
hboutemy commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884300327 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java: ## @@ -616,8 +608,6 @@ public void clean( ReleaseCleanRequest cleanRequest ) throws ReleaseFailureExcep ( (ResourceGenerator) phase ).clean( cleanRequest.getReactorProjects() ); } } - -updateListener( cleanRequest.getReleaseManagerListener(), "cleanup", PHASE_END ); Review Comment: same -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-resolver] cstamas commented on a diff in pull request #182: [MRESOLVER-262] Provide contextual data in trace during collect
cstamas commented on code in PR #182: URL: https://github.com/apache/maven-resolver/pull/182#discussion_r884300349 ## maven-resolver-demos/maven-resolver-demo-snippets/src/main/java/org/apache/maven/resolver/examples/util/ReverseTreeRepositoryListener.java: ## @@ -0,0 +1,113 @@ +package org.apache.maven.resolver.examples.util; + +/* + * 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. + */ + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ListIterator; +import java.util.Objects; + +import org.eclipse.aether.AbstractRepositoryListener; +import org.eclipse.aether.RepositoryEvent; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.collection.CollectStepData; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; + +import static java.util.Objects.requireNonNull; + +/** + * A demo class building reverse tree using {@link CollectStepData} trace data provided in {@link RepositoryEvent} + * events fired during collection. + */ +public class ReverseTreeRepositoryListener +extends AbstractRepositoryListener +{ +@Override +public void artifactResolved( RepositoryEvent event ) +{ +requireNonNull( event, "event cannot be null" ); + +RequestTrace trace = event.getTrace(); +CollectStepData collectStepTrace = null; +while ( trace != null ) +{ +if ( trace.getData() instanceof CollectStepData ) +{ +collectStepTrace = (CollectStepData) trace.getData(); +break; +} +trace = trace.getParent(); +} + +if ( collectStepTrace == null ) +{ +return; +} + +Artifact resolvedArtifact = event.getArtifact(); +Artifact nodeArtifact = collectStepTrace.getNode().getArtifact(); + +if ( isInScope( resolvedArtifact, nodeArtifact ) ) +{ +Dependency node = collectStepTrace.getNode(); +String trackingData = node.toString() + " (" + collectStepTrace.getContext() + ")\n"; +String indent = ""; +ListIterator iter = collectStepTrace.getPath() +.listIterator( collectStepTrace.getPath().size() ); +while ( iter.hasPrevious() ) +{ +DependencyNode curr = iter.previous(); +indent += " "; +trackingData += indent + curr + " (" + collectStepTrace.getContext() + ")\n"; +} +try +{ +Path trackingDir = resolvedArtifact.getFile().getParentFile().toPath().resolve( ".tracking" ); +Files.createDirectories( trackingDir ); +Path trackingFile = trackingDir.resolve( collectStepTrace.getPath().get( 0 ) +.getArtifact().toString().replace( ":", "_" ) ); +Files.write( trackingFile, trackingData.getBytes( StandardCharsets.UTF_8 ) ); +System.out.println( trackingData ); +} +catch ( IOException e ) +{ +throw new UncheckedIOException( e ); +} +} +} + +/** + * The event "artifact resolved" if fired WHENEVER an artifact is resolved, BUT, it happens also when an artifact + * descriptor (model, the POM) is being built, and parent (and parent of parent...) is being asked for. Hence, this + * method "filters" out in WHICH artifact are we interested in, but it intentionally neglects extension, as + * ArtifactDescriptorReader modifies extension to "pom" during collect. So all we have to rely on is GAV only. + */ +private boolean isInScope( Artifact artifact, Artifact nodeArtifact ) +{ +return Objects.equals( artifact.getGroupId(), nodeArtifact.getGroupId() ) +&& Objects.equals( artifact.getArtifactId(), nodeArtifact.getArtifactId() ) +&& Objects.equals( artifact.getVersion(), nodeArtifact.getVersion() ); +} Review Comment: No, it doe
[jira] [Commented] (MRESOLVER-262) Provide contextual data in trace data for collector invoked requests
[ https://issues.apache.org/jira/browse/MRESOLVER-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543665#comment-17543665 ] ASF GitHub Bot commented on MRESOLVER-262: -- cstamas commented on code in PR #182: URL: https://github.com/apache/maven-resolver/pull/182#discussion_r884300349 ## maven-resolver-demos/maven-resolver-demo-snippets/src/main/java/org/apache/maven/resolver/examples/util/ReverseTreeRepositoryListener.java: ## @@ -0,0 +1,113 @@ +package org.apache.maven.resolver.examples.util; + +/* + * 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. + */ + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ListIterator; +import java.util.Objects; + +import org.eclipse.aether.AbstractRepositoryListener; +import org.eclipse.aether.RepositoryEvent; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.collection.CollectStepData; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; + +import static java.util.Objects.requireNonNull; + +/** + * A demo class building reverse tree using {@link CollectStepData} trace data provided in {@link RepositoryEvent} + * events fired during collection. + */ +public class ReverseTreeRepositoryListener +extends AbstractRepositoryListener +{ +@Override +public void artifactResolved( RepositoryEvent event ) +{ +requireNonNull( event, "event cannot be null" ); + +RequestTrace trace = event.getTrace(); +CollectStepData collectStepTrace = null; +while ( trace != null ) +{ +if ( trace.getData() instanceof CollectStepData ) +{ +collectStepTrace = (CollectStepData) trace.getData(); +break; +} +trace = trace.getParent(); +} + +if ( collectStepTrace == null ) +{ +return; +} + +Artifact resolvedArtifact = event.getArtifact(); +Artifact nodeArtifact = collectStepTrace.getNode().getArtifact(); + +if ( isInScope( resolvedArtifact, nodeArtifact ) ) +{ +Dependency node = collectStepTrace.getNode(); +String trackingData = node.toString() + " (" + collectStepTrace.getContext() + ")\n"; +String indent = ""; +ListIterator iter = collectStepTrace.getPath() +.listIterator( collectStepTrace.getPath().size() ); +while ( iter.hasPrevious() ) +{ +DependencyNode curr = iter.previous(); +indent += " "; +trackingData += indent + curr + " (" + collectStepTrace.getContext() + ")\n"; +} +try +{ +Path trackingDir = resolvedArtifact.getFile().getParentFile().toPath().resolve( ".tracking" ); +Files.createDirectories( trackingDir ); +Path trackingFile = trackingDir.resolve( collectStepTrace.getPath().get( 0 ) +.getArtifact().toString().replace( ":", "_" ) ); +Files.write( trackingFile, trackingData.getBytes( StandardCharsets.UTF_8 ) ); +System.out.println( trackingData ); +} +catch ( IOException e ) +{ +throw new UncheckedIOException( e ); +} +} +} + +/** + * The event "artifact resolved" if fired WHENEVER an artifact is resolved, BUT, it happens also when an artifact + * descriptor (model, the POM) is being built, and parent (and parent of parent...) is being asked for. Hence, this + * method "filters" out in WHICH artifact are we interested in, but it intentionally neglects extension, as + * ArtifactDescriptorReader modifies extension to "pom" during collect. So all we have to rely on is GAV only. + */ +private boolean isInScope( Artifact artifact, Artifact nodeArtifact ) +{ +return Objects.equals( artifact
[GitHub] [maven-resolver] cstamas commented on pull request #182: [MRESOLVER-262] Provide contextual data in trace during collect
cstamas commented on PR #182: URL: https://github.com/apache/maven-resolver/pull/182#issuecomment-1140489240 > How does this change the message usage when this type of information is collected by default? I don't quite get the question here... -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] hboutemy commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
hboutemy commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884300426 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java: ## @@ -726,7 +732,10 @@ private void logInfo( ReleaseResult result, String message ) private void captureException( ReleaseResult result, ReleaseManagerListener listener, Exception e ) { -updateListener( listener, e.getMessage(), ERROR ); +if ( listener != null ) +{ +listener.error( e.getMessage() ); Review Comment: it's just for a basic log line: immediately, the exception will be thrown wrapped in a MojoException -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (MRESOLVER-262) Provide contextual data in trace data for collector invoked requests
[ https://issues.apache.org/jira/browse/MRESOLVER-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543666#comment-17543666 ] ASF GitHub Bot commented on MRESOLVER-262: -- cstamas commented on PR #182: URL: https://github.com/apache/maven-resolver/pull/182#issuecomment-1140489240 > How does this change the message usage when this type of information is collected by default? I don't quite get the question here... > Provide contextual data in trace data for collector invoked requests > > > Key: MRESOLVER-262 > URL: https://issues.apache.org/jira/browse/MRESOLVER-262 > Project: Maven Resolver > Issue Type: Task > Components: Resolver >Reporter: Tamás Cservenák >Priority: Major > Fix For: 1.8.1 > > > During collection several RepositoryEvents are fired, but they does not carry > any context related data regarding artifact collection. > Simplest solution would be to extend RequestTrace to provide: > * request context > * the artifact path (from root to leaf) > * leaf artifact being collected -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven-release] hboutemy commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
hboutemy commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884300524 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManagerListener.java: ## @@ -86,16 +86,9 @@ public void goalStart( String goal, List phases ) public void phaseStart( String name ) { -if ( goal == null || ( ( currentPhase + 1 ) >= phases.size() ) ) Review Comment: this code that had to take care of "phases" not in a goal is the proof that it was not a phase :) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] michael-o commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
michael-o commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884300591 ## maven-release-manager/pom.xml: ## @@ -238,9 +238,7 @@ - xpp3-reader Review Comment: Alright! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] michael-o commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
michael-o commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884300620 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java: ## @@ -560,15 +559,10 @@ private ReleaseDescriptorBuilder loadReleaseDescriptorBuilder( ReleaseDescriptor { try { -updateListener( listener, "verify-release-configuration", PHASE_START ); -ReleaseDescriptorBuilder result = configStore.get().read( builder ); -updateListener( listener, "verify-release-configuration", PHASE_END ); -return result; Review Comment: Agreed. ## maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java: ## @@ -592,8 +586,6 @@ protected void clean( AbstractReleaseRequest releaseRequest ) throws ReleaseFai @Override public void clean( ReleaseCleanRequest cleanRequest ) throws ReleaseFailureException { -updateListener( cleanRequest.getReleaseManagerListener(), "cleanup", PHASE_START ); Review Comment: Agreed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] michael-o commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
michael-o commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884300638 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java: ## @@ -616,8 +608,6 @@ public void clean( ReleaseCleanRequest cleanRequest ) throws ReleaseFailureExcep ( (ResourceGenerator) phase ).clean( cleanRequest.getReactorProjects() ); } } - -updateListener( cleanRequest.getReleaseManagerListener(), "cleanup", PHASE_END ); Review Comment: Agreed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] michael-o commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
michael-o commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884300657 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java: ## @@ -726,7 +732,10 @@ private void logInfo( ReleaseResult result, String message ) private void captureException( ReleaseResult result, ReleaseManagerListener listener, Exception e ) { -updateListener( listener, e.getMessage(), ERROR ); +if ( listener != null ) +{ +listener.error( e.getMessage() ); Review Comment: Makes sense! ## maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java: ## @@ -560,15 +559,10 @@ private ReleaseDescriptorBuilder loadReleaseDescriptorBuilder( ReleaseDescriptor { try { -updateListener( listener, "verify-release-configuration", PHASE_START ); -ReleaseDescriptorBuilder result = configStore.get().read( builder ); -updateListener( listener, "verify-release-configuration", PHASE_END ); -return result; +return configStore.get().read( builder ); } catch ( ReleaseDescriptorStoreException e ) { -updateListener( listener, e.getMessage(), ERROR ); Review Comment: Agreed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] hboutemy commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
hboutemy commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884300675 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java: ## @@ -199,9 +201,15 @@ private void transform( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment { result.setStartTime( ( startTime >= 0 ) ? startTime : System.currentTimeMillis() ); +URI root = ReleaseUtil.getRootProject( reactorProjects ).getBasedir().toURI(); + for ( MavenProject project : reactorProjects ) { -logInfo( result, "Transforming '" + project.getName() + "'..." ); +URI pom = project.getFile().toURI(); +logInfo( result, + "Transforming " + root.relativize( pom ).getPath() + ' ' Review Comment: I suppose going through a Path instead of an URI gives the exact same code/complexity/efficiency -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] hboutemy commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
hboutemy commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884300771 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRunGoalsPhase.java: ## @@ -71,11 +72,12 @@ protected ReleaseResult execute( ReleaseDescriptor releaseDescriptor, ReleaseEnv String goals = getGoals( releaseDescriptor ); if ( !StringUtils.isEmpty( goals ) ) { -logInfo( result, "Executing goals '" + goals + "'..." ); -if ( logArguments && ( additionalArguments != null ) ) +logInfo( result, "Executing goals '" + buffer().strong( goals ) + "'..." ); +if ( logArguments ) { // logging arguments may log secrets: should be activated only on dryRun -logInfo( result, "with additional arguments: " + additionalArguments ); +logInfo( result, "with additional arguments: " ++ ( additionalArguments == null ? "" : additionalArguments ) ); Review Comment: yes, not seeing that additional arguments were taken into account but were empty was confusing -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] hboutemy commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
hboutemy commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884300846 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java: ## @@ -270,13 +270,19 @@ public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, ReleaseEnvir { ReleaseResult result = new ReleaseResult(); +MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects ); +File checkoutDirectory = +FileUtils.resolveFile( rootProject.getBasedir(), releaseDescriptor.getCheckoutDirectory() ); + if ( releaseDescriptor.isLocalCheckout() ) { -logInfo( result, "This would be a LOCAL check out to perform the release ..." ); +logInfo( result, + "This would be a LOCAL check out to perform the release from " + checkoutDirectory + "..." ); Review Comment: good idea -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-resolver] michael-o commented on pull request #182: [MRESOLVER-262] Provide contextual data in trace during collect
michael-o commented on PR #182: URL: https://github.com/apache/maven-resolver/pull/182#issuecomment-1140490337 > > How does this change the message usage when this type of information is collected by default? > > I don't quite get the question here... Stupid typo: memory usage -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] hboutemy commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
hboutemy commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884300974 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPerformGoalsPhase.java: ## @@ -99,7 +101,7 @@ private ReleaseResult runLogic( ReleaseDescriptor releaseDescriptor, ReleaseEnvi { ReleaseResult result = new ReleaseResult(); -logInfo( result, "Simulating perform goals '" + getGoals( releaseDescriptor ) +logInfo( result, "Simulating perform goals '" + buffer().strong( getGoals( releaseDescriptor ) ) Review Comment: we're using this style to list every phase that is being run what goals will be invoked is a very different intent ## maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPerformGoalsPhase.java: ## @@ -99,7 +101,7 @@ private ReleaseResult runLogic( ReleaseDescriptor releaseDescriptor, ReleaseEnvi { ReleaseResult result = new ReleaseResult(); -logInfo( result, "Simulating perform goals '" + getGoals( releaseDescriptor ) +logInfo( result, "Simulating perform goals '" + buffer().strong( getGoals( releaseDescriptor ) ) Review Comment: good question... we're using this style to list every phase that is being run what goals will be invoked is a very different intent -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (MRESOLVER-262) Provide contextual data in trace data for collector invoked requests
[ https://issues.apache.org/jira/browse/MRESOLVER-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543667#comment-17543667 ] ASF GitHub Bot commented on MRESOLVER-262: -- michael-o commented on PR #182: URL: https://github.com/apache/maven-resolver/pull/182#issuecomment-1140490337 > > How does this change the message usage when this type of information is collected by default? > > I don't quite get the question here... Stupid typo: memory usage > Provide contextual data in trace data for collector invoked requests > > > Key: MRESOLVER-262 > URL: https://issues.apache.org/jira/browse/MRESOLVER-262 > Project: Maven Resolver > Issue Type: Task > Components: Resolver >Reporter: Tamás Cservenák >Priority: Major > Fix For: 1.8.1 > > > During collection several RepositoryEvents are fired, but they does not carry > any context related data regarding artifact collection. > Simplest solution would be to extend RequestTrace to provide: > * request context > * the artifact path (from root to leaf) > * leaf artifact being collected -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven-resolver] michael-o commented on a diff in pull request #182: [MRESOLVER-262] Provide contextual data in trace during collect
michael-o commented on code in PR #182: URL: https://github.com/apache/maven-resolver/pull/182#discussion_r884301025 ## maven-resolver-demos/maven-resolver-demo-snippets/src/main/java/org/apache/maven/resolver/examples/util/ReverseTreeRepositoryListener.java: ## @@ -44,6 +44,8 @@ public class ReverseTreeRepositoryListener extends AbstractRepositoryListener { +private static final String LINE_SEP = System.lineSeparator(); Review Comment: In most cases we even use `LS` or `EOL`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (MRESOLVER-262) Provide contextual data in trace data for collector invoked requests
[ https://issues.apache.org/jira/browse/MRESOLVER-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543668#comment-17543668 ] ASF GitHub Bot commented on MRESOLVER-262: -- michael-o commented on code in PR #182: URL: https://github.com/apache/maven-resolver/pull/182#discussion_r884301025 ## maven-resolver-demos/maven-resolver-demo-snippets/src/main/java/org/apache/maven/resolver/examples/util/ReverseTreeRepositoryListener.java: ## @@ -44,6 +44,8 @@ public class ReverseTreeRepositoryListener extends AbstractRepositoryListener { +private static final String LINE_SEP = System.lineSeparator(); Review Comment: In most cases we even use `LS` or `EOL`. > Provide contextual data in trace data for collector invoked requests > > > Key: MRESOLVER-262 > URL: https://issues.apache.org/jira/browse/MRESOLVER-262 > Project: Maven Resolver > Issue Type: Task > Components: Resolver >Reporter: Tamás Cservenák >Priority: Major > Fix For: 1.8.1 > > > During collection several RepositoryEvents are fired, but they does not carry > any context related data regarding artifact collection. > Simplest solution would be to extend RequestTrace to provide: > * request context > * the artifact path (from root to leaf) > * leaf artifact being collected -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven-resolver] cstamas commented on a diff in pull request #182: [MRESOLVER-262] Provide contextual data in trace during collect
cstamas commented on code in PR #182: URL: https://github.com/apache/maven-resolver/pull/182#discussion_r884300349 ## maven-resolver-demos/maven-resolver-demo-snippets/src/main/java/org/apache/maven/resolver/examples/util/ReverseTreeRepositoryListener.java: ## @@ -0,0 +1,113 @@ +package org.apache.maven.resolver.examples.util; + +/* + * 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. + */ + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ListIterator; +import java.util.Objects; + +import org.eclipse.aether.AbstractRepositoryListener; +import org.eclipse.aether.RepositoryEvent; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.collection.CollectStepData; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; + +import static java.util.Objects.requireNonNull; + +/** + * A demo class building reverse tree using {@link CollectStepData} trace data provided in {@link RepositoryEvent} + * events fired during collection. + */ +public class ReverseTreeRepositoryListener +extends AbstractRepositoryListener +{ +@Override +public void artifactResolved( RepositoryEvent event ) +{ +requireNonNull( event, "event cannot be null" ); + +RequestTrace trace = event.getTrace(); +CollectStepData collectStepTrace = null; +while ( trace != null ) +{ +if ( trace.getData() instanceof CollectStepData ) +{ +collectStepTrace = (CollectStepData) trace.getData(); +break; +} +trace = trace.getParent(); +} + +if ( collectStepTrace == null ) +{ +return; +} + +Artifact resolvedArtifact = event.getArtifact(); +Artifact nodeArtifact = collectStepTrace.getNode().getArtifact(); + +if ( isInScope( resolvedArtifact, nodeArtifact ) ) +{ +Dependency node = collectStepTrace.getNode(); +String trackingData = node.toString() + " (" + collectStepTrace.getContext() + ")\n"; +String indent = ""; +ListIterator iter = collectStepTrace.getPath() +.listIterator( collectStepTrace.getPath().size() ); +while ( iter.hasPrevious() ) +{ +DependencyNode curr = iter.previous(); +indent += " "; +trackingData += indent + curr + " (" + collectStepTrace.getContext() + ")\n"; +} +try +{ +Path trackingDir = resolvedArtifact.getFile().getParentFile().toPath().resolve( ".tracking" ); +Files.createDirectories( trackingDir ); +Path trackingFile = trackingDir.resolve( collectStepTrace.getPath().get( 0 ) +.getArtifact().toString().replace( ":", "_" ) ); +Files.write( trackingFile, trackingData.getBytes( StandardCharsets.UTF_8 ) ); +System.out.println( trackingData ); +} +catch ( IOException e ) +{ +throw new UncheckedIOException( e ); +} +} +} + +/** + * The event "artifact resolved" if fired WHENEVER an artifact is resolved, BUT, it happens also when an artifact + * descriptor (model, the POM) is being built, and parent (and parent of parent...) is being asked for. Hence, this + * method "filters" out in WHICH artifact are we interested in, but it intentionally neglects extension, as + * ArtifactDescriptorReader modifies extension to "pom" during collect. So all we have to rely on is GAV only. + */ +private boolean isInScope( Artifact artifact, Artifact nodeArtifact ) +{ +return Objects.equals( artifact.getGroupId(), nodeArtifact.getGroupId() ) +&& Objects.equals( artifact.getArtifactId(), nodeArtifact.getArtifactId() ) +&& Objects.equals( artifact.getVersion(), nodeArtifact.getVersion() ); +} Review Comment: No, it doe
[GitHub] [maven-release] hboutemy commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
hboutemy commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884301129 ## maven-release-plugin/src/site/apt/examples/perform-release.apt.vm: ## @@ -29,7 +29,7 @@ Perform a Release Performing a release runs the following release phases {{{../../maven-release-manager/#perform}by default}}: - * Checkout from an SCM URL with optional tag + * Checkout from an SCM URL with optional tag to <<>> (<<>> by default) Review Comment: it is documentation, not code: in code, the official property is used in documentation, I wrote the default value that is the concrete value that people know -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (MRESOLVER-262) Provide contextual data in trace data for collector invoked requests
[ https://issues.apache.org/jira/browse/MRESOLVER-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543669#comment-17543669 ] ASF GitHub Bot commented on MRESOLVER-262: -- cstamas commented on code in PR #182: URL: https://github.com/apache/maven-resolver/pull/182#discussion_r884300349 ## maven-resolver-demos/maven-resolver-demo-snippets/src/main/java/org/apache/maven/resolver/examples/util/ReverseTreeRepositoryListener.java: ## @@ -0,0 +1,113 @@ +package org.apache.maven.resolver.examples.util; + +/* + * 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. + */ + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ListIterator; +import java.util.Objects; + +import org.eclipse.aether.AbstractRepositoryListener; +import org.eclipse.aether.RepositoryEvent; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.collection.CollectStepData; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; + +import static java.util.Objects.requireNonNull; + +/** + * A demo class building reverse tree using {@link CollectStepData} trace data provided in {@link RepositoryEvent} + * events fired during collection. + */ +public class ReverseTreeRepositoryListener +extends AbstractRepositoryListener +{ +@Override +public void artifactResolved( RepositoryEvent event ) +{ +requireNonNull( event, "event cannot be null" ); + +RequestTrace trace = event.getTrace(); +CollectStepData collectStepTrace = null; +while ( trace != null ) +{ +if ( trace.getData() instanceof CollectStepData ) +{ +collectStepTrace = (CollectStepData) trace.getData(); +break; +} +trace = trace.getParent(); +} + +if ( collectStepTrace == null ) +{ +return; +} + +Artifact resolvedArtifact = event.getArtifact(); +Artifact nodeArtifact = collectStepTrace.getNode().getArtifact(); + +if ( isInScope( resolvedArtifact, nodeArtifact ) ) +{ +Dependency node = collectStepTrace.getNode(); +String trackingData = node.toString() + " (" + collectStepTrace.getContext() + ")\n"; +String indent = ""; +ListIterator iter = collectStepTrace.getPath() +.listIterator( collectStepTrace.getPath().size() ); +while ( iter.hasPrevious() ) +{ +DependencyNode curr = iter.previous(); +indent += " "; +trackingData += indent + curr + " (" + collectStepTrace.getContext() + ")\n"; +} +try +{ +Path trackingDir = resolvedArtifact.getFile().getParentFile().toPath().resolve( ".tracking" ); +Files.createDirectories( trackingDir ); +Path trackingFile = trackingDir.resolve( collectStepTrace.getPath().get( 0 ) +.getArtifact().toString().replace( ":", "_" ) ); +Files.write( trackingFile, trackingData.getBytes( StandardCharsets.UTF_8 ) ); +System.out.println( trackingData ); +} +catch ( IOException e ) +{ +throw new UncheckedIOException( e ); +} +} +} + +/** + * The event "artifact resolved" if fired WHENEVER an artifact is resolved, BUT, it happens also when an artifact + * descriptor (model, the POM) is being built, and parent (and parent of parent...) is being asked for. Hence, this + * method "filters" out in WHICH artifact are we interested in, but it intentionally neglects extension, as + * ArtifactDescriptorReader modifies extension to "pom" during collect. So all we have to rely on is GAV only. + */ +private boolean isInScope( Artifact artifact, Artifact nodeArtifact ) +{ +return Objects.equals( artifact
[GitHub] [maven-release] michael-o commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
michael-o commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884301513 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRunGoalsPhase.java: ## @@ -71,11 +72,12 @@ protected ReleaseResult execute( ReleaseDescriptor releaseDescriptor, ReleaseEnv String goals = getGoals( releaseDescriptor ); if ( !StringUtils.isEmpty( goals ) ) { -logInfo( result, "Executing goals '" + goals + "'..." ); -if ( logArguments && ( additionalArguments != null ) ) +logInfo( result, "Executing goals '" + buffer().strong( goals ) + "'..." ); +if ( logArguments ) { // logging arguments may log secrets: should be activated only on dryRun -logInfo( result, "with additional arguments: " + additionalArguments ); +logInfo( result, "with additional arguments: " ++ ( additionalArguments == null ? "" : additionalArguments ) ); Review Comment: Maybe this is just a matter of taste, but was about: `(none)` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] michael-o commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
michael-o commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884301575 ## maven-release-plugin/src/site/apt/examples/perform-release.apt.vm: ## @@ -29,7 +29,7 @@ Perform a Release Performing a release runs the following release phases {{{../../maven-release-manager/#perform}by default}}: - * Checkout from an SCM URL with optional tag + * Checkout from an SCM URL with optional tag to <<>> (<<>> by default) Review Comment: Alright, makes sense. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] michael-o commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
michael-o commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884282247 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractMapVersionsPhase.java: ## @@ -308,9 +309,8 @@ else if ( releaseDescriptor.isBranchCreation() ) { messageKey = getMapversionPromptKey( releaseDescriptor ); } -String message = -MessageFormat.format( resourceBundle.getString( messageKey ), project.getName(), -projectId ); +String message = MessageFormat.format( resourceBundle.getString( messageKey ), project.getName(), Review Comment: I wonder whether those bundles were of use at all during the last couple of years. I consider them pointless because other messages are hardcoded as well. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Created] (MRELEASE-1098) Drop o.a.m.shared.release.env.ReleaseEnvironment.getLocale() and message bundles
Michael Osipov created MRELEASE-1098: Summary: Drop o.a.m.shared.release.env.ReleaseEnvironment.getLocale() and message bundles Key: MRELEASE-1098 URL: https://issues.apache.org/jira/browse/MRELEASE-1098 Project: Maven Release Plugin Issue Type: Task Affects Versions: 3.0.0-M5 Reporter: Michael Osipov Fix For: 3.0.0-M6 No bundles are translated, all our code is English, nothing else. Other messages aren't even externalized. It makes not sense to provide an unused option. See also: https://github.com/apache/maven-release/pull/135#discussion_r884282247 -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven-release] michael-o commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
michael-o commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884301793 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractMapVersionsPhase.java: ## @@ -308,9 +309,8 @@ else if ( releaseDescriptor.isBranchCreation() ) { messageKey = getMapversionPromptKey( releaseDescriptor ); } -String message = -MessageFormat.format( resourceBundle.getString( messageKey ), project.getName(), -projectId ); +String message = MessageFormat.format( resourceBundle.getString( messageKey ), project.getName(), Review Comment: https://issues.apache.org/jira/browse/MRELEASE-1098 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] michael-o commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
michael-o commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884301848 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPerformGoalsPhase.java: ## @@ -99,7 +101,7 @@ private ReleaseResult runLogic( ReleaseDescriptor releaseDescriptor, ReleaseEnvi { ReleaseResult result = new ReleaseResult(); -logInfo( result, "Simulating perform goals '" + getGoals( releaseDescriptor ) +logInfo( result, "Simulating perform goals '" + buffer().strong( getGoals( releaseDescriptor ) ) Review Comment: Right, agreed! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-resolver] cstamas commented on a diff in pull request #182: [MRESOLVER-262] Provide contextual data in trace during collect
cstamas commented on code in PR #182: URL: https://github.com/apache/maven-resolver/pull/182#discussion_r884301868 ## maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DependencyCollectorDelegate.java: ## @@ -290,6 +290,33 @@ public final CollectResult collectDependencies( RepositorySystemSession session, return result; } +/** + * Creates child {@link RequestTrace} instance from passed in {@link RequestTrace} and parameters by creating + * {@link CollectStepDataImpl} instance out of passed in data. Caller must ensure that passed in parameters are + * NOT affected by threading (or that there is no multi threading involved). In other words, the passed in values + * should be immutable. + * + * @param trace The current trace instance. + * @param context The context from {@link CollectRequest#getRequestContext()}, never {@code null}. + * @param pathList representing the path of dependency nodes, never {@code null}. Caller must ensure, that this + *list does not change during the lifetime of the requested {@link RequestTrace} instance. If it may + *change, simplest is to pass here a copy of used list. + * @param nodeCurrently collected node, that collector came by following the passed in path. + * @return A child request trance instance, never {@code null}. + */ +protected RequestTrace collectStepTrace( RequestTrace trace, String context, List path, Review Comment: Am least certain about this method: it does "too little" IMHO. For example, it could just take a copy the passed in "path" parameter list, but OTOH, am unsure how big penalty (heap, GC wise) would this introduce. Hence, am leaving this decision (to copy or not copy the list) to subclass, as subclass should know does it requires a copy or not, or in other words, is it multi threaded or not. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (MRESOLVER-262) Provide contextual data in trace data for collector invoked requests
[ https://issues.apache.org/jira/browse/MRESOLVER-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543670#comment-17543670 ] ASF GitHub Bot commented on MRESOLVER-262: -- cstamas commented on code in PR #182: URL: https://github.com/apache/maven-resolver/pull/182#discussion_r884301868 ## maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DependencyCollectorDelegate.java: ## @@ -290,6 +290,33 @@ public final CollectResult collectDependencies( RepositorySystemSession session, return result; } +/** + * Creates child {@link RequestTrace} instance from passed in {@link RequestTrace} and parameters by creating + * {@link CollectStepDataImpl} instance out of passed in data. Caller must ensure that passed in parameters are + * NOT affected by threading (or that there is no multi threading involved). In other words, the passed in values + * should be immutable. + * + * @param trace The current trace instance. + * @param context The context from {@link CollectRequest#getRequestContext()}, never {@code null}. + * @param pathList representing the path of dependency nodes, never {@code null}. Caller must ensure, that this + *list does not change during the lifetime of the requested {@link RequestTrace} instance. If it may + *change, simplest is to pass here a copy of used list. + * @param nodeCurrently collected node, that collector came by following the passed in path. + * @return A child request trance instance, never {@code null}. + */ +protected RequestTrace collectStepTrace( RequestTrace trace, String context, List path, Review Comment: Am least certain about this method: it does "too little" IMHO. For example, it could just take a copy the passed in "path" parameter list, but OTOH, am unsure how big penalty (heap, GC wise) would this introduce. Hence, am leaving this decision (to copy or not copy the list) to subclass, as subclass should know does it requires a copy or not, or in other words, is it multi threaded or not. > Provide contextual data in trace data for collector invoked requests > > > Key: MRESOLVER-262 > URL: https://issues.apache.org/jira/browse/MRESOLVER-262 > Project: Maven Resolver > Issue Type: Task > Components: Resolver >Reporter: Tamás Cservenák >Priority: Major > Fix For: 1.8.1 > > > During collection several RepositoryEvents are fired, but they does not carry > any context related data regarding artifact collection. > Simplest solution would be to extend RequestTrace to provide: > * request context > * the artifact path (from root to leaf) > * leaf artifact being collected -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven-release] michael-o commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
michael-o commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884301967 ## maven-release-plugin/src/it/projects/perform/MRELEASE-818/verify.groovy: ## @@ -20,7 +20,7 @@ File buildLog = new File( basedir, 'build.log' ) assert buildLog.exists() -def localCheckoutExpr = /\Q[INFO] This would be a LOCAL check out to perform the release ...\E/ +def localCheckoutExpr = /\Q[INFO] This would be a LOCAL check out to perform the release from / Review Comment: Note, this will fail! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] michael-o commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
michael-o commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884302026 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManagerListener.java: ## @@ -86,16 +86,9 @@ public void goalStart( String goal, List phases ) public void phaseStart( String name ) { -if ( goal == null || ( ( currentPhase + 1 ) >= phases.size() ) ) Review Comment: Right. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-release] michael-o commented on a diff in pull request #135: [MRELEASE-1097] rework plugin output to clarify goal's phases
michael-o commented on code in PR #135: URL: https://github.com/apache/maven-release/pull/135#discussion_r884302074 ## maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java: ## @@ -199,9 +201,15 @@ private void transform( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment { result.setStartTime( ( startTime >= 0 ) ? startTime : System.currentTimeMillis() ); +URI root = ReleaseUtil.getRootProject( reactorProjects ).getBasedir().toURI(); + for ( MavenProject project : reactorProjects ) { -logInfo( result, "Transforming '" + project.getName() + "'..." ); +URI pom = project.getFile().toURI(); +logInfo( result, + "Transforming " + root.relativize( pom ).getPath() + ' ' Review Comment: True, but `URI` has its problems and `Path` is a new solid API. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-resolver] cstamas commented on a diff in pull request #182: [MRESOLVER-262] Provide contextual data in trace during collect
cstamas commented on code in PR #182: URL: https://github.com/apache/maven-resolver/pull/182#discussion_r884301868 ## maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DependencyCollectorDelegate.java: ## @@ -290,6 +290,33 @@ public final CollectResult collectDependencies( RepositorySystemSession session, return result; } +/** + * Creates child {@link RequestTrace} instance from passed in {@link RequestTrace} and parameters by creating + * {@link CollectStepDataImpl} instance out of passed in data. Caller must ensure that passed in parameters are + * NOT affected by threading (or that there is no multi threading involved). In other words, the passed in values + * should be immutable. + * + * @param trace The current trace instance. + * @param context The context from {@link CollectRequest#getRequestContext()}, never {@code null}. + * @param pathList representing the path of dependency nodes, never {@code null}. Caller must ensure, that this + *list does not change during the lifetime of the requested {@link RequestTrace} instance. If it may + *change, simplest is to pass here a copy of used list. + * @param nodeCurrently collected node, that collector came by following the passed in path. + * @return A child request trance instance, never {@code null}. + */ +protected RequestTrace collectStepTrace( RequestTrace trace, String context, List path, Review Comment: Am least certain about this method: it does "too little" IMHO. For example, it could just take a copy the passed in "path" parameter list, but OTOH, am unsure how big penalty (heap, GC wise) would this introduce. Hence, am leaving this decision (to copy or not copy the list) to subclass, as subclass should know does it requires a copy or not, or in other words, is it multi threaded or not. DF for sure does not need to copy it (reason more why not to copy it here). BF once goes to "multi threaded POM download" it may, but as I see, each thread will have it's own context, and context carries the list, so again, I see no need for list copy. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Commented] (MRESOLVER-262) Provide contextual data in trace data for collector invoked requests
[ https://issues.apache.org/jira/browse/MRESOLVER-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543673#comment-17543673 ] ASF GitHub Bot commented on MRESOLVER-262: -- cstamas commented on code in PR #182: URL: https://github.com/apache/maven-resolver/pull/182#discussion_r884301868 ## maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DependencyCollectorDelegate.java: ## @@ -290,6 +290,33 @@ public final CollectResult collectDependencies( RepositorySystemSession session, return result; } +/** + * Creates child {@link RequestTrace} instance from passed in {@link RequestTrace} and parameters by creating + * {@link CollectStepDataImpl} instance out of passed in data. Caller must ensure that passed in parameters are + * NOT affected by threading (or that there is no multi threading involved). In other words, the passed in values + * should be immutable. + * + * @param trace The current trace instance. + * @param context The context from {@link CollectRequest#getRequestContext()}, never {@code null}. + * @param pathList representing the path of dependency nodes, never {@code null}. Caller must ensure, that this + *list does not change during the lifetime of the requested {@link RequestTrace} instance. If it may + *change, simplest is to pass here a copy of used list. + * @param nodeCurrently collected node, that collector came by following the passed in path. + * @return A child request trance instance, never {@code null}. + */ +protected RequestTrace collectStepTrace( RequestTrace trace, String context, List path, Review Comment: Am least certain about this method: it does "too little" IMHO. For example, it could just take a copy the passed in "path" parameter list, but OTOH, am unsure how big penalty (heap, GC wise) would this introduce. Hence, am leaving this decision (to copy or not copy the list) to subclass, as subclass should know does it requires a copy or not, or in other words, is it multi threaded or not. DF for sure does not need to copy it (reason more why not to copy it here). BF once goes to "multi threaded POM download" it may, but as I see, each thread will have it's own context, and context carries the list, so again, I see no need for list copy. > Provide contextual data in trace data for collector invoked requests > > > Key: MRESOLVER-262 > URL: https://issues.apache.org/jira/browse/MRESOLVER-262 > Project: Maven Resolver > Issue Type: Task > Components: Resolver >Reporter: Tamás Cservenák >Priority: Major > Fix For: 1.8.1 > > > During collection several RepositoryEvents are fired, but they does not carry > any context related data regarding artifact collection. > Simplest solution would be to extend RequestTrace to provide: > * request context > * the artifact path (from root to leaf) > * leaf artifact being collected -- This message was sent by Atlassian Jira (v8.20.7#820007)
[GitHub] [maven-resolver] cstamas commented on a diff in pull request #182: [MRESOLVER-262] Provide contextual data in trace during collect
cstamas commented on code in PR #182: URL: https://github.com/apache/maven-resolver/pull/182#discussion_r884300349 ## maven-resolver-demos/maven-resolver-demo-snippets/src/main/java/org/apache/maven/resolver/examples/util/ReverseTreeRepositoryListener.java: ## @@ -0,0 +1,113 @@ +package org.apache.maven.resolver.examples.util; + +/* + * 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. + */ + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ListIterator; +import java.util.Objects; + +import org.eclipse.aether.AbstractRepositoryListener; +import org.eclipse.aether.RepositoryEvent; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.collection.CollectStepData; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; + +import static java.util.Objects.requireNonNull; + +/** + * A demo class building reverse tree using {@link CollectStepData} trace data provided in {@link RepositoryEvent} + * events fired during collection. + */ +public class ReverseTreeRepositoryListener +extends AbstractRepositoryListener +{ +@Override +public void artifactResolved( RepositoryEvent event ) +{ +requireNonNull( event, "event cannot be null" ); + +RequestTrace trace = event.getTrace(); +CollectStepData collectStepTrace = null; +while ( trace != null ) +{ +if ( trace.getData() instanceof CollectStepData ) +{ +collectStepTrace = (CollectStepData) trace.getData(); +break; +} +trace = trace.getParent(); +} + +if ( collectStepTrace == null ) +{ +return; +} + +Artifact resolvedArtifact = event.getArtifact(); +Artifact nodeArtifact = collectStepTrace.getNode().getArtifact(); + +if ( isInScope( resolvedArtifact, nodeArtifact ) ) +{ +Dependency node = collectStepTrace.getNode(); +String trackingData = node.toString() + " (" + collectStepTrace.getContext() + ")\n"; +String indent = ""; +ListIterator iter = collectStepTrace.getPath() +.listIterator( collectStepTrace.getPath().size() ); +while ( iter.hasPrevious() ) +{ +DependencyNode curr = iter.previous(); +indent += " "; +trackingData += indent + curr + " (" + collectStepTrace.getContext() + ")\n"; +} +try +{ +Path trackingDir = resolvedArtifact.getFile().getParentFile().toPath().resolve( ".tracking" ); +Files.createDirectories( trackingDir ); +Path trackingFile = trackingDir.resolve( collectStepTrace.getPath().get( 0 ) +.getArtifact().toString().replace( ":", "_" ) ); +Files.write( trackingFile, trackingData.getBytes( StandardCharsets.UTF_8 ) ); +System.out.println( trackingData ); +} +catch ( IOException e ) +{ +throw new UncheckedIOException( e ); +} +} +} + +/** + * The event "artifact resolved" if fired WHENEVER an artifact is resolved, BUT, it happens also when an artifact + * descriptor (model, the POM) is being built, and parent (and parent of parent...) is being asked for. Hence, this + * method "filters" out in WHICH artifact are we interested in, but it intentionally neglects extension, as + * ArtifactDescriptorReader modifies extension to "pom" during collect. So all we have to rely on is GAV only. + */ +private boolean isInScope( Artifact artifact, Artifact nodeArtifact ) +{ +return Objects.equals( artifact.getGroupId(), nodeArtifact.getGroupId() ) +&& Objects.equals( artifact.getArtifactId(), nodeArtifact.getArtifactId() ) +&& Objects.equals( artifact.getVersion(), nodeArtifact.getVersion() ); +} Review Comment: No, it doe
[jira] [Commented] (MRESOLVER-262) Provide contextual data in trace data for collector invoked requests
[ https://issues.apache.org/jira/browse/MRESOLVER-262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543686#comment-17543686 ] ASF GitHub Bot commented on MRESOLVER-262: -- cstamas commented on code in PR #182: URL: https://github.com/apache/maven-resolver/pull/182#discussion_r884300349 ## maven-resolver-demos/maven-resolver-demo-snippets/src/main/java/org/apache/maven/resolver/examples/util/ReverseTreeRepositoryListener.java: ## @@ -0,0 +1,113 @@ +package org.apache.maven.resolver.examples.util; + +/* + * 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. + */ + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ListIterator; +import java.util.Objects; + +import org.eclipse.aether.AbstractRepositoryListener; +import org.eclipse.aether.RepositoryEvent; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.collection.CollectStepData; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; + +import static java.util.Objects.requireNonNull; + +/** + * A demo class building reverse tree using {@link CollectStepData} trace data provided in {@link RepositoryEvent} + * events fired during collection. + */ +public class ReverseTreeRepositoryListener +extends AbstractRepositoryListener +{ +@Override +public void artifactResolved( RepositoryEvent event ) +{ +requireNonNull( event, "event cannot be null" ); + +RequestTrace trace = event.getTrace(); +CollectStepData collectStepTrace = null; +while ( trace != null ) +{ +if ( trace.getData() instanceof CollectStepData ) +{ +collectStepTrace = (CollectStepData) trace.getData(); +break; +} +trace = trace.getParent(); +} + +if ( collectStepTrace == null ) +{ +return; +} + +Artifact resolvedArtifact = event.getArtifact(); +Artifact nodeArtifact = collectStepTrace.getNode().getArtifact(); + +if ( isInScope( resolvedArtifact, nodeArtifact ) ) +{ +Dependency node = collectStepTrace.getNode(); +String trackingData = node.toString() + " (" + collectStepTrace.getContext() + ")\n"; +String indent = ""; +ListIterator iter = collectStepTrace.getPath() +.listIterator( collectStepTrace.getPath().size() ); +while ( iter.hasPrevious() ) +{ +DependencyNode curr = iter.previous(); +indent += " "; +trackingData += indent + curr + " (" + collectStepTrace.getContext() + ")\n"; +} +try +{ +Path trackingDir = resolvedArtifact.getFile().getParentFile().toPath().resolve( ".tracking" ); +Files.createDirectories( trackingDir ); +Path trackingFile = trackingDir.resolve( collectStepTrace.getPath().get( 0 ) +.getArtifact().toString().replace( ":", "_" ) ); +Files.write( trackingFile, trackingData.getBytes( StandardCharsets.UTF_8 ) ); +System.out.println( trackingData ); +} +catch ( IOException e ) +{ +throw new UncheckedIOException( e ); +} +} +} + +/** + * The event "artifact resolved" if fired WHENEVER an artifact is resolved, BUT, it happens also when an artifact + * descriptor (model, the POM) is being built, and parent (and parent of parent...) is being asked for. Hence, this + * method "filters" out in WHICH artifact are we interested in, but it intentionally neglects extension, as + * ArtifactDescriptorReader modifies extension to "pom" during collect. So all we have to rely on is GAV only. + */ +private boolean isInScope( Artifact artifact, Artifact nodeArtifact ) +{ +return Objects.equals( artifact
[GitHub] [maven] michael-o commented on a diff in pull request #736: [3.8.x] [MNG-7476] Display a warning when an aggregator mojo locks other mojos executions
michael-o commented on code in PR #736: URL: https://github.com/apache/maven/pull/736#discussion_r884276548 ## maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java: ## @@ -220,20 +223,44 @@ private void execute( MavenSession session, MojoExecution mojoExecution, Project * TODO: ideally, the builder should take care of the ordering in a smarter way * TODO: and concurrency issues fixed with MNG-7157 */ -private static class ProjectLock implements AutoCloseable +private class ProjectLock implements AutoCloseable { final Lock acquiredAggregatorLock; -final Lock acquiredProjectLock; +final OwnerReentrantLock acquiredProjectLock; -ProjectLock( MavenSession session, MojoDescriptor mojoDescriptor, ReadWriteLock aggregatorLock ) +ProjectLock( MavenSession session, MojoDescriptor mojoDescriptor ) { +mojos.put( Thread.currentThread(), mojoDescriptor ); Review Comment: this duplicates https://github.com/apache/maven/pull/736/files#diff-afa12cb60ed6ee8f6ad777fc0a0b4db1726b94306d7bda74f930ee95a27a9195R350. Intended? I assume since the finally block removes, this must go and the caller's put will remain. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [maven-resolver] cstamas commented on pull request #182: [MRESOLVER-262] Provide contextual data in trace during collect
cstamas commented on PR #182: URL: https://github.com/apache/maven-resolver/pull/182#issuecomment-1140492617 > > > How does this change the message usage when this type of information is collected by default? > > > > > > I don't quite get the question here... > > Stupid typo: memory usage I foresee minimal change, as this does not duplicates any collection, is really just new "step" instance per collect step. Still, AFAIR @khmarbaise had some benchmark framework, so would be good to compare on insanely huge projects I guess -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org