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

[regression] resolution of import-scoped transitive dependencies ignores additional repositories

    XMLWordPrintableJSON

Details

    Description

      We (JBoss) use BOM poms extensively, notably in a number of project archetypes or project examples available via JBoss Tools and Red Hat Developer Studio . Some of these BOM poms (and their dependencies) are available from a dedicated Maven repository (http://maven.repository.redhat.com/techpreview/all/).

      Maven 3.2.2 introduced a regression that breaks resolution of these BOM dependencies, by ignoring additional repositories during artifact resolution.

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      	<modelVersion>4.0.0</modelVersion>
      	<groupId>foo</groupId>
      	<artifactId>bar</artifactId>
      	<version>0.0.1-SNAPSHOT</version>
      	<dependencyManagement>
      		<dependencies>
      			<dependency>
      				<groupId>org.jboss.bom.wfk</groupId>
      				<artifactId>jboss-javaee-6.0-with-tools</artifactId>
      				<version>2.4.0-redhat-2</version>
      				<type>pom</type>
      				<scope>import</scope>
      			</dependency>
      		</dependencies>
      	</dependencyManagement>
      	<repositories>
      		<repository>
      			<id>redhat-techpreview-all-repository</id>
      			<url>http://maven.repository.redhat.com/techpreview/all/</url>
      		</repository>
      	</repositories>
      </project>

      yields :

      ➜  bar  mvn compile
      [INFO] Scanning for projects...
      Downloading: http://maven.repository.redhat.com/techpreview/all/org/jboss/bom/wfk/jboss-javaee-6.0-with-tools/2.4.0-redhat-2/jboss-javaee-6.0-with-tools-2.4.0-redhat-2.pom
      Downloaded: http://maven.repository.redhat.com/techpreview/all/org/jboss/bom/wfk/jboss-javaee-6.0-with-tools/2.4.0-redhat-2/jboss-javaee-6.0-with-tools-2.4.0-redhat-2.pom (8 KB at 5.1 KB/sec)
      Downloading: http://maven.repository.redhat.com/techpreview/all/org/jboss/bom/wfk/jboss-wfk-bom-parent/2.4.0-redhat-2/jboss-wfk-bom-parent-2.4.0-redhat-2.pom
      Downloaded: http://maven.repository.redhat.com/techpreview/all/org/jboss/bom/wfk/jboss-wfk-bom-parent/2.4.0-redhat-2/jboss-wfk-bom-parent-2.4.0-redhat-2.pom (7 KB at 6.8 KB/sec)
      Downloading: http://repo.maven.apache.org/maven2/org/jboss/spec/jboss-javaee-6.0/3.0.2.Final-redhat-4/jboss-javaee-6.0-3.0.2.Final-redhat-4.pom
      [ERROR] The build could not read 1 project -> [Help 1]
      [ERROR]
      [ERROR]   The project foo:bar:0.0.1-SNAPSHOT (/Users/fbricon/Dev/workspaces/runtime-hosted/bar/pom.xml) has 2 errors
      [ERROR]     Non-resolvable import POM: Could not find artifact org.jboss.spec:jboss-javaee-6.0:pom:3.0.2.Final-redhat-4 in central (http://repo.maven.apache.org/maven2) @ org.jboss.bom.wfk:jboss-javaee-6.0-with-tools:[unknown-version], /Users/fbricon/Dev/maven/repository/org/jboss/bom/wfk/jboss-javaee-6.0-with-tools/2.4.0-redhat-2/jboss-javaee-6.0-with-tools-2.4.0-redhat-2.pom, line 42, column 25 -> [Help 2]
      [ERROR]     'dependencies.dependency.version' for javax.enterprise:cdi-api:jar is missing. @ line 27, column 15
      [ERROR]
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR]
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
      [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
      ➜  bar
      

      This kind of resolution used to work in maven 3.2.1 and before. The missing pom is available at http://maven.repository.redhat.com/techpreview/all/org/jboss/spec/jboss-javaee-6.0/3.0.2.Final-redhat-4/jboss-javaee-6.0-3.0.2.Final-redhat-4.pom

      Attachments

        Issue Links

          Activity

            People

              jvanzyl Jason van Zyl
              fbricon Fred Bricon
              Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: