Uploaded image for project: 'Maven Assembly Plugin'
  1. Maven Assembly Plugin
  2. MASSEMBLY-855

Remote repositories ignored in a multi-module project

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.1.0
    • Component/s: dependencySet
    • Labels:
      None

      Description

      I have attached a small multi-module project to demonstrate the behaviour.
      I have a test-parent project with a child module, test-child.

      I have defined a repositories section in test-parent:

      <repositories>
      	<repository>
      		<id>jboss-public-repository-group</id>
      		<name>JBoss Public Maven Repository Group</name>
      		<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
      		<layout>default</layout>
      		<releases>
      			<enabled>true</enabled>
      			<updatePolicy>never</updatePolicy>
      		</releases>
      		<snapshots>
      			<enabled>true</enabled>
      			<updatePolicy>never</updatePolicy>
      		</snapshots>
      	</repository>
      </repositories>
      

      I have defined the executing of maven-assembly-plugin in test-child/pom.xml:

      <plugin>
      	<artifactId>maven-assembly-plugin</artifactId>
      	<version>3.0.0</version>
      	<configuration>
      		<descriptors>
      			<descriptor>src/assembly/repository.xml</descriptor>
      		</descriptors>
      	</configuration>
      	<executions>
      		<execution>
      			<id>create-repository</id>
      			<phase>package</phase>
      			<goals>
      				<goal>single</goal>
      			</goals>
      		</execution>
      	</executions>
      </plugin>
      

      When I run mvn clean package from test-child, I can see that it is using repository.jboss.org to resolve dependencies:

      [test-parent/test-child] $ mvn clean package
      [INFO] Scanning for projects...
      [INFO]                                                                         
      [INFO] ------------------------------------------------------------------------
      [INFO] Building test-child 1.0.0-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [INFO] 
      [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test-child ---
      [INFO] 
      [INFO] --- maven-assembly-plugin:3.0.0:single (create-repository) @ test-child ---
      [INFO] Reading assembly descriptor: src/assembly/repository.xml
      Downloading: https://repository.jboss.org/nexus/content/groups/public-jboss/org/jboss/spec/javax/servlet/jboss-servlet-api_3.0_spec/1.0.0.Beta2/jboss-servlet-api_3.0_spec-1.0.0.Beta2.pom
      

      However, if I run mvn clean package from the parent project test-parent, it will only try to resolve dependencies from maven central, ignoring all repository settings:

      [test-parent] $ mvn clean package
      [INFO] Scanning for projects...
      [INFO] ------------------------------------------------------------------------
      [INFO] Reactor Build Order:
      [INFO] 
      [INFO] test-parent
      [INFO] test-child
      [INFO]                                                                         
      [INFO] ------------------------------------------------------------------------
      [INFO] Building test-parent 1.0.0-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [INFO] 
      [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test-parent ---
      [INFO]                                                                         
      [INFO] ------------------------------------------------------------------------
      [INFO] Building test-child 1.0.0-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [INFO] 
      [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ test-child ---
      [INFO] Deleting /media/sf_SharedFolder/Temp/test-parent/test-child/target
      [INFO] 
      [INFO] --- maven-assembly-plugin:3.0.0:single (create-repository) @ test-child ---
      [INFO] Reading assembly descriptor: src/assembly/repository.xml
      Downloading: https://repo.maven.apache.org/maven2/org/jboss/spec/javax/servlet/jboss-servlet-api_3.0_spec/1.0.0.Beta2/jboss-servlet-api_3.0_spec-1.0.0.Beta2.pom
      

      This causes issues for us when we reference dependencies that don't exist in maven central.

      Note

      I am using maven version 3.3.3

        Activity

        Hide
        khmarbaise Karl Heinz Marbaise added a comment -

        I assume the jboss repository contains only releases so the configuration:

        <snapshots>
        			<enabled>true</enabled>
        			<updatePolicy>never</updatePolicy>
        		</snapshots>
        

        looks wrong to me?

        Show
        khmarbaise Karl Heinz Marbaise added a comment - I assume the jboss repository contains only releases so the configuration: <snapshots> <enabled> true </enabled> <updatePolicy>never</updatePolicy> </snapshots> looks wrong to me?
        Hide
        gboue Guillaume Boué added a comment -

        Fixed in r1800508.

        Show
        gboue Guillaume Boué added a comment - Fixed in r1800508 .
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build maven-plugins #9016 (See https://builds.apache.org/job/maven-plugins/9016/)
        MASSEMBLY-855 Remote repositories ignored in a multi-module project

        All the project repositories (and not just the session) need to be considered when a repository is assembled. (gboue: http://svn.apache.org/viewvc/?view=rev&rev=1800508)

        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/child
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/child/pom.xml
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/child/src
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/child/src/assembly
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/child/src/assembly/repository.xml
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/invoker.properties
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/pom.xml
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache/maven
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache/maven/plugins
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache/maven/plugins/assembly
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache/maven/plugins/assembly/it
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache/maven/plugins/assembly/it/massembly-855
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache/maven/plugins/assembly/it/massembly-855/1.0
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache/maven/plugins/assembly/it/massembly-855/1.0/massembly-855-1.0.jar
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache/maven/plugins/assembly/it/massembly-855/1.0/massembly-855-1.0.pom
        • (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/verify.bsh
        • (edit) maven-assembly-plugin/src/main/java/org/apache/maven/plugins/assembly/archive/phase/wrappers/RepoBuilderConfigSourceWrapper.java
        • (edit) maven-assembly-plugin/src/main/java/org/apache/maven/plugins/assembly/artifact/DefaultDependencyResolver.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build maven-plugins #9016 (See https://builds.apache.org/job/maven-plugins/9016/ ) MASSEMBLY-855 Remote repositories ignored in a multi-module project All the project repositories (and not just the session) need to be considered when a repository is assembled. (gboue: http://svn.apache.org/viewvc/?view=rev&rev=1800508 ) (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855 (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/child (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/child/pom.xml (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/child/src (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/child/src/assembly (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/child/src/assembly/repository.xml (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/invoker.properties (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/pom.xml (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache/maven (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache/maven/plugins (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache/maven/plugins/assembly (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache/maven/plugins/assembly/it (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache/maven/plugins/assembly/it/massembly-855 (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache/maven/plugins/assembly/it/massembly-855/1.0 (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache/maven/plugins/assembly/it/massembly-855/1.0/massembly-855-1.0.jar (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/remote-repository/org/apache/maven/plugins/assembly/it/massembly-855/1.0/massembly-855-1.0.pom (add) maven-assembly-plugin/src/it/projects/repositories/massembly-855/verify.bsh (edit) maven-assembly-plugin/src/main/java/org/apache/maven/plugins/assembly/archive/phase/wrappers/RepoBuilderConfigSourceWrapper.java (edit) maven-assembly-plugin/src/main/java/org/apache/maven/plugins/assembly/artifact/DefaultDependencyResolver.java

          People

          • Assignee:
            gboue Guillaume Boué
            Reporter:
            johnnyleitrim John Farrelly
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development