Giter VIP home page Giter VIP logo

artifactory-maven-plugin's Introduction

Maven Artifactory Plugin

Build status

Table of Contents

Overview

The Maven Artifactory integrates in your build to allow you to do the following:

  1. Resolve artifacts from Artifactory.
  2. Capture the full build information and publish it to Artifactory.
  3. Deploy all build Artifacts to Artifactory.

Using Maven Artifactory plugin

The Maven Artifactory Plugin coordinates are org.jfrog.buildinfo:artifactory-maven-plugin:x.x.x. It can be viewed on releases.jfrog.io.

Basic Configuration

A typical build plugin configuration would be as follows:

<build>
  <plugins>
    <plugin>
      <groupId>org.jfrog.buildinfo</groupId>
      <artifactId>artifactory-maven-plugin</artifactId>
      <version>3.6.1</version>
      <executions>
        <execution>
          <id>build-info</id>
          <goals>
            <goal>publish</goal>
          </goals>
          <configuration>
            <deployProperties>
              <gradle>awesome</gradle>
              <review.team>qa</review.team>
            </deployProperties>
            <publisher>
              <contextUrl>https://acme.jfrog.io</contextUrl>
              <username>deployer</username>
              <password>dontellanyone</password>
              <repoKey>libs-release-local</repoKey>
              <snapshotRepoKey>libs-snapshot-local</snapshotRepoKey>
            </publisher>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

The plugin's invocation phase is validate by default and we recommend you don't change it so the plugin is called as early as possible in the lifecycle of your Maven build.

Full Configuration

The example above configures the Artifactory publisher, to deploy build artifacts either to the releases or the snapshots repository of Artifactory when mvn deploy is executed.

However, the Maven Artifactory Plugin provides many other configurations:

<configuration>
  <artifactory>
    <includeEnvVars>true</includeEnvVars>
    <envVarsExcludePatterns>*password*,*secret*,*key*,*token*,*passphrase*</envVarsExcludePatterns>
    <envVarsIncludePatterns>*os*</envVarsIncludePatterns>
    <timeoutSec>60</timeoutSec>
  </artifactory>
  <buildInfo>
    <agentName>..</agentName>
    <agentVersion>..</agentVersion>
    <buildName>plugin-demo</buildName>
    <buildNumber>${buildnumber}</buildNumber>
    <buildUrl>https://build-url.org</buildUrl>
    <!-- If you'd like to associate the published build-info with a JFrog Project, add the project key here -->
    <project>..</project>

    <buildNumbersNotToDelete></buildNumbersNotToDelete>
    <buildRetentionMaxDays>N</buildRetentionMaxDays>
    <buildRetentionCount>N</buildRetentionCount>
    <buildUrl>..</buildUrl>
    <principal>..</principal>
  </buildInfo>
  <deployProperties>
    <maven>awesome</maven>
  </deployProperties>
  <publisher>
    <contextUrl>http://localhost:8081/artifactory</contextUrl>
    <username>${username}</username>
    <password>${password}</password>
    <excludePatterns>*-tests.jar</excludePatterns>
    <repoKey>libs-release-local</repoKey>
    <snapshotRepoKey>libs-snapshot-local</snapshotRepoKey>

    <publishArtifacts>true/false</publishArtifacts>
    <publishBuildInfo>true/false</publishBuildInfo>
    <excludePatterns>..</excludePatterns>
    <includePatterns>..</includePatterns>
    <filterExcludedArtifactsFromBuild>true/false</filterExcludedArtifactsFromBuild>
    <!-- If true build information published to Artifactory will include implicit project as well as build-time dependencies -->
    <recordAllDependencies>true/false</recordAllDependencies>
    <!-- Minimum file size in KB for which the plugin performs checksum deploy optimization. Default: 10. Set to 0 to disable uploading files with checksum that already exists in Artifactory. -->
    <minChecksumDeploySizeKb>10</minChecksumDeploySizeKb>
  </publisher>
  <proxy>
    <host>proxy.jfrog.io</host>
    <port>8888</port>
    <username>proxyUser</username>
    <password>proxyPassword</password>
  </proxy>
</configuration>

Configuration Details

Configuration Description
<deployProperties> Specifies properties you can attach to published artifacts. For example: prop-value.
<artifactory> Specifies whether environment variables are published as part of BuildInfo metadata and which include or exclude patterns are applied when variables are collected
<publisher> Defines an Artifactory repository where build artifacts should be published using a combination of a <contextUrl> and <repoKey>/<snapshotRepoKey>. Build artifacts are deployed if the deploy goal is executed and only after all modules are built.
<buildInfo> Updates BuildInfo metadata published together with build artifacts. You can configure whether or not BuildInfo metadata is published using the configuration.
<proxy> Specifies HTTP/S proxy.

Reading Environment Variables and System Properties

Every build server provides its own set of environment variables. You can utilize these variables when configuring the plugin as shown in the following example:

<configuration>
  <publisher>
    <contextUrl>{{ARTIFACTORY_CONTEXT_URL|"https://acme.jfrog.io"}}</contextUrl>
  </publisher>
  <buildInfo>
    <buildNumber>{{DRONE_BUILD_NUMBER|TRAVIS_BUILD_NUMBER|CI_BUILD_NUMBER|BUILD_NUMBER|"333"}}</buildNumber>
    <buildUrl>{{DRONE_BUILD_URL|CI_BUILD_URL|BUILD_URL}}</buildUrl>
  </buildInfo>
</configuration>

Any plugin configuration value can contain several {{ .. }} expressions. Each expression can contain a single or multiple environment variables or system properties to be used. The expression syntax allows you to provide enough variables to accommodate any build server requirements according to the following rules:

  • Each expression can contain several variables, separated by a ' | ' character to be used with a configuration value.
  • The last value in a list is the default that will be used if none of the previous variables is available as an environment variable or a system property.

For example, for the expression {{V1|V2|"defaultValue"}} the plugin will attempt to locate environment variable V1 , then system property V1, then environment variable or system property V2 , and if none of these is available, "defaultValue" will be used.

If the last value is not a string (as denoted by the quotation marks) and the variable cannot be resolved, null will be used (For example, for expression {{V1|V2}} where neither V1 nor V2 can be resolved).

Example

The following project provides a working example of using the plugin: Maven Artifactory Plugin Example.

๐Ÿ’ป Contributions

We welcome pull requests from the community. To help us improve this project, please read our Contribution guide.

artifactory-maven-plugin's People

Contributors

dependabot[bot] avatar markrekveld avatar or-geva avatar rdeangelis83 avatar slawekjaranowski avatar sverdlov93 avatar yahavi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

artifactory-maven-plugin's Issues

Support for deployment of non maven artifacts - ie. vagrant box

Is your feature request related to a problem? Please describe.
Would like to use maven for packaging a vagrant.box (a jar/zip/tgz) and push to artifactory Vagrant repository
https://www.jfrog.com/confluence/display/JFROG/Vagrant+Repositories

Describe the solution you'd like to see
Automatically choose appropriate method/args to publish to non maven2 repo
or allow specific configuration of target repository type such as <type>vagrant</type> with a default of maven2
providing artifact name box_name, version box_version
additional configuration may be required for box_provider - or take it from the .box/metadata.json

Describe alternatives you've considered
Maven and gradle plugins for Vagrant cover interactive usage and not publishing of box artifacts and so have no knowledge of artifactory
Using ant or rest maven plugins to call rest api https://stackoverflow.com/questions/7551711/maven-plugin-to-call-or-invoke-a-rest-web-service

vcsUrl is ignored when uploading buildInfo

Describe the bug
Even if the vcsUrl property is specified in the pom.xml, the plugin uses the one from the local git repository. This is an issue with our build server (Bamboo) because of the way it handles git repository caching. When caching is enabled, the git repository origin remote will point to a file:// url which contains the path to the repository cache instead of the actual remote url.

To Reproduce
Clone a repository with a maven project that uses the Artifactory maven plugin. Put the following in the plugin configuration:

<buildInfo>
  <vcsUrl>ssh://[email protected]/path/to/repo.git</vcsUrl>
</buildInfo>

Run the build (mvn deploy) and look at the VCS tab on the build result page. The url will show the git remote url instead of whatever was specified in the vcsUrl tag.

Expected behavior
The vcsUrl configuration in the pom.xml should have priority over the remote url in the .git folder

Screenshots
firefox_8p7IvVOPsA

Versions

  • Artifactory Maven plugin version: 3.4.0
  • Artifactory version: 7.35.2
  • Maven version: 3.6.3

Additional context
Add any other context about the problem here.

Build info includes username and password

How can we help?

Hi,

I'm running the sample from here - https://github.com/jfrog/project-examples/tree/master/artifactory-maven-plugin-example. The big problem is that the username/password in the pom and settings.xml files are being stored in the buildinfo within Artifactory. Is there a way to exclude username and password from all fields in Artifactory's build info json ?

To be clear, exported username and password variables in the environment. Run the sample, which read the values and published to Artifactory correctly. But as mentioned, the problem is that the credentials from the environment are included in the buildinfo json. So, this should be easy to reproduce:

$ export username=x
$ export password=y
$ /art-build-deploy.sh 1

Check buildinfo json in Artifactory and you will see both x and y from above in the data! pom.xml exclude section contains these as well:

<artifactory>
    <includeEnvVars>true</includeEnvVars>
    <envVarsExcludePatterns>*username*,*password*,*secret*,*key*,*token*,*passphrase*</envVarsExcludePatterns>
    <timeoutSec>60</timeoutSec>
</artifactory>

BuildInfo JSON with username and password:

    "modules": [{
        "properties": {
            "maven.compiler.target": "1.8",
            "password": "x",
            "maven.compiler.source": "1.8",
            "project.build.sourceEncoding": "UTF-8",
            "username": "y"
        },

Looks like the problem is fixed the Jenkins plugin ? -- jfrog/jenkins-artifactory-plugin@901b549

Maven deploy fails when the classifier string value is too long

Is your feature request related to a problem? Please describe.
The maven deploy fails when the classifier attribute has a too-long string value in the pom file. It happens when the classifier string length is more than 64 characters.it gets the following error.

Client logs:
Caused by: java.io.IOException: JFrog service failed. Received 400: {
"errors" : [ {
"status" : 400,
"message" : "Could not insert build BuildWrapper(build=Build{version='1.0.1', name='tester/case', number='1643707380032', buildAgent=Maven/3.6.3, agent=artifactory-maven-plugin/3.3.0, started='2022-02-01T14:53:00.032+0530', durationMillis=1762, principal='null', artifactoryPrincipal='sandeep', artifactoryPluginVersion='null', url='null', parentName='null', parentNumber='null', vcs='[revision='714a3c3678157c5332f1ff6737c50cacab4ebb1d', commit message=', branch='', url='https://github.com/tester/test.git']', parentBuildId='null', licenseControl=null, buildRetention=null, runParameters=null, modules=[org.jfrog.build.api.Module@769c9418, org.jfrog.build.api.Module@9b0b8a03, org.jfrog.build.api.Module@fbfb1011], statuses=null, buildDependencies=null, issues=null, governance=null}, buildRepo=artifactory-build-info)"
} ]
}

Artifactory logs:
Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(64)
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553)

Steps to reproduce

  1. classifier value in dependency of the child pom file is too long (attached sample Maven project).

Child pom.xml:

<parent>
<artifactId>repro-build-info-too-long</artifactId>
<groupId>org.sonarsource</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>module-depending-on-long-classifier</artifactId>
<name>module-dependeing-on-long-classifier</name>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>module-with-long-classifier</artifactId>
<version>${project.version}</version>
<classifier>listenablefuture-9999.0-empty-to-avoid-conflict-with-guava-very-long</classifier>
</dependency>
</dependencies>

Parent pom.xml :
<groupId>org.sonarsource</groupId>
<artifactId>repro-build-info-too-long</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>repro-build-info-too-long</name>
<modules>
<module>module-with-long-classifier</module>
<module>module-depending-on-long-classifier</module>
</modules>

  1. Execute the maven deploy command
    maven deploy -U

Describe the solution you'd like to see
Maven deploy command should be successful even though the classifier value is too long.

Additional context

Should be compatible with the upcoming 4.x Maven release

Describe the bug

When enabling plugin validation I see some warnings about this plugin not being ready for Maven 4.x. This should be fixed.

Current behavior

[WARNING]    * Plugin depends on the deprecated Maven 2.x compatibility layer, which may not be supported in Maven 4.x
[WARNING]    * Plugin should declare these Maven artifacts in `provided` scope: [org.apache.maven:maven-compat:3.8.6, org.apache.maven:maven-resolver-provider:3.8.6, org.apache.maven:maven-settings-builder:3.8.6, org.apache.maven:maven-repository-metadata:3.8.6, org.apache.maven:maven-core:3.8.6, org.apache.maven:maven-model-builder:3.8.6, org.apache.maven:maven-plugin-api:3.8.6, org.apache.maven:maven-model:3.8.6, org.apache.maven:maven-builder-support:3.8.6, org.apache.maven:maven-settings:3.8.6]
[WARNING] 
[WARNING]  * org.jfrog.buildinfo:artifactory-maven-plugin:3.6.1
[WARNING]   Declared at location(s):
[WARNING]    * <REDACTED>
[WARNING]   Used in module(s):
[WARNING]    * <REDACTED> (pom.xml)
[WARNING]   Plugin issue(s):
[WARNING]    * Plugin should declare these Maven artifacts in `provided` scope: [org.apache.maven:maven-artifact:3.3.9, org.apache.maven:maven-settings-builder:3.3.9, org.apache.maven:maven-repository-metadata:3.3.9, org.apache.maven:maven-builder-support:3.3.9, org.apache.maven:maven-core:3.3.9, org.apache.maven:maven-aether-provider:3.3.9, org.apache.maven:maven-settings:3.3.9, org.apache.maven:maven-plugin-api:3.3.9, org.apache.maven:maven-model-builder:3.3.9, org.apache.maven:maven-model:3.3.9]
[WARNING] 
[WARNING] 
[WARNING] Fix reported issues by adjusting plugin configuration or by upgrading above listed plugins. If no upgrade available, please notify plugin maintainers about reported issues.

Reproduction steps

  • Start with a Maven project configured with this plugin.
  • Run the build with a recent version of Maven (we use version 3.9.2)
  • Supply the following CLI argument: -Dmaven.plugin.validation=VERBOSE

Expected behavior

No warnings about this plugin emitted.

Artifactory Maven plugin version

3.6.1

Operating system type and version

N/A

JFrog Artifactory version

N/A

Maven version

3.9.2

artifactory maven plugin not deploying poms for OSGi bundles (packageType=bundle)

Describe the bug
deployment of OSGi bundles (=bundle in the pom.xml) results in the deployment only pushing the .jars, but it seems to ignore the .pom and does not push it to artifactory.

To Reproduce
Create an osgi-based project that uses the maven-bundle-plugin to build an OSGi bundle. See https://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html for example. This results in a standard .jar, .-test.jar, *.pom, etc. being installed into the local mvn repository during 'install' processing. However during 'deploy' via the artifactory maven plugin, only the .jar assets are deployed. In contrast, the maven-deploy-plugin, if used as an alternative to the artifactory plugin will deploy the .pom as well as the jars.

Expected behavior
The .pom file should be pushed

Screenshots
N/A

Versions

  • Artifactory Maven plugin version: 3.4.0 and 3.2.3 (tried both)
  • Artifactory version: Artifactory Professional 5.2.0 rev 50024
  • Maven version: 3.3.9

Additional context

"No implementation for RepositoryListener was bound" error

Describe the bug

when invoking "mvn deploy" on a Maven project using this plugin I get following stacktrace:

Current behavior

[INFO] --- artifactory:3.6.1:publish (build-info) @ demo ---
[WARNING] Error injecting: org.jfrog.buildinfo.ArtifactoryMojo
com.google.inject.ProvisionException: Unable to provision, see the following errors:

  1. No implementation for RepositoryListener was bound.
    while locating ArtifactoryMojo

1 error

======================
Full classname legend:

ArtifactoryMojo: "org.jfrog.buildinfo.ArtifactoryMojo"
RepositoryListener: "org.jfrog.buildinfo.resolution.RepositoryListener"

End of classname legend:

at com.google.inject.internal.InternalProvisionException.toProvisionException (InternalProvisionException.java:251)
at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1104)
at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1139)
at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48)
at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:86)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:57)
at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:67)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:109)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:124)
at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:66)
at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:62)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:47)
at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1101)
at org.eclipse.sisu.inject.Guice4$1.get (Guice4.java:162)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51)
at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263)
at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:255)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:491)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:114)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:568)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:48 min
[INFO] Finished at: 2023-07-19T11:35:39+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jfrog.buildinfo:artifactory-maven-plugin:3.6.1:publish (build-info) on project demo: Execution build-info of goal org.jfrog.buildinfo:artifactory-maven-plugin:3.6.1:publish failed: Unable to load the mojo 'publish' (or one of its required components) from the plugin 'org.jfrog.buildinfo:artifactory-maven-plugin:3.6.1': com.google.inject.ProvisionException: Unable to provision, see the following errors:
[ERROR]
[ERROR] 1) No implementation for RepositoryListener was bound.
[ERROR] while locating ArtifactoryMojo
[ERROR] at ClassRealm[plugin>org.jfrog.buildinfo:artifactory-maven-plugin:3.6.1, parent: ClassLoaders$AppClassLoader@2a139a55]
[ERROR] _ installed by: WireModule -> PlexusBindingModule
[ERROR] while locating Mojo annotated with @nAmed("org.jfrog.buildinfo:artifactory-maven-plugin:3.6.1:publish")
[ERROR]
[ERROR] 1 error
[ERROR]
[ERROR] ======================
[ERROR] Full classname legend:
[ERROR] ======================
[ERROR] ArtifactoryMojo: "org.jfrog.buildinfo.ArtifactoryMojo"
[ERROR] ClassLoaders$AppClassLoader: "jdk.internal.loader.ClassLoaders$AppClassLoader"
[ERROR] Mojo: "org.apache.maven.plugin.Mojo"
[ERROR] Named: "com.google.inject.name.Named"
[ERROR] PlexusBindingModule: "org.eclipse.sisu.plexus.PlexusBindingModule"
[ERROR] RepositoryListener: "org.jfrog.buildinfo.resolution.RepositoryListener"
[ERROR] WireModule: "org.eclipse.sisu.wire.WireModule"
[ERROR] ========================
[ERROR] End of classname legend:
[ERROR] ========================
[ERROR]
[ERROR] role: org.apache.maven.plugin.Mojo
[ERROR] roleHint: org.jfrog.buildinfo:artifactory-maven-plugin:3.6.1:publish
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

Reproduction steps

To reproduce:

  • create a simple Maven project with Spring Boot Initializer;
  • Add following snippert to pom.xml:

<build> <plugins> <plugin> <groupId>org.graalvm.buildtools</groupId> <artifactId>native-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.jfrog.buildinfo</groupId> <artifactId>artifactory-maven-plugin</artifactId> <version>3.6.1</version> <executions> <execution> <id>build-info</id> <goals> <goal>publish</goal> </goals> <configuration> <publisher> <contextUrl>https://myArtifactoryInstance/artifactory</contextUrl> <username>XXX</username> <password>yyy</password> <repoKey>releaseRepo</repoKey> <snapshotRepoKey>snapshotRepo</snapshotRepoKey> </publisher> </configuration> </execution> </executions> </plugin> </plugins> </build>

Expected behavior

I expect a successfull execution and that this plugin fetch by default Artifactory infos from distributionManagement tag.

Artifactory Maven plugin version

3.6.1

Operating system type and version

Windows 10 Entreprise

JFrog Artifactory version

Enterprise Plus 7.31.16 rev 73116900

Maven version

3.9.3

Support IssuesTrackerHandler (buildInfo.issues.tracker)

Is your feature request related to a problem? Please describe.

buildInfo.issues.tracker does not work in this plugin.

            <configuration>
              <buildInfo>
                <issues.tracker.name>gitlab</issues.tracker.name>
              </buildInfo>
            </configuration>
Cannot find 'buildInfo.issues.tracker.name' in class org.jfrog.buildinfo.Config$BuildInfo

Describe the solution you'd like to see

Support IssuesTrackerHandler.

Describe alternatives you've considered

doNothing,

Additional context

see: https://github.com/jfrog/build-info/blob/ca2e8fa51a2e1f854654f6f965af29d3e6820226/build-info-extractor/src/main/java/org/jfrog/build/extractor/clientConfiguration/ArtifactoryClientConfiguration.java#L1080
see: https://github.com/jfrog/build-info/blob/ca2e8fa51a2e1f854654f6f965af29d3e6820226/build-info-extractor/src/main/java/org/jfrog/build/extractor/clientConfiguration/ArtifactoryClientConfiguration.java#L1029
see: https://github.com/jfrog/build-info-go/blob/df4947b5b00cd42b64de3d5aca7ab5d735ad07f8/buildinfo-schema.json#L195

Properties on the direct parent folder when deploying an Artifact

Is your feature request related to a problem? Please describe.

Currently it is tedious to search a project in Artifactory vi a property as it list every individual files.

Describe the solution you'd like to see

Being able to set a property on the parent folder of the deployed artifact (the version folder of the deployed artifact).

Describe alternatives you've considered

  • Manually doing it for 100+ projects
  • Using the REST API, but does not scale with the creation of new projects, would require to continually run a tool to do so

Additional context

No response

Ignores nonProxyHosts from settings.xml

Describe the bug

The proxy support merged with #64 and included in release 3.6.0 ignores the <nonProxyHosts> setting from settings.xml

Current behavior

Plugin does not consider proxy exceptions when connecting to Artifactory.

Reproduction steps

  1. Consider this settings in Maven's settings.xml:
    <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy.corp.bogus</host>
      <port>80</port>
      <nonProxyHosts>localhost*|127.0.0.1|*.corp.bogus</nonProxyHosts>
    </proxy>
  1. Try to reach an Artifactory server at artifactory.corp.bogus
  2. The plugin tries to connect to the Artifactory server through the proxy and fails

Expected behavior

Plugin should consider proxy exceptions when connecting to Artifactory.

Artifactory Maven plugin version

3.6.0

Operating system type and version

N/A

JFrog Artifactory version

No response

Maven version

3.9.1

Artifacts number is 0 when executing with maven-deploy-plugin

Hello team!

During using your plugin I found a strange behavior together with maven-deploy-plugin. Could you assist, please?

In the project, we're using on the same goal deploy two plugins artifatory-maven-plugin and maven-deploy-plugin(this plugin is used for deploying additional manifest files via mvn deploy:deploy-file). After the execution artifacts number is 0, I assume it's because of some concurrent behaviors. As I understand there is no way to execute the plugin on other goals and phases.

ability for deploy if test in project was failed or have errors

Is your feature request related to a problem? Please describe.
After i add tests in my project, deploy was broken if tests failed. I need deploy always even if tests failed.

Describe the solution you'd like to see
Add option in configuration ignoreTests.

Describe alternatives you've considered
Add option skip test module/don't collect build info for tests.

NullPointerException in v3.6.0 with no proxy config

Describe the bug

Several of our builds are failing since the release of version 3.6.0 with message NullPointerException
We do not fix the plugin version in our poms so the builds automatically use the latest version
This appears to be due to the introduction of the proxy configuration in the plugin

Current behavior

Build fails with this error

09:50:21  [ERROR] Failed to execute goal org.jfrog.buildinfo:artifactory-maven-plugin:3.6.0:publish (build-info) on project root: Execution build-info of goal org.jfrog.buildinfo:artifactory-maven-plugin:3.6.0:publish failed. NullPointerException -> [Help 1]

Running with mvn -X reveals the stack trace

11:31:38  [INFO] ------------------------------------------------------------------------
11:31:38  [INFO] BUILD FAILURE
11:31:38  [INFO] ------------------------------------------------------------------------
11:31:38  [INFO] Total time:  3.560 s
11:31:38  [INFO] Finished at: 2023-04-03T09:31:38Z    11:31:38  [INFO] Finished at: 2023-04-03T09:31:38Z
11:31:38  [INFO] ------------------------------------------------------------------------
11:31:38  [ERROR] Failed to execute goal org.jfrog.buildinfo:artifactory-maven-plugin:3.6.0:publish (build-info) on project root: Execution build-info of goal org.jfrog.buildinfo:artifactory-maven-plugin:3.6.0:publish failed. NullPointerException -> [Help 1]
11:31:38  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jfrog.buildinfo:artifactory-maven-plugin:3.6.0:publish (build-info) on project root: Execution build-info of goal org.jfrog.buildinfo:artifactory-maven-plugin:3.6.0:publish failed.
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
11:31:38      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
11:31:38      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
11:31:38      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
11:31:38      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
11:31:38      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
11:31:38      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
11:31:38      at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
11:31:38      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
11:31:38      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
11:31:38      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
11:31:38      at java.lang.reflect.Method.invoke (Method.java:498)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
11:31:38  Caused by: org.apache.maven.plugin.PluginExecutionException: Execution build-info of goal org.jfrog.buildinfo:artifactory-maven-plugin:3.6.0:publish failed.
11:31:38      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
11:31:38      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
11:31:38      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
11:31:38      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
11:31:38      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
11:31:38      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
11:31:38      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
11:31:38      at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
11:31:38      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
11:31:38      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
11:31:38      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
11:31:38      at java.lang.reflect.Method.invoke (Method.java:498)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
11:31:38  Caused by: java.lang.NullPointerException
11:31:38      at org.jfrog.buildinfo.ArtifactoryMojo.setupProxy (ArtifactoryMojo.java:94)
11:31:38      at org.jfrog.buildinfo.ArtifactoryMojo.execute (ArtifactoryMojo.java:72)
11:31:38      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
11:31:38      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
11:31:38      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
11:31:38      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
11:31:38      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
11:31:38      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
11:31:38      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
11:31:38      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
11:31:38      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
11:31:38      at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
11:31:38      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
11:31:38      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
11:31:38      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
11:31:38      at java.lang.reflect.Method.invoke (Method.java:498)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
11:31:38      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
11:31:38  [ERROR] 
11:31:38  [ERROR] 
11:31:38  [ERROR] For more information about the errors and possible solutions, please read the following articles:
11:31:38  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

Reproduction steps

Ensure that the user maven settings.xml does not contain any proxy settings
Create a new maven project (e.g. using the quickstart archetype command here)
Execute the plugin from the project directory
mvn org.jfrog.buildinfo:artifactory-maven-plugin:3.6.0:publish
The build fails with message NullPointerException

Expected behavior

The build should complete succesfully, as it does with version 3.5.1

Artifactory Maven plugin version

3.6.0

Operating system type and version

Windows 10

JFrog Artifactory version

No response

Maven version

3.8.3

Add a support for Java standard networking properties for proxy settings

Is your feature request related to a problem? Please describe.

Standard Apache Maven plugins takeover the the standard system properties like https.proxyHost, https.proxy and http.nonProxyHosts. This is not the case for the Artifactory Maven plugin. It allows to share the proxy configuration during the build for all java based tools (by the environment variable JAVA_TOOL_OPTIONS) without the need of individual settings.

Describe the solution you'd like to see

The networking standard system properties should be used when available and no other system property for proxy settings is available (like artifactory.proxy.host, artifactory.proxy.port).

Describe alternatives you've considered

No response

Additional context

No response

[Feature Request] Follow maven convention over configuration paradigm

Hello,

If I understand correctly this maven plugin make job of jfrog cli in a maven context to upload buildinfo as described in "Running maven" section of https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-BuildIntegration.

In my Gitlab CI context I have following pom.xml config:

				<plugin>
					<groupId>org.jfrog.buildinfo</groupId>
					<artifactId>artifactory-maven-plugin</artifactId>
					<version>3.4.0</version>
					<inherited>false</inherited>
					<executions>
						<execution>
							<id>build-info</id>
							<goals>
								<goal>publish</goal>
							</goals>
							<configuration>
								<publisher>
									<contextUrl>https://artifactory.corporate.com/artifactory/</contextUrl>
									<repoKey>myMavenRemoteRepo</repoKey>
									<username>${env.MAVEN_REPO_USER}</username>
									<password>${env.MAVEN_REPO_PASS}</password>
								</publisher>
								<!-- Maps Gitlab env var (https://docs.gitlab.com/ee/ci/variables/predefined_variables.html) to JFrog buildinfo -->
								<buildInfo>
									<buildUrl>${env.CI_JOB_URL}</buildUrl>
								</buildInfo>
							</configuration>
						</execution>
					</executions>
				</plugin>

And after invoking "mvn deploy" I get the buildUrl metadata in our Artifactory instance to have a link to the upload artifact related CI job.
But what should be better is to follow "convention over configuration" maven principle, especially about publisher part for which info already exist in distributionManagement tag and in settings.xml to allow maven deploy plugin to upload artifact.

Regards.

Add Support console parameter

Is your feature request related to a problem? Please describe.

https://maven.apache.org/guides/mini/guide-configuring-plugins.html#generic-configuration

for example
mvn org.jfrog.buildinfo:artifactory-maven-plugin:3.6.1 publish -Dpublisher.contextUrl=https://acme.jfrog.io - Dpublischer.username=deployer -Dpublisher.possword=dontellanyone -Dpublisher.repoKey=libs-release-local -Dpublischer.snapshotRepoKey=libs-snapshot-local

Describe the solution you'd like to see

add https://maven.apache.org/guides/mini/guide-configuring-plugins.html#generic-configuration in https://github.com/jfrog/artifactory-maven-plugin/blob/master/src/main/java/org/jfrog/buildinfo/ArtifactoryMojo.java

Describe alternatives you've considered

No response

Additional context

No response

Incomplete list of supported goals

Hello,

It seems list of goals to activate plugin in class AbstractMojo incomplete.

It is impossible to run mvn ... maven-deploy-plugin ..., maven understand only org.apache.maven.plugins:maven-deploy-plugin:deploy or deploy:deploy goals when we need to run exactly deploy directly.

So in current version we can use artifactory plugin only with goal 'deploy'

@mojo(name = "publish", defaultPhase = LifecyclePhase.VALIDATE, threadSafe = true)public class ArtifactoryMojo extends AbstractMojo { private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); private static final String[] DEPLOY_GOALS = {"deploy", "maven-deploy-plugin"};

Assuming reproducible builds, how about a do-not-fail-if-already-published config option

Is your feature request related to a problem? Please describe.

Context: Industry problem of how to keep release branches and CI forcing the maintainer of the release branch to update the version numbers of the modules that have change but not all versions numbers for the set of modules at the same time

Context: Refer: https://paulhammant.com/2018/05/23/examining-ci-cd-and-branching-models/

Context: Assuming https://maven.apache.org/guides/mini/guide-reproducible-builds.html for a Maven project in source control.

If a passing build with a so-configured artifactory-maven-plugin were to attempt to publish an artifact, it could first check to see whether the GAV has been published already. If it has and the SHA1 for the pom and the binary are the same, then it could simply pass that step without uploading the pom/binary.

This would be optional. Without do-not-fail-if-already-published=true the build would fail as it does today as the artifact is already published.

To reiterate:

  1. with do-not-fail-if-already-published=false (or the property is absent) then the build continues to fail if the GAV is published.
  2. with do-not-fail-if-already-published=true then the build passes the GAV is not yet published
  3. with do-not-fail-if-already-published=true then the build passes the GAV is already published and it has the same hashes (the actual upload is silently skipped)
  4. with do-not-fail-if-already-published=true then the build fails the GAV is already published and it has the different hashes

Describe alternatives you've considered

Asking for changes to Artifactory itself - changes to the plugin are simpler. And if JFrog say no, it can always be forked at the optional feature added anyway :-O

Additional context

Reproducible builds are an industry quest.

If achieved, there's a positive consequence for binary repositories everywhere - all languages & all binary repo idioms.

Caveats

I should never be allowed to name anything, so change do-not-fail-if-already-published to your preferred english expression.

Support for Artifactory Projects

What:
Provide support for Artifactory Projects, allowing users to set the projectId to which they want to publish artifacts and build information.

Why:
Currently, build information is always published to the default artifactory-build-info repository.
This will not work anymore for an organization that is using Artifactory Projects and that uses the pattern of only allowing developers/CI to only publish such artifacts/metadata to their respective projects.
In this case, such teams should be allowed to publish builds via the maven plugin to the corresponding myproject-build-info repository of their Artifactory project.

A potential solution for this use case might be to allow users to provide the projectId as an optional parameter in the plugin configuration input (e.g. a project tag under the publisher group) which would, in turn, be used along with the corresponding underlying REST API calls as a parameter.

Support Encrypted Password

Is your feature request related to a problem? Please describe.

This is a security enhancement request and follows the way other official plugins do it.

Describe the solution you'd like to see

Enable specifying the server.id to read from for the credentials (username and password)

In settings.xml:

<settings>
  ...
  <servers>
    <server>
      <id>artifactory</id>
      <username>username</username>
      <password>encrypted_password</password>
    </server>
  </servers>
  ...
</settings>

In artifactory-maven-plugin:

<publisher>
  <contextUrl>https://artifactory.int.bell.ca:443/artifactory</contextUrl>
  <serverCredentials>artifactory</serverCredentials>
</publisher>

The property from the artifactory-maven-plugin must match the server id found in the settings.xml.

Documentation on Maven Password Encryption:

Examples of how other official plugins do it:

How sql-maven-plugin reads the settings:

Describe alternatives you've considered

Access tokens, but it is still stored in plain text in the settings.xml or pom.xml.

Additional context

No response

Maven issues after publishing pom files with the predefined variables

Describe the bug
Maven install/deploy fails when we publish POM files with the predefined variables like {revision} instead of actual values to the Artifactory using the Artifactory Maven plugin.

To Reproduce

  1. Clone a sample multi module project and update the artifacts to predefined variables (like {revision} and {sha1}) instead of actual value in the pom.xml file as shown here.

  2. Added the extension(https://github.com/jcgay/unique-revision-maven-filtering) which replaces the ${revision} and {sha1} version in POM to actual value to the pom.xml file in target folder when installing / deploying the artifacts.

  3. Deploy the project to the Artifactory.
    Sample command used : mvn clean deploy -Drevision=2.0.0-SNAPSHOT -Dsha1=123 -Dbuildnumber=1

Parent pom.xml
<artifactId>multi</artifactId>
<version>${revision}-${sha1}</version>
<packaging>pom</packaging>

Child pom.xml:

<parent>
<groupId>org.jfrog.test</groupId>
<artifactId>multi</artifactId>
<version>${revision}-${sha1}</version>
</parent>
<artifactId>multi1</artifactId>
<packaging>jar</packaging>
<name>Multi 1</name>

  1. Now, clone a new maven project and add the โ€œmulti1โ€ project (above project) as a dependency to it.

As shown below:
<dependency>
<groupId>org.jfrog.test</groupId>
<artifactId>multi1</artifactId>
<version>${revision}-${sha1}</version>
</dependency>

  1. run the maven clean install command and it results in the below error.
    Sample command used : mvn clean install -Drevision=2.0.0-SNAPSHOT -Dbuildnumber=1 -Dsha1=123

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.650 s
[INFO] Finished at: 2021-04-17T20:40:07+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project maven-example: Could not resolve dependencies for project org.jfrog.example:maven-example:jar:1.0-SNAPSHOT: Failed to collect dependencies at org.jfrog.test:multi1:jar:2.0.0-SNAPSHOT-123: Failed to read artifact descriptor for org.jfrog.test:multi1:jar:2.0.0-SNAPSHOT-123: Could not find artifact org.jfrog.test:multi:pom:${revision}-${sha1} in central (http://localhost:8081/artifactory/san-libs-release) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Expected behavior
Maven should resolve the dependency artifacts successfully as the given version is existing in the repository.

Screenshots
Attached

Versions

  • Artifactory Maven plugin version: 3.2.1
  • Artifactory version: 7.15.2
  • Maven version: apache-maven-3.6.3

Additional context

Pom files in the target folders are created with actual values (i.e, 2.0.0-SNAPSHOT-123). Please find the below pom file snippet of the version which got created in the target folder for the multi1 project.

<parent>
<groupId>org.jfrog.test</groupId>
<artifactId>multi</artifactId>
<version>2.0.0-SNAPSHOT-123</version>
</parent>

However, the pom file from the source folder with predefined value got deployed to the Artifactory (Please refer to the attached screenshot) instead of the pom file from the target folder.
pomfile_sample

Publishing Build Info to Projects Using the Maven Artifactory Plugin

We would like the ability to publish the build information from a Maven build to a specific project in Artifactory (as opposed to the general artifactory-build-info location) via the Artifactory Maven Plugin or customizable pom parameter.

Currently the only way to implement this is via the JFrog CLI which would greatly complicate our builds.

Deploys artifacts when `maven.deploy.skip` is `true`

Describe the bug

Deploys artifacts which should not be deployed.

To Reproduce

Create a multi-module Maven project where one module contains this config:

  <properties>
    <maven.deploy.skip>true</maven.deploy.skip>
  </properties>

Expected behavior

Modules marked with maven.deploy.skip should not be deployed.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions

  • Artifactory Maven plugin version: 3.4.0
  • Artifactory version: 7.37.17
  • Maven version: 3.8.6

Additional context
Add any other context about the problem here.

HTTP Proxy not used

Describe the bug

From our CI/CD Pipeline we need to use a proxy to access artifactory. In the /root/.m2/settings.xml there are proxy settings and they work to download plugin & dependencies. The artifactory-maven-plugin seem to ignore these settings and I dont find a documented way to use a proxy.

Current behavior

[WARNING] Error occurred for request GET /artifactory/api/system/version HTTP/1.1: Connect to artifactory.x.eu:443 [artifactory.x.eu/167.x.x.201] failed: Connection timed out.
[WARNING] Error occurred for request GET /artifactory/api/system/version HTTP/1.1: Connect to artifactory.x.eu:443 [artifactory.x.eu/167.x.x.201] failed: Connection timed out.

pom.xml

  <build>
    <plugins>
      <plugin>
        <groupId>org.jfrog.buildinfo</groupId>
        <artifactId>artifactory-maven-plugin</artifactId>
        <version>3.5.2</version>
        <inherited>false</inherited>
        <executions>
          <execution>
            <id>build-info</id>
            <goals>
              <goal>publish</goal>
            </goals>
            <configuration>
              <deployProperties>
                <build.timestamp>${maven.build.timestamp}</build.timestamp>
                <build.name>${project.artifactId}</build.name>
                <build.number>${buildNumber}</build.number>
              </deployProperties>
              <publisher>
                  <contextUrl>${ARTIFACTORY_URL}</contextUrl>
                  <username>${ARTIFACTORY_USER}</username>
                  <password>${ARTIFACTORY_PASSWORD}</password>
                  <repoKey>x-test-platform</repoKey>
                  <snapshotRepoKey>x-test-platform</snapshotRepoKey>
              </publisher>
              <proxy>
                <host>proxy.x.de</host>
                <port>x</port>
              </proxy>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

Reproduction steps

No response

Expected behavior

No response

Artifactory Maven plugin version

3.5.2

Operating system type and version

Ubuntu 20.04

JFrog Artifactory version

No response

Maven version

No response

How to set VCS build properties in Github Actions environment?

I'm running a build in a Github Actions workflow and I've noticed that the vcsRevision build property isn't set on the published artifacts. I saw in the build-info repo an issue about setting vcs properties and the release notes say VCS info is populated as of version 3.3.0.

Am I missing some configuration? Do I need to explicitly set it from an environment variable?

Config:

<plugin>
  <groupId>org.jfrog.buildinfo</groupId>
  <artifactId>artifactory-maven-plugin</artifactId>
  <version>3.4.0</version>
  <inherited>false</inherited>
  <executions>
	  <execution>
		  <id>build-info</id>
		  <goals>
			  <goal>publish</goal>
		  </goals>
		  <configuration>
			  <deployProperties>
				  <groupId>${project.groupId}</groupId>
				  <artifactId>${project.artifactId}</artifactId>
				  <version>${project.version}</version>
			  </deployProperties>
			  <publisher>
				  <publishArtifacts>true</publishArtifacts>
				  <publishBuildInfo>true</publishBuildInfo>
				  <contextUrl>https://internal.jfrog.io/artifactory</contextUrl>
				  <username>${artifactory.user}</username>
				  <password>${artifactory.password}</password>
				  <repoKey>lib-release</repoKey>
				  <snapshotRepoKey>lib-snapshot</snapshotRepoKey>
			  </publisher>
			  <buildInfo>
				  <buildNumber>${build.number}</buildNumber>
				  <buildUrl>${build.url}</buildUrl>
				  <agentName>${build.agent}</agentName>
			  </buildInfo>
		  </configuration>
	  </execution>
  </executions>
  </plugin>

Integrate with jib-maven-plugin?

Is your feature request related to a problem? Please describe.

When doing "plain" maven builds, this plugin already allows "seamless" integration, but if the build contains a jib step, an additional run of JFrog CLI (or other external tools) is needed.

Describe the solution you'd like to see

In the simplest case, this plugin would detect a jib run inside the current build and "just" upload the correct metadata at the end of the build, so the jib images are associated with the maven build.

Describe alternatives you've considered

No response

Additional context

No response

artifactory-maven-plugin-example issues

I found 2 issues when working with the example on the title of this issue.
For each of them, I have attached a UI Snapshot.
Issue 1: In order to make the example work, I had to modify the parent pom to add the following to properties, else it will not even compile.
<maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target>

Issue 2: Running the example twice i.e., pushing the same artifact (making no changes to anything) to a Maven Repository, is creating 2 wars, but with different checksums. This is a little non-intuitive, considering I have not changed
anything.

Images are as follows, in the same order as issues.

Screen Shot 2021-01-26 at 7 06 00 PM

Screen Shot 2021-01-26 at 7 08 19 PM

The plugin does not respect the user-group-permission target association.

Description:

The plugin does not respect the user-group-permission target association. A permission target is created, which has the Read, Annotate and Deploy/Cache permission for the associated groups. However, it does not have the "Delete/Overwrite" permission for the groups. In that case, when we try to deploy using "mvn clean deploy" for the second time, it should be throwing 403. However, it is not complaining about it and deploying it without any issues.

To Reproduce

  1. Create a SAML user or an internal user - for example - "[email protected]"

  2. Add that user manually to two groups "readers" and "remote-cache".

  3. Now these two groups "readers" and "remote-cache" are part of a permission target "testoverwrite" and the groups have "Read", "Annotate" and "Deploy/Cache" permission in this permission target for the repositories (libs-release-local, libs-snapshots-local) and as well as for the builds.

  4. Create a folder and paste the attached "pom.xml" file into that folder.

  5. Configure the "settings.xml" from the "Set Me Button" and change the username and password section with the created one.

  6. Run the "mvn clean install" from that folder to build it.

  7. Run the "mvn clean deploy" two times and the deploy will be successful

Expected behavior
If we run the "mvn clean deploy" for the second time without changing anything, it should throw a "403 Forbidden" error as the same file is being tried to be deployed to the repository. The expected behavior can be seen when we use "distributionManagement" in the "pom.xml" file.

Screenshots
The required files are attached with this issue.

Versions

  • Artifactory Maven plugin version: 3.2.3
  • Artifactory version: 7.24.4
  • Maven version:
    Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
    Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec
    Java version: 1.8.0_222, vendor: AdoptOpenJDK, runtime: /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre
    Default locale: en_IN, platform encoding: UTF-8
    OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"

Attachments:
pom.xml_use_case_reproduced_internal_user.txt
pom.xml_useCase_reproduced_SAML_user.txt
pom.xml_with_expected_behavior.txt

[BUG]: Repo link down?

Describe the bug
Maven can't access http://repo.jfrog.org/artifactory/plugins-releases

To Reproduce
Just run the compile script or sync script

Expected behavior
I expected that maven should work as always and compile / refresh my project

Screenshots
image

Versions

  • Artifactory Maven plugin version: I don't know.
  • Artifactory version: I don't know, the error just pops up.
  • Maven version: 3.8.1

Additional context
When I try opening the repo on my browser to check what's wrong, it returns a 503 error. [Unable to handle request]

maven dependencies not publishing to buildInfo

Describe the bug

When I have a pom.xml that has dependencies declared (see example below) and I run the
mvn artifactory:publish -Dpublish.record.all.dependencies=true (with the other required flags enabled too)
it is not adding the dependencies to the buildInfo record in artifactory.

Note: I tested this with 3.6.0, 3.6.1, and 3.6.2 of the build-info plugin and none of them seem to work.

See source code link for config option here: https://github.com/jfrog/build-info/blob/master/build-info-extractor/src/main/java/org/jfrog/build/extractor/clientConfiguration/ClientConfigurationFields.java#L38C39-L38C62

example pom:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         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>
    <groupId>com.myapp</groupId>
    <artifactId>mymavenapp</artifactId>
    <packaging>jar</packaging>
    <version>1.0</version>
    <name>mymavenapp</name>
    <url>https://github.com/myapp/mymavenapp</url>

    <properties>
        <java.version>11</java.version>
        <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>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.11</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.3.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</version>
                <configuration>
                        <!-- <release>10</release> -->
                        <source>1.8</source>
                        <target>1.8</target>
                        <!-- <executable>/usr/lib/jvm/java-11-openjdk-amd64/bin/javac</executable> -->
                        <!-- <enablePreview>true</enablePreview> -->
                </configuration>
            </plugin>
            <!-- This is just to make sure the class is set as main class to execute from the jar-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <transformers>
                                <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                                <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>edu.forty.bits.expression.SwitchExpressions</mainClass>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
            
  

Current behavior

publishes buildInfo but no dependencies included.

Reproduction steps

No response

Expected behavior

publishes dependencies with artifact modules in buildInfo similar to 2.x plugin behavior

Artifactory Maven plugin version

3.6.x

Operating system type and version

windows and RHE

JFrog Artifactory version

7.63.14

Maven version

3.9.6

Enable deployment through HTTP proxy

Our maven build runs on a machine that can connect to the internet only via an HTTP-proxy. The target nexus artifactory is only available via the internet. Although the http proxy is correctly configured (1) in the file .m2/settings.xml and (2) in the four environment variables [http[s]_(proxy|port)] and (3) in the four java standard system properties http[s].proxy(Host|Port), the artifactory-maven-plugin does not use and the attempt to deploy to the nexus artifactory fails with an exception:
{noformat}
[ERROR] Internal error: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Error occurred while publishing artifact to Artifactory: ...
[ERROR] Skipping deployment of remaining artifacts (if any) and build info. Connect to targethost.de:443 [targethost.de/111.22.33.44] failed: Connection timed out: connect
{noformat}

I would like to see some documented way to use the http proxy. Preferrably, the artifactory-maven-plugin should use the http proxy configured in the file .m2/settings.xml, but I would be happy with any other reliable way that somehow fits into the configuration framework.

Additional context

  • This feature has been requested before: http://forums.jfrog.org/Maven-Artifactory-Plugin-setting-http-proxy-td7579782.html
  • Other maven plugins do use our http proxy correctly
  • There is quite a lot of preparation in the present code (3.2.1), e.g. class org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration.ProxyHandler, but it does not seem to be actually used.
  • I have found a simple fix that works for me and which I plan to submit as a pull request

java.io.IOException: Could not publish build-info: Error occurred while requesting version information: Attempted read from closed stream.

Describe the bug

We have a circleci pipeline integrated with jfrog artifactory. Everything was working fine until recently we are getting below error when merge to master

Current behavior

[INFO] Artifactory Build Info Recorder: Deploying build info ...
[ERROR] Could not build the build-info object.
org.jfrog.build.util.VersionException: Error occurred while requesting version information: Attempted read from closed stream.
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.verifyCompatibleArtifactoryVersion (ArtifactoryBuildInfoClient.java:390)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.buildInfoToJsonString (ArtifactoryBuildInfoClient.java:620)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.sendBuildInfo (ArtifactoryBuildInfoClient.java:258)
    at org.jfrog.build.extractor.retention.Utils.sendBuildAndBuildRetention (Utils.java:63)
    at org.jfrog.build.extractor.retention.Utils.sendBuildAndBuildRetention (Utils.java:58)
    at org.jfrog.build.extractor.maven.BuildDeploymentHelper.publishBuildInfo (BuildDeploymentHelper.java:120)
    at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:106)
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:173)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:136)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.io.IOException: Attempted read from closed stream.
    at org.apache.http.impl.io.ChunkedInputStream.read (ChunkedInputStream.java:177)
    at org.apache.http.conn.EofSensorInputStream.read (EofSensorInputStream.java:137)
    at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._loadMore (UTF8StreamJsonParser.java:205)
    at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._matchToken2 (UTF8StreamJsonParser.java:2841)
    at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._matchTrue (UTF8StreamJsonParser.java:2777)
    at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextFieldName (UTF8StreamJsonParser.java:1042)
    at com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer.deserializeObject (JsonNodeDeserializer.java:247)
    at com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer.deserializeObject (JsonNodeDeserializer.java:255)
    at com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer.deserialize (JsonNodeDeserializer.java:68)
    at com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer.deserialize (JsonNodeDeserializer.java:15)
    at com.fasterxml.jackson.databind.ObjectMapper._readValue (ObjectMapper.java:3984)
    at com.fasterxml.jackson.databind.ObjectMapper.readTree (ObjectMapper.java:2384)
    at com.fasterxml.jackson.core.JsonParser.readValueAsTree (JsonParser.java:1782)
    at org.jfrog.build.client.ArtifactoryHttpClient.getJsonNode (ArtifactoryHttpClient.java:199)
    at org.jfrog.build.client.ArtifactoryHttpClient.getVersion (ArtifactoryHttpClient.java:166)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.verifyCompatibleArtifactoryVersion (ArtifactoryBuildInfoClient.java:388)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.buildInfoToJsonString (ArtifactoryBuildInfoClient.java:620)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.sendBuildInfo (ArtifactoryBuildInfoClient.java:258)
    at org.jfrog.build.extractor.retention.Utils.sendBuildAndBuildRetention (Utils.java:63)
    at org.jfrog.build.extractor.retention.Utils.sendBuildAndBuildRetention (Utils.java:58)
    at org.jfrog.build.extractor.maven.BuildDeploymentHelper.publishBuildInfo (BuildDeploymentHelper.java:120)
    at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:106)
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:173)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:136)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR] org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed: 
java.lang.RuntimeException: java.io.IOException: Could not publish build-info: Error occurred while requesting version information: Attempted read from closed stream.
    at org.jfrog.build.extractor.maven.BuildDeploymentHelper.publishBuildInfo (BuildDeploymentHelper.java:123)
    at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:106)
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:173)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:136)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.io.IOException: Could not publish build-info: Error occurred while requesting version information: Attempted read from closed stream.
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.sendBuildInfo (ArtifactoryBuildInfoClient.java:261)
    at org.jfrog.build.extractor.retention.Utils.sendBuildAndBuildRetention (Utils.java:63)
    at org.jfrog.build.extractor.retention.Utils.sendBuildAndBuildRetention (Utils.java:58)
    at org.jfrog.build.extractor.maven.BuildDeploymentHelper.publishBuildInfo (BuildDeploymentHelper.java:120)
    at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:106)
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:173)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:136)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR] Internal error: java.lang.RuntimeException: org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed: java.io.IOException: Could not publish build-info: Error occurred while requesting version information: Attempted read from closed stream. -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed: 
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.RuntimeException: org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded() listener has failed: 
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:182)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:136)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.RuntimeException: java.io.IOException: Could not publish build-info: Error occurred while requesting version information: Attempted read from closed stream.
    at org.jfrog.build.extractor.maven.BuildDeploymentHelper.publishBuildInfo (BuildDeploymentHelper.java:123)
    at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:106)
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:173)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:136)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.io.IOException: Could not publish build-info: Error occurred while requesting version information: Attempted read from closed stream.
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.sendBuildInfo (ArtifactoryBuildInfoClient.java:261)
    at org.jfrog.build.extractor.retention.Utils.sendBuildAndBuildRetention (Utils.java:63)
    at org.jfrog.build.extractor.retention.Utils.sendBuildAndBuildRetention (Utils.java:58)
    at org.jfrog.build.extractor.maven.BuildDeploymentHelper.publishBuildInfo (BuildDeploymentHelper.java:120)
    at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deploy (BuildDeploymentHelper.java:106)
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionEnded (BuildInfoRecorder.java:173)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:136)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

Reproduction steps

No response

Expected behavior

No response

Artifactory Maven plugin version

2.7.0

Operating system type and version

linux

JFrog Artifactory version

No response

Maven version

No response

Request to re-add the ability of the plugin to read in environmental variables

In the artifactory-maven-plugin version-3.0.0, there was a breaking change where the expression syntax algorithm of environment and system variables has been removed.
Due to this, the ability of the plugin to read in environmental variables for the username, password, and build number is not happening.
If there are hundreds of project that was using this feature and after the upgrade of the plugin to 3.0.0, the users should change the way to read the environment variable in hundreds of projects.
So it would be helpful if JFrog re-add the feature back.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.