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

CI friendly properties break submodule builds

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.3.9
    • 3.5.0-beta-1, 3.5.0
    • Core
    • None

    Description

      Scenario

      A multi-module project where the parent version is one of the CI friendly properties, e.g. ${revision} as outlined in http://blog.soebes.de/blog/2016/08/08/maven-how-to-create-a-release/.

      There are two submodules submodule1 and submodule2 such that submodule2 depends on submodule1.

      Expected behaviour

      Each submodule can be built by itself, e.g.

      mvn clean install -Drevision=1.0.0-SNAPSHOT -pl submodule2
      

      or

      cd submodule2; mvn clean install -Drevision=1.0.0-SNAPSHOT
      

      Actual behaviour

      This does not work for submodule2 or in general any module that depends on a module from the same reactor.

      Maven cannot resolve the property variable in the referenced parent POM version and fails the build:

      [ERROR] Failed to execute goal on project submodule2: Could not resolve dependencies for project com.example:submodule2:jar:1.0.0-SNAPSHOT: Failed to collect dependencies at com.example:submodule1:jar:1.0.0-SNAPSHOT: Failed to read artifact descriptor for com.example:submodule1:jar:1.0.0-SNAPSHOT: Could not find artifact com.exammple:parent:pom:${revision} -> [Help 1]
      

      There is no problem building submodule1 or the entire reactor.

      Same problem observed with a local build from master (3.4.0-SNAPSHOT).

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            khmarbaise Karl Heinz Marbaise
            hwellmann Harald Wellmann
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment