Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7310

Maven loads extension from another submodule

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0-alpha-1
    • 4.0.0
    • None
    • None

    Description

      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

      Subject project is attached. Reproduce with the current master of Maven: mvn validate.

      Attachments

        1. demo-plugins.zip
          8 kB
          Martin Kanters

        Issue Links

          Activity

            People

              martinkanters Martin Kanters
              martinkanters Martin Kanters
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: