artifactory-maven-plugin does not create build info url´s as expected
Describe the bug
artifactory-maven-plugin does not create build info url´s as expected
When we are using artifactory--maven-plugin 3.6.2 version, the build info url generated is incorrect.
Sample of plugin declaration:
<plugin>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>artifactory-maven-plugin</artifactId>
<version>3.6.2</version>
<executions>
<execution>
<id>build-info</id>
<goals>
<goal>publish</goal>
</goals>
<configuration>
<buildInfo>
<buildName>{{JOB_NAME}}</buildName>
<buildNumber>{{BUILD_NUMBER}}</buildNumber>
<buildUrl>{{JOB_URL}}</buildUrl>
<project>{{JFROG_CLI_BUILD_PROJECT}}</project>
</buildInfo>
<publisher>
<contextUrl>{{ARTIFACTORY_CONTEXT_URL}}</contextUrl>
<username>${username}</username>
<password>${password}</password>
<repoKey>releases</repoKey>
<snapshotRepoKey>snapshots</snapshotRepoKey>
</publisher>
</configuration>
</execution>
</executions>
</plugin>
Current behavior
When we are using artifactory-maven-plugin 3.6.2 version, the build info url is created does not work as expected when accessing from web browser and the url will re-direct to a different page.
Reproduction steps
Step 1: Clone this project : https://github.com/jfrog/project-examples/tree/master/maven-examples/maven-example
Step 2: update the pom file to use maven artifactory plugin < 3.6.2 > and use the below declaration to reproduce the issue
<plugin>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>artifactory-maven-plugin</artifactId>
<version>3.6.2</version>
<executions>
<execution>
<id>build-info</id>
<goals>
<goal>publish</goal>
</goals>
<configuration>
<buildInfo>
<buildName>{{JOB_NAME}}</buildName>
<buildNumber>{{BUILD_NUMBER}}</buildNumber>
<buildUrl>{{JOB_URL}}</buildUrl>
<project>{{JFROG_CLI_BUILD_PROJECT}}</project>
</buildInfo>
<publisher>
<contextUrl>{{ARTIFACTORY_CONTEXT_URL}}</contextUrl>
<username>${username}</username>
<password>${password}</password>
<repoKey>releases</repoKey>
<snapshotRepoKey>snapshots</snapshotRepoKey>
</publisher>
</configuration>
</execution>
</executions>
</plugin>
Step 3: make sure the build is associated with the project
<buildInfo>
<buildName>plugin-demo</buildName>
<buildNumber>10</buildNumber>
<buildUrl>http://build-url.org/</buildUrl>
<buildTimestamp>${buildNumber.timestamp}</buildTimestamp>
<project>abc</project>
</buildInfo>
Step 4: run mvn clean install
Step 5: mvn clean deploy
Step 6: Try to access the build info URL - It reached the artifactory and redirected to a different page.
[INFO] Build-info successfully deployed. Browse it in Artifactory under https://xxxxxxxxjfrog.io/ui/builds/plugin-demo/10/0/published?buildRepo=abc-build-info&projectKey=abc [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Multi 1 3.7-SNAPSHOT ............................... SUCCESS [ 18.253 s] [INFO] Multi 2 3.7-SNAPSHOT ............................... SUCCESS [ 10.890 s] [INFO] Multi 3 3.7-SNAPSHOT ............................... SUCCESS [ 14.782 s] [INFO] Simple Multi Modules Build 3.10-SNAPSHOT ........... SUCCESS [ 0.188 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 47.231 s [INFO] Finished at: 2025-01-25T15:01:55+05:30 [INFO] ------------------------------------------------------------------------
without "artiactory-maven-plugin" the URL will be accessible without any issues
Expected behavior
The build info URL should not redirect and work as expected - the URL should land in the build info page associated with project.
Artifactory Maven plugin version
3.6.2
Operating system type and version
Linux
JFrog Artifactory version
Latest
Maven version
Apache Maven 3.9.9