[ https://issues.apache.org/jira/browse/MNG-8009?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17805748#comment-17805748 ]
Tamas Cservenak edited comment on MNG-8009 at 1/11/24 6:03 PM: --------------------------------------------------------------- Issue solved, and also there is explanation why this issue "spans across all maven versions".... In short, BOM _is able to introduce build ordering peculiarities_. Just look at maven master how is ordered: {noformat} [INFO] -------------------------------------------------------------------------------------------------------------------------- [INFO] Reactor Summary for Apache Maven 4.0.0-alpha-11-SNAPSHOT: [INFO] [INFO] Maven Dependencies BOM ............................................................................... SKIPPED [INFO] Apache Maven ......................................................................................... SKIPPED [INFO] Maven 4 API .......................................................................................... SKIPPED [INFO] Maven 4 API :: Meta annotations ...................................................................... SKIPPED ... {noformat} Meaning BOM module is built first! All this due fact that TLP POM **imports** BOM. Second, the CLI invocation `mvn spotless:apply` first builds model, and then "picks the first project" to resolve plugin, but alas, first one is BOM, that is "bare naked" (contains minimal stuff aimed at others to consume), and it does NOT contain any trace of spotless plugin. I'd personally **forbid** BOM imports inside of reactor. They are meant for external consumption ONLY. Also, would reconsider how we choose POM to resolve CLI plugin from... was (Author: cstamas): Issue solved, and also there is explanation why this issue "spans across all maven versions".... In short, BOM _is able to introduce build ordering peculiarities_. Just look at maven master how is ordered: {noformat} [INFO] -------------------------------------------------------------------------------------------------------------------------- [INFO] Reactor Summary for Apache Maven 4.0.0-alpha-11-SNAPSHOT: [INFO] [INFO] Maven Dependencies BOM ............................................................................... SKIPPED [INFO] Apache Maven ......................................................................................... SKIPPED [INFO] Maven 4 API .......................................................................................... SKIPPED [INFO] Maven 4 API :: Meta annotations ...................................................................... SKIPPED ... {noformat} Meaning BOM module is built first! All this due fact that TLP POM **imports** BOM. Second, the CLI invocation `mvn spotless:apply` first builds model, and then "picks the first project" to resolve plugin, but alas, first one is BOM, that is "bare naked" (contains minimal stuff aimed at others to consume), and it does NOT contain any trace of spotless plugin. I'd personally **forbid** BOM imports inside of reactor**. They are meant for external consumption ONLY. Also, would reconsider how we choose POM to resolve CLI plugin from... > Investigate issue with spotless > ------------------------------- > > Key: MNG-8009 > URL: https://issues.apache.org/jira/browse/MNG-8009 > Project: Maven > Issue Type: Bug > Components: Inheritance and Interpolation > Affects Versions: 3.9.6, 4.0.0-alpha-10 > Reporter: Tamas Cservenak > Priority: Blocker > > Maven 3.9.6 and 4.0.0-alpha-11-SNAP (current master), Java 21. > After this commit: > https://github.com/apache/maven/commit/f1c53cbfdfc99cfc6e1521a450adeeb817b89345 > Executing from top level command {{mvn spotless:apply}} does NOT work: plugin > is not found! > If you checkout commit before that one, it works. > Diffing the debug output from two executions, the "good" one (before given > commit) has this line: > bq. Resolved plugin prefix spotless to > com.diffplug.spotless:spotless-maven-plugin from POM > org.apache.maven:maven-bom:pom:4.0.0-alpha-11-SNAPSHOT > Meaning, plugin is resolved from BOM??? And as given commit _changes_ the BOM > parent from maven-parent (that has spotless defined) to ASF parent (that does > not have it), makes plugin not resolvable? > Despite root POM of Maven parent maven-parent defines it, and even top level > POM _redefines it_? -- This message was sent by Atlassian Jira (v8.20.10#820010)