Uploaded image for project: 'Maven Shared Components'
  1. Maven Shared Components
  2. MSHARED-186

package goal on multi-module project does not find project module of type POM

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • maven-artifact-resolver-1.0
    • None
    • None
    • Windows XP, Maven 2.2.1

    Description

      To reproduce this bug:

      unzip the attachment, it contains:

      • example-base (reactor project)
      • example-base\example-pom (module of type "pom")
      • example-base\example-submodule (other module, depends on example-pom)

      Launch "mvn package" in example-base, with a clean local repository

      Result:

      1 required artifact is missing.

      for artifact:
      com.example:example-submodule:jar:1.0.0-SNAPSHOT

      1) com.example:example-pomlib:pom:1.0.0-SNAPSHOT
      Path to dependency:
      1) com.example:example-submodule:jar:1.0.0-SNAPSHOT
      2) com.example:example-pomlib:pom:1.0.0-SNAPSHOT

      Expected behaviour:
      project should build successfully

      Note:
      build is successful if "mvn install" or later goal is launched.
      The artifact resolver has not looked within the project itself for the dependency of type pom, as it does for a dependency of type jar, war etc. Instead it looks in the repository, and does not find it since the "install" goal has not yet been launched.

      I have set priority to Major because
      1) having an intra-reactor dependency on a POM project is a common way to manage skinny WARs, so this problem will crop up often
      2) the error message doesn't give a clue to the cause of the problem, so it has the potential to cause a lot of wasted time
      3) the error also happens when maven-release-plugin is used to perform a release, since this plugin by default executes the "package" goal

      Attachments

        1. example-base.zip
          4 kB
          Andrew Spencer

        Activity

          People

            Unassigned Unassigned
            andrewspencer Andrew Spencer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: