Coder Social home page Coder Social logo

jfrog / build-info Goto Github PK

View Code? Open in Web Editor NEW
145.0 53.0 153.0 106.48 MB

Artifactory's open integration layer for CI build servers

Home Page: https://www.buildinfo.org

License: Apache License 2.0

Java 97.41% Groovy 2.48% HTML 0.01% Go 0.02% Python 0.02% C# 0.02% Dockerfile 0.03% Shell 0.02%

build-info's Introduction

Build-Info

Build Info Extractor plugin Gradle plugin

Scanned by Frogbot Tests

Overview

Build Info is Artifactory's open integration layer for the CI servers and build tools. The build information is sent to Artifactory in json format.

Building and testing the sources

  • The code is built using Gradle and includes integration tests.
  • It must run using JDK 8 and Gradle 5.6.2. If you are using different gradle version you can use the provided gradle wrapper.
  • In order to run tests the following environment variables must be set:
export BITESTS_PLATFORM_URL='http://localhost:8081'
export BITESTS_PLATFORM_USERNAME=admin
export BITESTS_PLATFORM_ADMIN_TOKEN=admin-access-token
export BITESTS_ARTIFACTORY_PIP_ENV=/Users/user/venv-test/bin

See here how to generate an admin token for the above environment variable.

Building

When running the following commands to build the code, the entire testing suite is also executed. See the Testing section for configuration instructions prior to running the tests.

To build the code using the gradle wrapper in Unix run:

./gradlew clean build

To build the code using the gradle wrapper in Windows run:

gradlew clean build

To build the code using the environment gradle run:

gradle clean build

To build the code without running the tests, add to the "clean build" command the "-x test" option, for example:

./gradlew clean build -x test

Testing

To run all tests:

./gradlew clean test

Extractor tests

./gradlew clean build-info-api:test build-info-client:test build-info-extractor:test build-info-vcs:test

Maven tests

./gradlew clean build-info-extractor-maven3:test

Gradle tests

./gradlew clean build-info-extractor-gradle:test

npm tests

  • Add npm executable to the system search path (PATH environment variable).
  • npm 7.7 or above is required.
./gradlew clean build-info-extractor-npm:test

Go tests

  • Add Go executable to the system search path (PATH environment variable).
  • Go v1.14 or above is required.
./gradlew clean build-info-extractor-go:test

Pip tests

  • Add Python and pip executables to the system search path (PATH environment variable).
  • Pip tests must run inside a clean pip-environment. Create a virtual environment and provide its path using the 'BITESTS_ARTIFACTORY_PIP_ENV' variable. When running on a Windows machine, provide the path to the 'Scripts' directory. When running on a unix machine, provide the path to the 'bin' directory.
python -m venv buildinfo-tests-env
export BITESTS_ARTIFACTORY_PIP_ENV=/Users/user/buildinfo-tests-env/bin
./gradlew clean build-info-extractor-pip:test

NuGet tests

  • Add Nuget & Dotnet executable to the system search path (PATH environment variable).
./gradlew clean build-info-extractor-nuget:test

Docker tests

  • Docker tests run only on Linux/mac.
  • In addition to the general environment variables required for running the tests, you must set the following environment variables, required for the docker tests:
    export BITESTS_PLATFORM_CONTAINER_REGISTRY=127.0.0.1:8081
    export BITESTS_ARTIFACTORY_DOCKER_HOST=tcp://127.0.0.1:1234
  • For OSX agents, run a Socat container:
docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 127.0.0.1:1234:1234 bobrik/socat TCP-LISTEN:1234,fork UNIX-CONNECT:/var/run/docker.sock
  • Run tests:
./gradlew clean build-info-extractor-docker:test

More about build-info

Read more about build-info in the Build Integration documentation.

Release notes

The release notes are available here.

build-info's People

Contributors

alexeivainshtein avatar arothian avatar asafgabai avatar barbelity avatar dependabot[bot] avatar dimanevelev avatar elig avatar evgeny-goldin avatar evgeny-goldin-akqa avatar eyalb4doc avatar eyalbe4 avatar freddy33 avatar gailazar300 avatar jbaruch avatar jfrog-ecosystem avatar jfrogsolutionci avatar johntconklin avatar liorhson avatar liron-shalom avatar omerzi avatar or-geva avatar robinino avatar ronmjf avatar shikloshi avatar sverdlov93 avatar talarian1 avatar tamirhadad avatar tomerc-jfrog avatar yahavi avatar yoav 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

build-info's Issues

up-to-date check for jarAll task does not work

Let's assume we just have a change in the build-info-extractor-gradle project. While executing a gradle build we end up in:

:build-info-extractor-gradle:compileJava UP-TO-DATE
:build-info-extractor-gradle:compileGroovy
:build-info-extractor-gradle:processResources UP-TO-DATE
:build-info-extractor-gradle:classes
:build-info-extractor-gradle:jar
:build-info-extractor-gradle:jarAll UP-TO-DATE
:build-info-extractor-gradle:assemble

The jarAll task is reported as UP-TO-DATE although we had some changes in the code and classes as well as jar task got executed. As a result the uberJar does not contain the latest changes.

Rules model block or plugins is not supported

Current Behavior

Running the artifactoryPublish task does not publish MavenPublications created in the model block or by rules using the Rules Model configuration.

build.gradle

plugins {
  id 'java'
  id 'maven-publish'
  id "com.jfrog.artifactory" version "4.4.8"
}

model {
  publishing {
    publications {
      pluginMaven1(MavenPublication) {
      }
    }
  }
  tasks {
    wrapper {
      gradleVersion = '3.2'
    }
  }
}

artifactory {
  contextUrl = 'http://artifactory:8081/artifactory/'
  publish {
    repository {
      repoKey = 'gradle-local' // The Artifactory repository key to publish to
      username = "admin" // The publisher user name
      password = "*****" // The publisher password
    }
    defaults {
      publications('pluginMaven1')
    }
  }
}
> $ ./gradlew build
   -----------------------
> Publication named 'pluginMaven1' does not exist for project ':' in task ':artifactoryPublish'.

:artifactoryPublish

Deploying build descriptor to: http://artifactory:8081/artifactory/api/build

Build successfully deployed

Expected Behavior

We expect that this publishing plugin should use MavenPublication and other Publication types created inside of the software model.

Context

We use the 'java-gradle-plugin' for our Gradle plugin development to configure our publications.
This plugin makes use of the rules model.
We are also unable to use the publishing extension/block outside of the model because we have existing plugins built on top of it.

Publish properties aren't used by build-info-extractor-gradle?

Hi, I'm trying to understand the purpose of

artifactory {
    publish {
        defaults {
            properties = ['my_prop': 'my_value']
        }
    }
}

See https://www.jfrog.com/confluence/display/RTF/Gradle+Artifactory+Plugin . From what I see in the current code:

  • This statement calls BuildInfoBaseTask.setProperties().
  • When executing artifactoryPublish, BuildInfoBaseTask.prepareAndDeploy() gets these properties from TaskHelperPublications.collectDescriptorsAndArtifactsForUpload(), which gets them from TaskHelperPublications.getArtifactDeployDetails(), which gets them from TaskHelperPublications.addArtifactInfoToDeployDetails().
  • BuildInfoBaseTask.prepareAndDeploy() passes them to BuildInfoBaseTask.deployArtifacts(), which passes them to ArtifactoryBuildInfoClient.deployArtifact(), which doesn't use them.

As a consequence of course I see these properties nowhere in the Artifactory WebApp.

Am I missing something? Is it intended? (reserved for future use?) Is it a bug? Thanks for your help.

@maikelvdh, @martinm82, @ffung, you might be interested.

Maven plugin StackOverflowError in multimodule projects with extensions

In maven project with many modules and if one of them we use plugin as extension during "deploy" we got StackOverflowError.

Build generate many logs and don't stop.

You can test example project:
https://github.com/PayU-Tech/artifactory-test

Fragment of log:

Caused by: java.lang.RuntimeException: org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionStarted() listener has failed:
        ... 1024 more
Caused by: java.lang.StackOverflowError
        at java.io.ExpiringCache.entryFor(ExpiringCache.java:103)
        at java.io.ExpiringCache.get(ExpiringCache.java:78)
        at java.io.WinNTFileSystem.canonicalize(WinNTFileSystem.java:406)
        at java.io.File.getCanonicalPath(File.java:618)
        at java.io.FilePermission$1.run(FilePermission.java:215)
        at java.io.FilePermission$1.run(FilePermission.java:203)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.io.FilePermission.init(FilePermission.java:203)
        at java.io.FilePermission.<init>(FilePermission.java:277)
        at sun.net.www.protocol.file.FileURLConnection.getPermission(FileURLConnection.java:228)
        at sun.net.www.protocol.jar.JarFileFactory.getPermission(JarFileFactory.java:166)
        at sun.net.www.protocol.jar.JarFileFactory.getCachedJarFile(JarFileFactory.java:136)
        at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:91)
        at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
        at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:150)
        at java.net.URLClassLoader.getResourceAsStream(URLClassLoader.java:238)
        at org.jfrog.build.extractor.maven.BuildInfoModelPropertyResolver.getMavenVersion(BuildInfoModelPropertyResolver.java:181)
        at org.jfrog.build.extractor.maven.BuildInfoModelPropertyResolver.resolveProperties(BuildInfoModelPropertyResolver.java:54)
        at org.jfrog.build.extractor.maven.BuildInfoRecorder.sessionStarted(BuildInfoRecorder.java:129)
        ... 1005 more

HTTPClient and SNI support. Causes Atrifactory plugin to fail on vaild SSL cert

When trying to deploy an artifact to artifactory behind HTTPS when there is more than one HTTPS site hosted on the same server/IP address the following error is thrown.

Need to update Apache HTTPClient/HttpComponents to 4.3.2+. I would recommend 4.3.5.

This issue means that nothing can be deployed to Artifactory!!! The problem lies in this library.

See also: https://issues.jenkins-ci.org/browse/JENKINS-26403

Error:

Deploying artifact: https://repo.build.coy.com/artifactory/cs-snapshot/au/com/coy/skynet/spark-fire_2.10/0.1.0-SNAPSHOT/spark-fire_2.10-0.1.0-SNAPSHOT-sources.jar
ERROR: hostname in certificate didn't match: <repo.build.coy.com.au> != <docker.build.coy.com.au> OR <docker.build.coy.com.au> OR <www.docker.build.coy.com.au>
javax.net.ssl.SSLException: hostname in certificate didn't match: <repo.build.coy.com.au> != <docker.build.coy.com.au> OR <docker.build.coy.com.au> OR <www.docker.build.coy.com.au>
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:227)
at org.apache.http.conn.ssl.BrowserCompatHostnameVerifier.verify(BrowserCompatHostnameVerifier.java:54)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:147)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:437)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:643)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.jfrog.build.client.PreemptiveHttpClient.execute(PreemptiveHttpClient.java:88)
at org.jfrog.build.client.ArtifactoryHttpClient.execute(ArtifactoryHttpClient.java:193)
at org.jfrog.build.client.ArtifactoryHttpClient.upload(ArtifactoryHttpClient.java:189)
at org.jfrog.build.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:522)
at org.jfrog.build.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:302)
at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.deploy(GenericArtifactsDeployer.java:182)
at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:154)
at org.jfrog.hudson.generic.GenericArtifactsDeployer$FilesDeployerCallable.invoke(GenericArtifactsDeployer.java:122)
at hudson.FilePath.act(FilePath.java:918)
at hudson.FilePath.act(FilePath.java:896)
at org.jfrog.hudson.generic.GenericArtifactsDeployer.deploy(GenericArtifactsDeployer.java:82)
at org.jfrog.hudson.generic.ArtifactoryGenericConfigurator$1.tearDown(ArtifactoryGenericConfigurator.java:276)
at hudson.model.Build$BuildExecution.doRun(Build.java:171)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
at hudson.model.Run.execute(Run.java:1759)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
[WARNINGS] Skipping publisher since build result is FAILURE

Gradle plugin appears to cause artifacts to end up in maven local cache

I'm using the Gradle plugin by way of the Artifactory Bamboo plugin. In the configuration of the Artifactory Gradle task, I specify to call the "build" task, "Capture and Publish Build Info", "Publish Artifacts to Artifactory", "Publish Maven Descriptors", and "Use Maven 2 Compatible Patterns".

In my Bamboo logs, I see that the "artifactoryPublish" task is preceded by the "install" due to a dependency. Having "install" called results in the artifacts ending up in the maven local cache on the CI server, causing unnecessary disk usage and need for cleanup.

I think that the problematic logic may be around here:

https://github.com/JFrogDev/build-info/blob/a78049b65043e9eca2d5bbd20a3d12164521a033/build-info-extractor-gradle/src/main/groovy/org/jfrog/gradle/plugin/artifactory/task/BuildInfoConfigurationsTask.java#L374

Maven plugin sensitive data in build info.

Maven Artifactory Plugin deploys build info with all project properties.
Some of project properties can have sensitive data such as passwords, keys.

Please add possibility to exclude some properties from build info for example by some regular expressions or patterns on property name.

Support some default exclusion will be also pleasure, eg for "password" substrings, etc

Artifactory Gradle 3.0.0 plugin is incompatible with Maven plugin in Gradle 2.0

If I use both the Artifactory Gradle plugin and Gradle's built-in Maven plugin with Gradle 2.0, build fails. You can reproduce the problem with this build script:

plugins {
    id 'com.jfrog.artifactory' version '3.0.0'
}

apply plugin: 'maven'

The failure's due to a ClassNotFoundException:

$: gradle build --stacktrace

FAILURE: Build failed with an exception.

* What went wrong:
Failed to notify build listener.
> org/gradle/api/tasks/Upload

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.listener.ListenerNotificationException: Failed to notify build listener.
    at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:94)
    at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:31)
    at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:83)
    at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:31)
    at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
    at com.sun.proxy.$Proxy12.projectsEvaluated(Unknown Source)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:83)
    at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:31)
    at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
    at com.sun.proxy.$Proxy12.projectsEvaluated(Unknown Source)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:131)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:105)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:85)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:81)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:39)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:29)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
    at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:33)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: java.lang.NoClassDefFoundError: org/gradle/api/tasks/Upload
    at org.jfrog.gradle.plugin.artifactory.task.BuildInfoConfigurationsTask.setDefaultMavenDescriptor(BuildInfoConfigurationsTask.java:364)
    at org.jfrog.gradle.plugin.artifactory.task.BuildInfoConfigurationsTask.checkDependsOnArtifactsToPublish(BuildInfoConfigurationsTask.java:313)
    at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.projectsEvaluated(BuildInfoBaseTask.java:173)
    at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask$projectsEvaluated.call(Unknown Source)
    at org.jfrog.gradle.plugin.artifactory.ArtifactoryPluginBase$_ProjectsEvaluatedBuildListener_projectsEvaluated_closure2.doCall(ArtifactoryPluginBase.groovy:72)
    at org.jfrog.gradle.plugin.artifactory.ArtifactoryPluginBase$ProjectsEvaluatedBuildListener.projectsEvaluated(ArtifactoryPluginBase.groovy:71)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:83)
    ... 34 more
Caused by: java.lang.ClassNotFoundException: org.gradle.api.tasks.Upload
    ... 43 more


BUILD FAILED

Total time: 2.591 secs

Test fails with StackOverflowError

I'm attempting to write a Spock test that's verifying a custom 'artifactory.license' property that I'm setting on the artifactoryPublish task. The problem is that every time I try to access the task.properties property, the test throws a StackOverflowError.

The entirety of my test case is below. Can somebody please tell me what I'm doing wrong here? (I am currently using org.jfrog.buildinfo:build-info-extractor-gradle:4.4.0.)

import org.gradle.api.Project
import org.gradle.testfixtures.ProjectBuilder
import spock.lang.Specification

public class ArtifactoryTest extends Specification {
    def "project has license property set on artifactoryPublish task"() {
        given: "a test project"
        Project proj = ProjectBuilder.builder().build()
        proj.version = '1.0-SNAPSHOT'
        proj.group = 'com.demo'
        proj.description = 'Test case'

        when: "the plugin is applied"
        proj.apply(plugin: 'com.jfrog.artifactory')
        proj.artifactoryPublish {
            properties = ['artifactory.licenses': 'foo-bar-license']
        }
        proj.evaluate()

        then: "the project has the license property set"
        def task = proj.tasks.getByName("artifactoryPublish")
        task.properties.get('artifactory.licenses') == 'foo-bar-license'
    }
}

Can't define a proxy using DSL

The code in ArtifactoryPluginConvention construct DoubleDelegateWrapper with a single parameter (the domain object), yet the class's constructor is defined as follows:

    DoubleDelegateWrapper(Project project, def realDelegate) {

In practice that leads to the following error when one tries to use the proxy or buildInfo blocks under the main artifactory DSL block:

FAILURE: Build failed with an exception.

* Where:                    
Initialization script 'C:\Users\...\.gradle\init.d\repositories.gradle' line: 39

* What went wrong:          
A problem occurred configuring root project 'bluebox-demo'.
> Could not find matching constructor for: org.jfrog.gradle.plugin.artifactory.dsl.DoubleDelegateWrapper(org.jfrog.build.extractor.clientConfiguration.ArtifactoryC
lientConfiguration$ProxyHandler)

Furthermore, it seems Artifactory does not respect the system proxy defined as per the Gradle manual, so we need to duplicate the config in our prop files.

Guava-dependency conflicts with android gradle plugin 0.14.0

Hi,

org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1 depends on guava 10.0.1
com.android.tools.build:gradle.0.14.0 depends on guava 17.0

This leads to a problem in BuildInfoExtractorUtils.mergePropertiesWithSystemAndPropertyFile() because guavas com.google.common.io.Closeables.closeQuietly(Ljava/io/Closeable) isn't found in guava 17.0 resulting in an error while building on Jenkins:

Caused by: java.lang.NoSuchMethodError: com.google.common.io.Closeables.closeQuietly(Ljava/io/Closeable;)V
    at org.jfrog.build.extractor.BuildInfoExtractorUtils.mergePropertiesWithSystemAndPropertyFile(BuildInfoExtractorUtils.java:79)
    at org.jfrog.gradle.plugin.artifactory.extractor.GradleArtifactoryClientConfigUpdater.update(GradleArtifactoryClientConfigUpdater.java:64)

The funny thing is, that the source code of BuildInfoExtractorUtils indicates that the parameter is a FileInputStream and therefore shouldn't be causing the error.

Similar issue: https://issues.jenkins-ci.org/browse/JENKINS-23794

The intermediate workaround is to force guava:15.0 as dependency conflict resolution:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath ('com.google.guava:guava:15.0'){
            force = true
        }
        classpath('com.android.tools.build:gradle:0.14.0')
        classpath('org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1')
    }
}

unchanged artifacts should not be published to artifactory

I have a multi-module gradle project for libraries. In most there are changes to only a subset of the projects. In that case, I only want the changed artifacts to be published.
I think that the artifactoryPublish task should be up-to-date for the unchanged artifacts. It seems to me that gradle should be able to detect that the task's inputs have not changed, however when running gradle with the --debug switch, the log says:

09:10:11.028 [LIFECYCLE] [org.gradle.TaskExecutionLogger] :configuration:artifactoryPublish
09:10:11.028 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Starting to execute task ':configuration:artifactoryPublish'
09:10:11.028 [DEBUG] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Determining if task ':configuration:artifactoryPublish' is up-to-date
09:10:11.028 [INFO] [org.gradle.api.internal.changedetection.ShortCircuitTaskArtifactStateRepository] Task ':configuration:artifactoryPublish' has not declared any outputs, assuming that it is out-of-date.

If, inspired by http://stackoverflow.com/questions/15655938/gradle-how-to-have-an-upload-task-make-an-up-to-date-check, I add an artifactoryPublish.outputs.upToDateWhen { true } to my build, I get

12:38:06.030 [INFO] [org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository] Skipping task ':configuration:artifactoryPublish' as it is up-to-date.

Maybe the BuildInfoBaseTask could be changed to declare that it doesn't have any outputs?

Artifact upload issue when a build property value contains trailing slash

Hello,

I noticed that when I attach properties to an artifact (while uploading, using DeployDetails.addProperties()), if the last attached property value has a trailing "/", the artifact is created as a directory in Artifactory.

As an example, if the target URI is test-repo/test3/artifact.txt and the only build property is [build_uri, http://my-ci-host:8153/], then "artifact.txt" is created as a directory. This is the request line from debug logs:

PUT /artifactory/test-repo/test3/artifact.txt;build_uri=http://my-ci-host:8153/ HTTP/1.1

Please refer to this issue: tusharm/go-artifactory-plugin#15

Need formal schema for build-info JSON documents

While this project has a java library for build-info metadata, it's also the best description of the build-info format for those of us interfacing with Artifactory using other languages/tools.

While the README.md has an example build-info JSON document, it's not really sufficient. This week I've been writing a script to upload our build metadata to Artifactory, and it's been a constant cycle of trial and error in order to determine what objects are required and which are optional, the valid types and format of data values, etc. It would be useful if this project also provided a JSON schema definition which rigorously defined the build-info metadata.

Project cannot be built with Java8

Fresh clone of the project cannot be built with Java 8.

------------------------------------------------------------
Gradle 2.7
------------------------------------------------------------

Build time:   2015-09-14 07:26:16 UTC
Build number: none
Revision:     c41505168da69fb0650f4e31c9e01b50ffc97893

Groovy:       2.3.10
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.8.0_60 (Oracle Corporation 25.60-b23)
OS:           Mac OS X 10.10.5 x86_64
build-info/build-info-api/src/main/java/org/jfrog/build/api/dependency/pattern/BuildDependencyPattern.java:6: error: bad use of '>'
 * "libs-release-local:com/goldin/plugins/gradle/0.1.1/*.jar;status+=prod@gradle-plugins :: Build :: Gradle#LATEST => many-jars-build"
                                                                                                                    ^
1 error
3 warnings
:build-info-api:javadoc FAILED

gradle artifactory plugin - resolve.ivy.mavenCompatible=true does not convert dots to paths for ivyPaths

I noticed the resolver configuration does not convert dots to paths when setting mavenCompatible = true when searching for ivy files. As a consequence the artifact is retrieved but the ivy.xml is not and thus none of the configuration dependencies are downloaded.

Example:

artifactory {

    contextUrl = "${project.getProperty('artifactory.contextUrl')}"  

    resolve {
        repository {
            repoKey = 'someRepo'
            username = "someUser"
            password = "somePassword"
            maven = true
            ivy {
                mavenCompatible = true
                ivyLayout = '[organization]/[module]/[revision]/ivy.xml'
                artifactLayout = '[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]'
            }
        }
    }
}

Resolution for ivyLayout works fine in the case where I hardcode the organization in ivyLayout.

Publishing seems to work fine with mavenCompatible = true

Unable to use backslash in upload spec regular expression

The pull request at #100 broke the regular expression matching feature of the plugin. Specifically, it is now impossible to include a backslash character in the regular expression because they are all replaced with forward-slashes. For example, when I uploaded with v2.7.2 of the plugin (which did not have this change) with this upload spec:

"pattern": "pom\\.xml"

I received this output as expected:

For pattern: pom\.xml 1 artifacts were found

But in v2.8.0 of the plugin (which has that change) it fails to match and find the file; I get this message instead (note the backslash has been converted to a forward slash):

For pattern: pom/.xml 0 artifacts were found.

NullPointerException using 4.4.7 - Gradle 3.1 and 2.14.1

UPDATE this seems to be an issue with Gradle 3.1 and 2.14.1

Here's the stacktrace I get when I try to run artifactoryPublish:

Caused by: java.lang.NullPointerException
at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.prepareAndDeploy(BuildInfoBaseTask.java:352)
at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.collectProjectBuildInfo(BuildInfoBaseTask.java:126)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.doExecute(DefaultTaskClassInfoStore.java:136)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:129)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:118)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:623)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:606)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 68 more

Let the PreemptiveHttpClient use the SPNEGO kerberos ticket on windows systems

On windows systems, artifactory can be behind an apache frontend which acts as a reverse proxy, just filling the REMOTE_USER property in order to allow artifactory authorization. (This is configurable in the artifactory HTTP SSO onfiguration section).

In such a scenario Jenkins fails to publish, with a 401 error code.

Could you please provide an extension point to allow third party developers to access the PreemptiveAuth HttpRequestInterceptor, or (use the provided username/password as NTCredentials and get the current user SPNEGO kerberos ticket to authentify)?

snapshotRepoKey not supported

publish {
    repository {
        repoKey = 'libs-release-local'
        snapshotRepoKey = 'libs-snapshot-local'
        username = "${artifactory_user}"
        password = "${artifactory_password}"
        maven = true
    }
}

It looks like snapshotRepoKey is not used in build-info-extractor-gradle. However it is used in build-info-extractor-maven.

pom file not generated when triggering artifactoryPublish with gradle 2.4

when triggering

gradle clean artifactoryPublish

the build fails with gradle 2.4 as the pom file is not yet generated. This is due to changes in the gradle maven-publish plugin. A workaround is to call "gradle generatePomFileForMavenCustomPublication artifactoryPublish" to explicitly call the generatePomFile task for the "MavenCustom" publication. A pullrequest with a fix is on the way

Read user credentials from settings.xml

It's not really acceptable to have to add plaintext user credentials to a plugin configuration in maven (as far as I know that's the only way right now?). Most plugins read from user settings via a server-id. If that's possible with this plugin and I missed it then maybe it's just a documentation problem.

SSL properties for HTTPS

This may not be an artifactory issue so much as a lack of understanding of gradle.

Anyway, our artifactory context url is HTTPS, not HTTP. I'd like to tell artifactory to "use this key pair" when making the connection. Is this possible to do through the artifactory plugin?

Right now, I am passing them as system properties to the jvm, but this is sort of cumbersome because if I am downloading any plugins from the gradle plugin repo (which also uses HTTPS), it causes the downloads to fail. Basically, it turns the build into a two step process.

Encoding issue when uploading build info

org.codehaus.jackson.JsonParseException: Invalid UTF-8 middle byte 0x6e
 at [Source: org.apache.http.conn.EofSensorInputStream@2a791bf9; line: 3, column: 30]
    at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:943)
    at org.codehaus.jackson.impl.JsonParserBase._reportError(JsonParserBase.java:632)
    at org.codehaus.jackson.impl.Utf8StreamParser._reportInvalidOther(Utf8StreamParser.java:1673)
    at org.codehaus.jackson.impl.Utf8StreamParser._reportInvalidOther(Utf8StreamParser.java:1680)
    at org.codehaus.jackson.impl.Utf8StreamParser._decodeUtf8_4(Utf8StreamParser.java:1526)
    at org.codehaus.jackson.impl.Utf8StreamParser._finishString(Utf8StreamParser.java:970)
    at org.codehaus.jackson.impl.JsonParserBase.getText(JsonParserBase.java:364)
    at org.codehaus.jackson.map.deser.StdDeserializer$StringDeserializer.deserialize(StdDeserializer.java:411)
    at org.codehaus.jackson.map.deser.StdDeserializer$StringDeserializer.deserialize(StdDeserializer.java:399)
    at org.codehaus.jackson.map.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:135)
    at org.codehaus.jackson.map.deser.SettableBeanProperty$MethodProperty.deserializeAndSet(SettableBeanProperty.java:221)
    at org.codehaus.jackson.map.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:390)
    at org.codehaus.jackson.map.deser.BeanDeserializer.deserialize(BeanDeserializer.java:286)
    at org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:1568)
    at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:711)
    at org.codehaus.jackson.JsonParser.readValueAs(JsonParser.java:879)
    at org.jfrog.build.client.ArtifactoryHttpClient.execute(ArtifactoryHttpClient.java:202)
    at org.jfrog.build.client.ArtifactoryHttpClient.upload(ArtifactoryHttpClient.java:189)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:619)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:330)
    at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.deployArtifacts(BuildInfoBaseTask.java:409)
    at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.prepareAndDeploy(BuildInfoBaseTask.java:284)
    at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.collectProjectBuildInfo(BuildInfoBaseTask.java:363)

My artifact name contains a German umlaut (ö). The upload seems to work fine but the response from artifactory cannot be parsed. There's probably a charset property missing somewhere.

Maven plugin fails to deploy poms

The Maven plugin fails to deploy poms if the maven-install-plugin is configured with installAtEnd=true.

This does not work:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-install-plugin</artifactId>
    <version>2.5.2</version>
    <configuration>
        <installAtEnd>true</installAtEnd>
    </configuration>
</plugin>

Context url cannot be empty

I'm getting this error using build-info-extractor-gradle:4.2.+. Although I have verified that I set contextUrl correctly.

As you can see below, I have set contextUrl at base level and at Pubisher level as well. I can see URL being printed out within Publisher configuration but the error persists regardless. I read that someone got around by disabling Gradle Daemon but it didn't help me.

artifactory {
    def url = "${artifactory_contextUrl}"
    contextUrl = "${url}"
    publish {
        contextUrl = "${url}"
        repository {
            repoKey = 'AndroidHello'
            username = "${artifactory_user}"
            password = "${artifactory_password}"
            maven = true

            println("Pub u: ${artifactory_user}")
            println("Pub p: ${artifactory_password}")
            println "URL $url"
        }

        defaults {
            publications ('aar')
            publishArtifacts = true

            properties = ['qa.level': 'basic', 'dev.team': 'core']
            publishPom = true
        }
    }

    resolve {
        repository {
            repoKey = 'libs-release'
            username = "${artifactory_user}"
            password = "${artifactory_password}"
            maven = true
        }
    }
}

I'm running this on OSX 10.11.3. Using Gradle Wrapper 2.10. Trying to deploy a sample aar lib to Artifactory version 4.7.1 rev 40159 running on the same laptop.

Here's the stacktrace.

Caused by: java.lang.IllegalStateException: Context URL cannot be empty
        at org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration.getContextUrl(ArtifactoryClientConfiguration.java:146)
        at org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration$PublisherHandler.getContextUrl(ArtifactoryClientConfiguration.java:312)
        at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.prepareAndDeploy(BuildInfoBaseTask.java:349)
        at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.collectProjectBuildInfo(BuildInfoBaseTask.java:129)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:227)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
        ... 60 more

Gradle plugin, multiple repositories in the same artifactory

Please, prove me wrong! :)

No matter how hard am I trying, I just can't configure the gradle plugin to use both repositories in my artifactory. I have tried the following approaches:

Duplicating the repository block:

artifactory {
  contextUrl = "http://artifactory.example.com/artifactory"
  resolve {
    contextUrl = "http://artifactory.example.com/artifactory"
    repository {
      repoKey  = 'libs-release'
      username = "${artifactory_user}"
      password = "${artifactory_password}"
      maven    = true
    }
    repository {
      repoKey  = 'libs-snapshot'
      username = "${artifactory_user}"
      password = "${artifactory_password}"
      maven    = true
    }
  }
}

Duplicating the resolve block:

artifactory {
  contextUrl = "http://artifactory.example.com/artifactory"
  resolve {
    contextUrl = "http://artifactory.example.com/artifactory"
    repository {
      repoKey  = 'libs-release'
      username = "${artifactory_user}"
      password = "${artifactory_password}"
      maven    = true
    }
  }
  resolve {
    contextUrl = "http://artifactory.example.com/artifactory"
    repository {
      repoKey  = 'libs-snapshot'
      username = "${artifactory_user}"
      password = "${artifactory_password}"
      maven    = true
    }
  }
}

Duplicating the whole artifactory block:

artifactory {
  contextUrl = "http://artifactory.example.com/artifactory"
  resolve {
    contextUrl = "http://artifactory.example.com/artifactory"
    repository {
      repoKey  = 'libs-release'
      username = "${artifactory_user}"
      password = "${artifactory_password}"
      maven    = true
    }
  }
}
artifactory {
  contextUrl = "http://artifactory.example.com/artifactory"   
  resolve {
    contextUrl = "http://artifactory.example.com/artifactory"
    repository {
      repoKey  = 'libs-snapshot'
      username = "${artifactory_user}"
      password = "${artifactory_password}"
      maven    = true
    }
  }
}

This is my first approach on using gradle, so there is a good chance, that I am missing something.

Is it a bug, a missing feature or just a bad approach?

HTTP 403: forbidden when publishing to oss.jfrog.org with artifactory-maven-plugin

Hi,

I get the following when deploying a snapshot to oss.jfrog.org with the artifactory-maven-plugin:

Caused by: java.io.IOException: Failed to deploy file: HTTP response code: 403. HTTP response message: Forbidden
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.throwHttpIOException(ArtifactoryBuildInfoClie
nt.java:743)
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:62
3)
        at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.jav
a:329)
        at org.jfrog.build.extractor.maven.BuildDeploymentHelper.deployArtifacts(BuildDeploymentHelper.java:275)

Using this configuration:

<plugin>
                <groupId>org.jfrog.buildinfo</groupId>
                <artifactId>artifactory-maven-plugin</artifactId>
                <version>2.4.0</version>
                <inherited>false</inherited>
                <executions>
                    <execution>
                        <id>build-info</id>
                        <goals>
                            <goal>publish</goal>
                        </goals>
                        <configuration>
                            <publisher>
                                <contextUrl>https://oss.jfrog.org</contextUrl>
                                <username>michaz</username>
                                <password>...</password>
                                <repoKey>libs-release-local</repoKey>
                                <snapshotRepoKey>libs-snapshot-local</snapshotRepoKey>
                            </publisher>
                        </configuration>
                    </execution>
                </executions>
</plugin>

It works, however, when I simply mvn deploy without the plugin, using

    <distributionManagement>
        <snapshotRepository>
            <id>oss-jfrog-artifactory</id>
            <name>artifactory-snapshots</name>
            <url>http://oss.jfrog.org/oss-snapshot-local</url>
        </snapshotRepository>
    </distributionManagement>

Any idea what I'm missing?
Is the plugin trying to overwrite or delete something on oss.jfrog.org for which I don't have permission?

Resolution fails for second and subsequent builds when using Gradle daemon

Example project that I am reproducing this with can be found here: https://github.com/mikewatt/gradle-artifactory-issue

Assuming no gradle daemon is running, running ./gradlew clean build twice in succession from the root project directory results in:

First invocation:

Starting a new Gradle Daemon for this build (subsequent builds will be faster).
[buildinfo] Not using buildInfo properties file for this build.
:sp1:clean UP-TO-DATE
:sp1:compileJava
:sp1:processResources UP-TO-DATE
:sp1:classes
:sp1:jar
:sp1:assemble
:sp1:compileTestJava UP-TO-DATE
:sp1:processTestResources UP-TO-DATE
:sp1:testClasses UP-TO-DATE
:sp1:test UP-TO-DATE
:sp1:check UP-TO-DATE
:sp1:build

BUILD SUCCESSFUL

Total time: 6.309 secs

Second invocation:

:sp1:clean
:sp1:compileJava

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':sp1:compileClasspath'.
> Cannot resolve external dependency com.google.guava:guava:19.0 because no repositories are defined.
  Required by:
      com.example:sp1:1.0-SNAPSHOT

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

After killing the Gradle daemon spawned in the first invocation, I can then build successfully again (once).

The Artifactory service is an Artifactory Online instance. I'm running this on OS X 10.11.6 with java 1.8.0_60.

This seems to be a new issue with the 4.4.+ version of the plugin, as I cannot reproduce it with 4.3.0.

Exception is thown when using Artifactory Plugin in Jenkins

I am using Artifactory Plugin in Jenkins Maven Project (multi module). While Job is runing NPE is thrown from org.jfrog.build.extractor.maven.BuildInfoRecorder#getExtension. Looking on the code, this is really bug because NULL check is implemented after parameter access .

org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException
    at org.apache.maven.lifecycle.internal.BuilderCommon.handleBuildError(BuilderCommon.java:142)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:95)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
    at org.jvnet.hudson.maven3.launcher.Maven31Launcher.main(Maven31Launcher.java:132)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
    at jenkins.maven3.agent.Maven31Main.launch(Maven31Main.java:181)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:136)
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:71)
    at hudson.remoting.UserRequest.perform(UserRequest.java:121)
    at hudson.remoting.UserRequest.perform(UserRequest.java:49)
    at hudson.remoting.Request$2.run(Request.java:325)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.getExtension(BuildInfoRecorder.java:610)
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.addDependenciesToCurrentModule(BuildInfoRecorder.java:594)
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.addFilesToCurrentModule(BuildInfoRecorder.java:460)
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.finalizeAndAddModule(BuildInfoRecorder.java:446)
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.finalizeModule(BuildInfoRecorder.java:376)
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.projectSucceeded(BuildInfoRecorder.java:196)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:74)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:42)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:91)
    ... 27 more

I do not know why it happens in one of our project.

Gradle plugin 4.4.0 breaks with Gradle > 2.5

Using org.jfrog.buildinfo:build-info-extractor-gradle:4.4.0, starting with Gradle 2.6 up to 2.14 and 3.0-milestone-2, we get the following error: Cannot notify listeners of type ProjectEvaluationListener as these listeners are already being notified.

It works well using org.jfrog.buildinfo:build-info-extractor-gradle:4.3.0.

This issue was originally reported in the Gradle forums.

One of the reporter kindly put up a reproducer project.

Here is the complete stacktrace with Gradle 2.14:

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/paul/src/local/gradle-artifactory-bug/build.gradle' line: 21

* What went wrong:
A problem occurred configuring project ':foo-client'.
> Failed to notify project evaluation listener.
   > A problem occurred configuring project ':foo-common'.
      > Cannot notify listeners of type ProjectEvaluationListener as these listeners are already being notified.
   > A problem occurred configuring project ':foo-common'.
      > Cannot notify listeners of type ProjectEvaluationListener as these listeners are already being notified.
   > A problem occurred configuring project ':foo-common'.
      > Cannot notify listeners of type ProjectEvaluationListener as these listeners are already being notified.
   > A problem occurred configuring project ':foo-common'.
      > Cannot notify listeners of type ProjectEvaluationListener as these listeners are already being notified.

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':foo-client'.
        at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:79)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:74)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:61)
        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:540)
        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:93)
        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:47)
        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
        at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:124)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:121)
        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
        at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
        at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:239)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:212)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:205)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
        at org.gradle.launcher.Main.doAction(Main.java:33)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify project evaluation listener.
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:55)
        at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:221)
        at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:209)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
        at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
        at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
        at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
        at com.sun.proxy.$Proxy12.afterEvaluate(Unknown Source)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
        at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
        at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
        at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
        at com.sun.proxy.$Proxy12.afterEvaluate(Unknown Source)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67)
        ... 41 more
Caused by: org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':foo-common'.
        at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:79)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:49)
        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:540)
        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:93)
        at org.gradle.api.publish.internal.ProjectDependencyPublicationResolver.resolve(ProjectDependencyPublicationResolver.java:35)
        at org.gradle.api.publish.maven.internal.publication.DefaultMavenPublication.addProjectDependency(DefaultMavenPublication.java:120)
        at org.gradle.api.publish.maven.internal.publication.DefaultMavenPublication.from(DefaultMavenPublication.java:111)
        at build_6cfynj3nvfncugmjq3kpefkkk$_run_closure2$_closure5$_closure6$_closure7.doCall(/Users/paul/src/local/gradle-artifactory-bug/build.gradle:21)
        at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
        at org.gradle.api.internal.AbstractPolymorphicDomainObjectContainer.create(AbstractPolymorphicDomainObjectContainer.java:65)
        at org.gradle.api.internal.PolymorphicDomainObjectContainerConfigureDelegate._configure(PolymorphicDomainObjectContainerConfigureDelegate.java:44)
        at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:68)
        at build_6cfynj3nvfncugmjq3kpefkkk$_run_closure2$_closure5$_closure6.doCall(/Users/paul/src/local/gradle-artifactory-bug/build.gradle:20)
        at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
        at org.gradle.util.ConfigureUtil.configureSelf(ConfigureUtil.java:149)
        at org.gradle.api.internal.AbstractNamedDomainObjectContainer.configure(AbstractNamedDomainObjectContainer.java:70)
        at org.gradle.api.internal.AbstractNamedDomainObjectContainer.configure(AbstractNamedDomainObjectContainer.java:25)
        at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:59)
        at org.gradle.api.publish.internal.DefaultPublishingExtension.publications(DefaultPublishingExtension.java:48)
        at org.gradle.api.publish.internal.DefaultPublishingExtension_Decorated.publications(Unknown Source)
        at build_6cfynj3nvfncugmjq3kpefkkk$_run_closure2$_closure5.doCall(/Users/paul/src/local/gradle-artifactory-bug/build.gradle:19)
        at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
        at org.gradle.listener.ActionBroadcast.execute(ActionBroadcast.java:39)
        at org.gradle.api.internal.plugins.ExtensionsStorage$DeferredConfigurableExtensionHolder.configureNow(ExtensionsStorage.java:183)
        at org.gradle.api.internal.plugins.ExtensionsStorage$DeferredConfigurableExtensionHolder.get(ExtensionsStorage.java:162)
        at org.gradle.api.internal.plugins.ExtensionsStorage.getByType(ExtensionsStorage.java:77)
        at org.gradle.api.internal.plugins.DefaultConvention.getByType(DefaultConvention.java:113)
        at org.jfrog.gradle.plugin.artifactory.task.helper.TaskHelperPublications.publications(TaskHelperPublications.java:79)
        at org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask.publications(ArtifactoryTask.java:89)
        at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:374)
        at org.gradle.internal.metaobject.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:169)
        at org.gradle.internal.metaobject.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:96)
        at org.gradle.internal.metaobject.MixInClosurePropertiesAsMethodsDynamicObject.invokeMethod(MixInClosurePropertiesAsMethodsDynamicObject.java:30)
        at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:59)
        at build_6cfynj3nvfncugmjq3kpefkkk$_run_closure3$_closure8$_closure10.doCall(/Users/paul/src/local/gradle-artifactory-bug/build.gradle:37)
        at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
        at org.gradle.util.ConfigureUtil.configureSelf(ConfigureUtil.java:137)
        at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:522)
        at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:76)
        at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:104)
        at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.projectsEvaluated(BuildInfoBaseTask.java:178)
        at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask$projectsEvaluated.call(Unknown Source)
        at org.jfrog.gradle.plugin.artifactory.extractor.listener.ProjectsEvaluatedBuildListener$_afterEvaluate_closure1.doCall(ProjectsEvaluatedBuildListener.groovy:43)
        at org.jfrog.gradle.plugin.artifactory.extractor.listener.ProjectsEvaluatedBuildListener.afterEvaluate(ProjectsEvaluatedBuildListener.groovy:42)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:249)
        at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:229)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
        ... 56 more
Caused by: java.lang.IllegalStateException: Cannot notify listeners of type ProjectEvaluationListener as these listeners are already being notified.
        at org.gradle.internal.event.DefaultListenerManager$EventBroadcast.startNotification(DefaultListenerManager.java:170)
        at org.gradle.internal.event.DefaultListenerManager$EventBroadcast.access$300(DefaultListenerManager.java:112)
        at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:219)
        at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:209)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
        at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
        at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
        at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
        at com.sun.proxy.$Proxy12.beforeEvaluate(Unknown Source)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
        at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
        at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
        at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
        at com.sun.proxy.$Proxy12.beforeEvaluate(Unknown Source)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:47)
        ... 103 more


BUILD FAILED

Allow to specify closure for publications

Allow to specify closure for publications. The use case is that we may want to publish automatically all publications defined by a project, even yf they are not available yet.

For example:

artifactory {
    publish {
        defaults {
            publications { extensions.findByType(PublishingExtension)?.publications?.names }
        }
    }
}

The change needs to go here:

https://github.com/JFrogDev/build-info/blob/6cede0a11a777c147dbc0ea05020620eb3b25dde/build-info-extractor-gradle/src/main/groovy/org/jfrog/gradle/plugin/artifactory/task/helper/TaskHelperPublications.java#L89

Cannot distribute different modules to different repository

I have a multi module project. Some modules are sensitive while others not. I want to distribute the sensitive ones to a private repository which requires auth while the rest to a public repo which anyone can access.

But it seems the plugin always use configuration from the parent pom.

Plugin doesn't upload checksums generated by Maven GPG plugin

In a session with JFrog support we identified the build info Maven plugin actively not including the .asc files generated by the GPG plugin. This breaks the ability to promote the build in a follow up step as Artifactory is complaining about missing artifacts the build info refers to.

This now effectively forces me to make my release builds a two step process: running the release build and upload to Artifactory first, GPG sign and deploy to OSS Nexus as a second one. I'd argue the plugin shouldn't break the convention that attached artifacts should be included with what's deployed (certainly not without notifying users).

Bad constructor invocation in ArtifactoryPluginConvention

In build-info-extractor-gradle v4.0.0, a configuration of the DSL as follow:

artifactory {
  buildInfo {
    buildNumber = "42"
    // [...]
  }
}

Result in an exception:
Could not find matching constructor for: org.jfrog.gradle.plugin.artifactory.dsl.DoubleDelegateWrapper(org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration$BuildInfoHandler)

Looking at the ArtifactoryPluginConvention more specifically at line 62, a call to DoubleDelegateWrapper's construtor is done. The call doesn't satisfy the signature of that constructor. Line 66 of ArtifactoryPluginConvention will also have the same exception.

For now, my workaround is to use the groovy with keyword like so:

artifactory {
  clientConfig.info.with {
    buildNumber = "42"
    // [...]
  }
}

Artifact published only once, all the subsequent publishing retries are void - since version 4.4.2

Since version 4.4.2 (inclusive) of the build-info-extractor-gradle plugin, the artifacts are not published to the repository. It works only once, after the gradle cache is purged, and all the consequent publish commands are void, unless you purge the gradle cache again (NOT entirely, but the build-info-extractor-gradle jar). In this case, only a build descriptor is published. (see the attached screenshots)

This happens only with gradle 3.0 though. When gradle 2.14.1 is used, the artifacts are correctly published IF gradle is not ran as daemon. If gradle is running as daemon, the SAME behavior is observed regardless of which gradle version is used.

I tried this with a fresh clone of your example repository. This uses the 4.4.0 version of the plugin, but when using latests versions (4.4.2, 4.4.3, 4.4.4), the defect is observed.
The repository version we are using is Artifactory OSS, 4.7.5 rev 40176

screen_shot_2016-09-19_at_1_33_29_pm

screen_shot_2016-09-19_at_1_32_49_pm

Expose ArtifactoryBuildInfoClient.setConnectionTimeout in Gradle DSL

We use retention policy for our builds and have a lot of them because we use artifactory for CI builds to share Snapshot artifacts among our ~50 build machines.
The retention policy is set for a certain number of days, and on the first build of each day this causes a connection timeout.

A look at the source shows that ArtifactoryBuildInfoClient.setConnectionTimeout is never called from the Gradle plugin.

I would expect something like this to work, but it does not. ArtifactoryClientConfiguration.timeout is never transferred to ArtifactoryBuildInfoClient, as it is in the maven plugin.

artifactory {
    ....
    clientConfig.timeout = 600
    ....
}

This is the exception I am getting:

Deploying build info to: http://artifactoryserver/artifactory/api/build
Could not build the build-info object.
java.net.SocketTimeoutException: Read timed out
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:152)
    at java.net.SocketInputStream.read(SocketInputStream.java:122)
    at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166)
    at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:90)
    at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:281)
    at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:92)
    at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:62)
    at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:254)
    at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:289)
    at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:252)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:191)
    at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:300)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:127)
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:715)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:520)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
    at org.jfrog.build.client.PreemptiveHttpClient.execute(PreemptiveHttpClient.java:88)
    at org.jfrog.build.client.ArtifactoryBuildInfoClient.sendBuildInfo(ArtifactoryBuildInfoClient.java:219)
    at org.jfrog.build.client.ArtifactoryBuildInfoClient.sendBuildInfo(ArtifactoryBuildInfoClient.java:237)
    at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.prepareAndDeploy(BuildInfoBaseTask.java:305)
    at org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask.collectProjectBuildInfo(BuildInfoBaseTask.java:365)
    at sun.reflect.GeneratedMethodAccessor733.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:219)

artifacts is not deployed intermittently

Here's the log files I can gather using the gradle debug mode:

[INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :Locales:artifactoryPublish (Thread[Task worker Thread 3,5,main]) started.
[LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] :Locales:artifactoryPublish
[DEBUG] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Determining if task ':Locales:artifactoryPublish' is up-to-date
[INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Executing task ':Locales:artifactoryPublish' (up-to-date check took 0.0 secs) due to:
  Task has not declared any outputs.
[DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':Locales:artifactoryPublish'.
[DEBUG] [org.jfrog.gradle.plugin.artifactory.task.BuildInfoBaseTask] Task ':Locales:artifactoryPublish' activated
[org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':Locales:artifactoryPublish'

I took a look at the code and apparently, for some reasons this block of code:

            List<BuildInfoBaseTask> remainingTasks = new ArrayList<BuildInfoBaseTask>();
            for (BuildInfoBaseTask task : getAllBuildInfoTasks()) {
                if (!isTaskExecuted(task)) {
                    remainingTasks.add(task);
                }
            }

            if (remainingTasks.size() <= 1) {
            ...
            }

return remainingTasks list that has more than 1 element and this is why it doesn't upload the artifact to artifactory. This doesn't happen all the times, it happens intermittently.

The environment details are:
gradle 3.0
build-info-extractor-gradle: 4.4.0

Any comments/suggestion would be greatly appreciated.

Cheers,
Tony

configuring publication for artifactoryPublish task executes the closure

Hi
We have encountered an issue where we configure these blocks in our project:

publishing {
        publications {
            DefPublication(MavenPublication) {
                from components.java
            }
        }
}
artifactoryPublish {
     publications ('DefPublication')
}

from what we could understand the line publications ('DefPublication') causes the evaluation of the above block on configuration time, preventing other plugins from configuring the project and affecting the publication properties. In our specific example we have another plugin that configure the subprojects' version (the publication by default takes the version from the project configuration). Since artifactoryPublish block evaluates the publication closure, it prevents our plugin from configuring the version.

Getting a HTTP 301 error when trying to PUT to artifactory

When running gradle -d artifactoryPublish I am seeting where it tries to do a PUT /artifactory/api/build HTTP/1.1 but I am getting a HTTP 301 response with the Location header set to https://<domain redacted>/artifactory/api/build

It's weird because the url pointed to by the Location header is the same as the URL that was PUT to. Normally, the Location header is a 301 response is sett o the location that the client should be going to.

Any ideas what I might be doing wrong?

Log verbosely in exception cases within ArtifactoryHttpClient.execute

We are currently facing errors like:

[ERROR] Failed while reading the response from: PUT https://my.server.address/artifactory/myrepo/org/mynamespace/myartifact/1.0-2015-10-01-r285d831d/myartifact-1.0-2015-10-01-r285d831d.war;vcs.revision=285d831dd064851bb5ef3df45d69b3ee097f3a68;build.timestamp=1443688654812;build.name=Build-My-Artifact;build.number=4711 HTTP/1.1
org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@7759203a; line: 1, column: 2]
    at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:943)
    at org.codehaus.jackson.impl.JsonParserBase._reportError(JsonParserBase.java:632)
    at org.codehaus.jackson.impl.JsonParserBase._reportUnexpectedChar(JsonParserBase.java:565)
    at org.codehaus.jackson.impl.ReaderBasedParser._handleUnexpectedValue(ReaderBasedParser.java:429)
    at org.codehaus.jackson.impl.ReaderBasedParser.nextToken(ReaderBasedParser.java:192)
    at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:1625)
    at org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:1560)
    at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:711)
    at org.codehaus.jackson.JsonParser.readValueAs(JsonParser.java:879)
    at org.jfrog.build.client.ArtifactoryHttpClient.execute(ArtifactoryHttpClient.java:209)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.tryChecksumDeploy(ArtifactoryBuildInfoClient.java:649)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:607)
    at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:330)

But we are totally unable to track it down since uploads within the same build also succeed.

In order to be able to track the issues down (to whatever they may be), it would be helpful if there was some kind of verbose logging that shows the response that is being returned by the server.

Perhaps logging the content whithin ArtifactoryHttpClient.execute at a certain logging level is feasible here. I would consider it even more helpful than the stacktrace.

Non packaging pom project fails to deploy pom file to artifactory

We have a sub-module with our internal packaging type.
artifactory-maven-plugin 2.4.0 able to deploy pom file for sub-module non-pom packaging type.
But, it started failing to deploy pom file from 2.4.1 version.

I can see some code related to non packaging pom project module section modified from version 2.4.0 to 2.4.1
build-info-extractor-maven3/src/main/java/org/jfrog/build/extractor/maven/BuildInfoRecorder.java

<artifactId>artifactory-maven-plugin</artifactId>
<groupId>org.jfrog.buildinfo</groupId>

Migrate from 4.0.0 to 4.4.0 was broke my build with Cannot invoke method getClientConfig() on null object

Gradle version - 2.14
With build-extractor 4.0.0 version:

gw wrapper
[buildinfo] Not using buildInfo properties file for this build.
:wrapper UP-TO-DATE

BUILD SUCCESSFUL

Total time: 5.748 secs

After migrate to build-extractor 4.4.0:

gw wrapper

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'sense-support'.
> Failed to notify project evaluation listener.
   > Cannot invoke method getClientConfig() on null object
   > Cannot invoke method getClientConfig() on null object
   > Cannot invoke method getClientConfig() on null object
   > Cannot invoke method getClientConfig() on null object

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.1 secs

What was happened and what i do wrong?

POM not created for custom MavenPublication

When a custom MavenPublication is built, the artifactory plugin fails to build the POM file.

$ gradle clean :api:artifactoryPublish                                  
:api:artifactoryPublish FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':api:artifactoryPublish'.
\> File '/sbox/gradle-arty/spcx.root/api/build/publications/clientLib/pom-default.xml' does not exist, and need to be published from publication clientLib

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Here is a snippet of the configuration:

[...]

publishing {
    publications {
        mavenJava(MavenPublication) {
            from components.java
        }
        clientLib(MavenPublication) {
            artifact clientJar
            pom.withXml {
                asNode().appendNode('description', 'A demonstration of Maven POM customization')
            }
        }
    }
}

artifactoryPublish {
    publications(publishing.publications.clientLib)
}

if I do publications(publishing.publications.mavenJava), the build is successfull.

I have created a project to demonstrate the issue here: https://github.com/nucatus/sourcesets-arty.git

Gradle: 3.0
Artifactory Plugin: 4.4.4

NullPointerException from BuildInfoRecorder in multi-module project

I'm running the Artifactory Maven Plugin 2.4 like this: mvn deploy -Dartifactory.server=… -Dartifactory.staging-repository=… -Dartifactory.username=… -Dartifactory.password=… -Dartifactory.build-name=… -Dartifactory.build-number=… and get the following exception. Other projects just work fine.

java.lang.NullPointerException
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.getExtension(BuildInfoRecorder.java:610)
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.addDependenciesToCurrentModule(BuildInfoRecorder.java:594)
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.addFilesToCurrentModule(BuildInfoRecorder.java:460)
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.finalizeAndAddModule(BuildInfoRecorder.java:446)
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.finalizeModule(BuildInfoRecorder.java:376)
    at org.jfrog.build.extractor.maven.BuildInfoRecorder.projectSucceeded(BuildInfoRecorder.java:196)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:74)
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:42)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:126)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

Can ArtifactoryBuildInfoClient expose response from Artifactory?

Hello,

I am using the build-info-client module to upload content to Artifactory. I noticed that the ArtifactoryBuildInfoClient.deployArtifact() or sendBuildInfo() methods do not expose the response returned by Artifactory API.

This response has some interesting metadata that I'd like to use. Is this something that can be picked up?

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.