Uploaded image for project: 'Maven Archetype'
  1. Maven Archetype
  2. ARCHETYPE-621

integration-test execution fails during release build when custom settingsFile is used

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.0
    • 3.2.1
    • Plugin
    • None

    Description

      We use a company internal Nexus repository server.

      Through a custom user settings.xml we configure Maven on our Jenkins build server to use this internal Nexus instance instead of accessing Maven public central.

      We have a custom Maven archetype Maven project, which uses the archetype plugin integration-test goal to execute a test during build.

      This custom Maven archetype uses in its archetype-resources pom.xml a parent pom, which is only available on our internal Nexus.

      To ensure that the custom user settings.xml is used on Jenkins at integration-test time, we always populate the user property "archetype.test.settingsFile" as well as the standard Maven "settings" parameter.

      This approach works fine during the continuous build, but fails during the release build, when the maven-release-plugin is trying to execute the integration-test goal.

      continuous build

      [Pipeline] sh + /data/jenkins/tools/hudson.tasks.Maven_MavenInstallation/MAVEN_3_6/bin/mvn deploy -U -P do-sonarQube-only-stuff -T 3 -f maven-openapi-archetypes-build-all/pom.xml -Dmaven.repo.local=/data/jenkins/maven-repositories/2 --settings /data/jenkins/workspace/maven-openapi-archetypes-do-master-continuous-build/project-sources@tmp/config3940372030775555829tmp -Darchetype.test.settingsFile=/data/jenkins/workspace/maven-openapi-archetypes-do-master-continuous-build/project-sources@tmp/config3940372030775555829tmp --batch-mode

      results in expected debug logs:

      [INFO] [DEBUG] Reading global settings from /data/jenkins/tools/hudson.tasks.Maven_MavenInstallation/MAVEN_3_6/conf/settings.xml

      [INFO] [DEBUG] Reading user settings from /data/jenkins/workspace/maven-openapi-archetypes-do-master-continuous-build/project-sources/maven-openapi-java-eap72-server-api/target/classes/archetype-it/interpolated-config3940372030775555829tmp

       

      release build

      [Pipeline] sh + /data/jenkins/tools/hudson.tasks.Maven_MavenInstallation/MAVEN_3_6/bin/mvn release:clean release:prepare release:perform -DdevelopmentVersion=1.2.0-SNAPSHOT -DreleaseVersion=1.1.0 -Dtag=1.1.0 -DpscReleaseBuild=true -DuseReleaseProfile=false -DpushChanges=false -DlocalCheckout=true  -f maven-openapi-archetypes-build-all/pom.xml -Dmaven.repo.local=/data/jenkins/maven-repositories/5 --settings /data/jenkins/workspace/maven-openapi-archetypes-do-master-create-release/project-sources@tmp/config6023587681934610247tmp -Darchetype.test.settingsFile=/data/jenkins/workspace/maven-openapi-archetypes-do-master-create-release/project-sources@tmp/config6023587681934610247tmp --batch-mode

      results in incorrect pick up of standard user settings.xml:

      [INFO] [INFO] [DEBUG] Reading global settings from /data/jenkins/tools/hudson.tasks.Maven_MavenInstallation/MAVEN_3_6/conf/settings.xml

      [INFO] [INFO] [DEBUG] Reading user settings from /home/ci-deployer/.m2/settings.xml

       

      I would expect that the release build is running fine.

      Additional information

      • We use the maven-release-plugin version 2.5.3
      • The archetype project pom.xml: 

       

      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
      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>
      <parent>
      <artifactId>psc-parent</artifactId>
      <groupId>com.psc</groupId>
      <version>2.1.0</version>
      </parent>
      <groupId>com.psc.maven.archetype</groupId>
      <artifactId>maven-openapi-java-eap72-server-api</artifactId>
      <version>1.0.0-SNAPSHOT</version>
      <packaging>maven-archetype</packaging>
      <build>
      <pluginManagement>
      <plugins>
      <plugin>
      <artifactId>maven-archetype-plugin</artifactId>
      <version>3.2.0</version>
      <configuration>
      <debug>true</debug>
      </configuration>
      </plugin>
      </plugins>
      </pluginManagement>
      <extensions>
      <extension>
      <groupId>org.apache.maven.archetype</groupId>
      <artifactId>archetype-packaging</artifactId>
      <version>3.2.0</version>
      </extension>
      </extensions>
      </build>
      <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <maven.compiler.source>1.8</maven.compiler.source>
      <maven.compiler.target>1.8</maven.compiler.target>
      </properties>
      </project>

      • the pom of the archetype-resources:

       

       

      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
      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>
      <parent>
      <groupId>com.psc.ppp</groupId>
      <artifactId>ppp-eap-server-api-parent</artifactId>
      <version>1.19.0</version>
      </parent>
      <groupId>${groupId}</groupId>
      <artifactId>${artifactId}</artifactId>
      <version>${version}</version>
      <packaging>jar</packaging>
      <properties>
      <apiPackageRoot>${javaApiPackageRoot}</apiPackageRoot>
      </properties>
      </project>

       

       

      Attachments

        Activity

          People

            slachiewicz Sylwester Lachiewicz
            maik.ebert@gmail.com Maik Ebert
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: