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

Remote repositories incorrectly used in multi module project

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 3.1.0
    • None
    • None
    • None
    • Jenkins running on Centos linux, Maven 3.3.9, Java 8.0_101

    Description

      This sounds very similar to https://issues.apache.org/jira/browse/MASSEMBLY-855

      We just moved to a new build box with no external access. We immediately started having problems with a couple of projects that use the maven assembly plugin. We have an internal mirror repository, and everything should be using that. But when we build these projects we can clearly see in the logs that the assembly plugin is only attempting to resolve artifacts externally.

      This is a multi module pom. The plugin version is declared in the parent, plugin details specified in the child. Repository is only specified in the parent pom. Invocation is always via the parent pom (.e.g mvn -U clean package on the parent).

      The build works if the box has external access since the plugin is able to externally resolve all artifcacts. If there is no external access it fails completely and never attempts to use the local repository configured in the parent pom.

      Looks to me like the assembly plugin is completely ignoring the repository declarations in the parent pom.

      Pom details:

                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-assembly-plugin</artifactId>
                      <configuration>
                          <appendAssemblyId>false</appendAssemblyId>
                          <descriptorRefs>
                              <descriptorRef>jar-with-dependencies</descriptorRef>
                          </descriptorRefs>
                          <finalName>${project.artifactId}</finalName>
                          <archive>
                              <manifest>
                                  <mainClass>---our class name was here--</mainClass>
                              </manifest>
                          </archive>
                      </configuration>
                      <executions>
                      <executions>
                          <execution>
                              <phase>package</phase>
                              <goals>
                                  <goal>single</goal>
                              </goals>
                          </execution>
                      </executions>
                  </plugin>
      

      We have no assembly xml or anything like that.

      Snippet from log is below. It always trys to connect outside, never uses our internal repo. Eventually it abandons the attempts and fails. Everything else correctly finds all artifacts in our local repo.

      [INFO] --- maven-assembly-plugin:3.1.0:single (default) @ resourceservice-migration ---
      [INFO] Downloading: https://oss.sonatype.org/content/repositories/snapshots/---OUR JAR NAME--/maven-metadata.xml
      [INFO] Downloading: http://repository.apache.org/snapshots/---OUR JAR NAME---/maven-metadata.xml
      [WARNING] Could not transfer metadata ---OUR JAR NAME---/maven-metadata.xml from/to sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots): Connect to oss.sonatype.org:443 [oss.sonatype.org/54.173.252.242, oss.sonatype.org/107.23.166.173, oss.sonatype.org/34.199.111.237] failed: Connection timed out
      [WARNING] Could not transfer metadata ---OUR JAR NAME--- /maven-metadata.xml from/to apache.snapshots (http://repository.apache.org/snapshots): Connect to repository.apache.org:80 [repository.apache.org/207.244.88.140] failed: Connection timed out
      

      Workaround for us was to define a proxy to let this get to the outside, but we should not have to do this.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mmcgregor666 Mark McGregor
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: