Maven
  1. Maven
  2. MNG-2743

Dependency poms not timely merged with parents

    Details

    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      POM's of dependencies are not properly merged with their parents.
      It could be that they're not merged at all, or only partly. Since the code to merge poms is the same
      everywhere, and <repository> tags are merged for local poms, I fear that they're not merged at all.

      With this setup:

      • local workspace:
        • project A
          • depends on remote artifact B, residing in 'central'
      • repository central:
        • artifact B (cocoon-core)
          • has parent P (cocoon), also here at central
          • declares a dependency on D, residing in repo R (not a standard repository)
        • pom P, declares repository R
      • repository R:
        • artifact D (avalon-framework-impl)
          • declares dependency on lib L, also here at repository R
        • artifact L (avalon-framework-api)

      When running mvn install on local project A, observe the following log:

      ....
      // cocoon-core has been resolved, now it's dependency poms are resolved:
      [DEBUG] Trying repository central
      Downloading: http://repo1.maven.org/maven2/org/apache/avalon/framework/avalon-framework-impl/4.3/avalon-framework-impl-4.3.pom
      [WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2)
      [DEBUG] Artifact not found - using stub model: Unable to download the artifact from any repository
       
        org.apache.avalon.framework:avalon-framework-impl:pom:4.3
       
      from the specified remote repositories:
        central (http://repo1.maven.org/maven2)
       
      [DEBUG] Using defaults for missing POM org.apache.avalon.framework:avalon-framework-impl:pom:4.3:compile
      
      // note: above, the parent of cocoon-core (B) (which is cocoon (P)), is not merged, as the repo R is not
      // visible in B to resolve D
      ....
      
      // now, the artifacts themselves are downloaded 
       
      [DEBUG] Trying repository central
      Downloading: http://repo1.maven.org/maven2/org/apache/avalon/framework/avalon-framework-impl/4.3/avalon-framework-impl-4.3.jar
      [WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2)
      // Here, repo R _is_ used to search, which means that the parent P is merged with B and the repo is available
      [DEBUG] Trying repository apache.snapshot
      Downloading: http://people.apache.org/maven-snapshot-repository/org/apache/avalon/framework/avalon-framework-impl/4.3/avalon-framework
      -impl-4.3.jar
      2/56K^M3/56K^M7/56K^M8/56K^M9/56K^M13/56K^M17/56K^M19/56K^M20/56K^M24/56K^M28/56K^M32/56K^M36/56K^M40/56K^M42/56K^M43/56K^M44/56K^M46/
      56K^M47/56K^M49/56K^M50/56K^M52/56K^M53/56K^M54/56K^M56/56K^M56K downloaded
      [DEBUG]   Artifact resolved
      

      The problem here is that the jar is now available in the local repo, but the pom is not, and the dependencies of D aren't downloaded.

      It seems pom B is only merged with P after all dependency poms for B have been resolved.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Kenney Westerhof
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: