You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Martin Kanters (Jira)" <ji...@apache.org> on 2021/12/23 13:23:00 UTC

[jira] [Commented] (MNG-7310) Maven loads extension from another submodule

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

Martin Kanters commented on MNG-7310:
-------------------------------------

[~cstamas]. I managed to fix the issue in maven-core pretty easily using your hints. I have spent a long time on trying to replicating the faulty extension in an IT, but cannot make it "fail"...

I hope you or someone is willing to take a look at the plugin/extension from Spring Cloud and compare that to my extension in the IT to see where the difference lies.

---

Core PR: [https://github.com/apache/maven/pull/639]
integration-testing draft PR: [https://github.com/apache/maven-integration-testing/pull/131] (activate the Spring Cloud extension to replicate the issue)
Source code for the faulty Spring Cloud plugin: [https://github.com/spring-cloud/spring-cloud-contract/tree/main/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin]

> Maven loads extension from another submodule
> --------------------------------------------
>
>                 Key: MNG-7310
>                 URL: https://issues.apache.org/jira/browse/MNG-7310
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 4.0.0-alpha-1
>            Reporter: Martin Kanters
>            Priority: Major
>         Attachments: demo-plugins.zip
>
>
> With the latest Maven master, I'm not able to build a certain multi module project.
> It fails with the following error:
> C:\work\apache\demo>mvn validate
>  [INFO] Scanning for projects...
>  ...
>  [ERROR] The build could not read 1 project -> [Help 1]
>  [ERROR]
>  [ERROR] The project com.example:demo2:0.0.1-SNAPSHOT (C:\work\apache\demo\demo2\pom.xml) has 1 error
>  [ERROR] 'build.plugins.plugin.version' for org.springframework.cloud:spring-cloud-contract-maven-plugin must be a valid version but is '${project.version}'. @ org.apache.maven:maven-core:4.0.0-alpha-1-SNAPSHOT:default-lifecycle-bindings
> The project looks as follows:
> parent
>  – demo (module containing plugin "spring-cloud-contract-maven-plugin")
>  – demo2 (module)
> "demo2" has no dependency on "demo" and the parent of "demo2" is "parent"..
>  Somehow, the plugin from "demo" leaks into "demo2", which I've verified is the case during a debug session.
> I'm still unsure of a couple of things:
>  - Does it only happen with the "spring-cloud-contract-maven-plugin" plugin?
>  - Where does ${project.version} come from? (I've not defined it)
> I've done a bisect and tracked it down to the following commit:
>  [[MNG-5577] Convert maven-core to JSR 330|https://github.com/apache/maven/commit/9567da2bc889a94f5c3b692b4afb310ddbacd6e5]
> Subject project is attached. Reproduce with the current master of Maven: mvn validate.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)