You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Maik Ebert (Jira)" <ji...@apache.org> on 2021/11/17 11:23:00 UTC

[jira] [Created] (ARCHETYPE-621) integration-test execution fails during release build when custom settingsFile is used

Maik Ebert created ARCHETYPE-621:
------------------------------------

             Summary: integration-test execution fails during release build when custom settingsFile is used
                 Key: ARCHETYPE-621
                 URL: https://issues.apache.org/jira/browse/ARCHETYPE-621
             Project: Maven Archetype
          Issue Type: Bug
          Components: Plugin
    Affects Versions: 3.2.0
            Reporter: Maik Ebert


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.
h3. 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

 
h3. 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.
h3. Additional information
 * We use the maven-release-plugin version 2.5.3
 * The archetype project pom.xml: 

{quote}<?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>
{quote} * the pom of the archetype-resources:

{quote}<?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>
{quote} *  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)