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

Remote repositories ignored in a multi-module project

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.1.0
    • dependencySet
    • 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

      Attachments

        1. test-parent.tar.gz
          1 kB
          John Farrelly

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: