[BAP-432] Bamboo artifactory plugin fails with Gradle 4.7 Created: 20/Apr/18  Updated: 27/Feb/19  Resolved: 18/Jun/18

Status: Resolved
Project: Bamboo Artifactory Plug-in
Component/s: None
Affects Version/s: 2.4.1
Fix Version/s: 2.5.0

Type: Bug Priority: Minor
Reporter: Manfred Schenk Assignee: Bar Belity
Resolution: Fixed Votes: 1
Labels: artifactory, gradle, plugin
Environment:
  • Bamboo version 6.4.0 build 60404
  • Artifactory Version 5.9.1
  • gradle wrapper with gradle 4.7
  • Linux build agent (same problem also with Windows agent)
  • Java 8

Issue Links:
Dependency
depends on GAP-292 UnsupportedOperationException when ru... Resolved

 Description   

After upgrading gradle to version 4.7 the bamboo build fails due to a UnsupportedOperationException. See stacktrace below:

error 18-Apr-2018 16:17:39 FAILURE: Build failed with an exception. error 18-Apr-2018 16:17:39 error 18-Apr-2018 16:17:39 * Where: error 18-Apr-2018 16:17:39 Initialization script '/tmp/artifactory.init.script2339382655360837976gradle' line: 14 error 18-Apr-2018 16:17:39 error 18-Apr-2018 16:17:39 * What went wrong: error 18-Apr-2018 16:17:39 java.lang.UnsupportedOperationException (no error message) error 18-Apr-2018 16:17:39 error 18-Apr-2018 16:17:39 * Try: error 18-Apr-2018 16:17:39 Run with --info or --debug option to get more log output. Run with --scan to get full insights. error 18-Apr-2018 16:17:39 error 18-Apr-2018 16:17:39 * Exception is: error 18-Apr-2018 16:17:39 java.lang.UnsupportedOperationException error 18-Apr-2018 16:17:39 at com.google.common.collect.ImmutableMap.put(ImmutableMap.java:326) error 18-Apr-2018 16:17:39 at com.google.common.collect.BiMap$put.call(Unknown Source) error 18-Apr-2018 16:17:39 at BuildInfoPluginListener.projectsLoaded(/tmp/artifactory.init.script2339382655360837976gradle:14) error 18-Apr-2018 16:17:39 at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) error 18-Apr-2018 16:17:39 at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) error 18-Apr-2018 16:17:39 at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:370) error 18-Apr-2018 16:17:39 at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:352) error 18-Apr-2018 16:17:39 at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58) error 18-Apr-2018 16:17:39 at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:340) error 18-Apr-2018 16:17:39 at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:327) error 18-Apr-2018 16:17:39 at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42) error 18-Apr-2018 16:17:39 at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:230) error 18-Apr-2018 16:17:39 at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:149) error 18-Apr-2018 16:17:39 at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58) error 18-Apr-2018 16:17:39 at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:324) error 18-Apr-2018 16:17:39 at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:234) error 18-Apr-2018 16:17:39 at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:140) error 18-Apr-2018 16:17:39 at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37) error 18-Apr-2018 16:17:39 at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) error 18-Apr-2018 16:17:39 at com.sun.proxy.$Proxy15.projectsLoaded(Unknown Source) error 18-Apr-2018 16:17:39 at org.gradle.initialization.NotifyingBuildLoader.load(NotifyingBuildLoader.java:65) error 18-Apr-2018 16:17:39 at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuild.run(DefaultGradleLauncher.java:260) error 18-Apr-2018 16:17:39 at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317) error 18-Apr-2018 16:17:39 at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309) error 18-Apr-2018 16:17:39 at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185) error 18-Apr-2018 16:17:39 at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97) error 18-Apr-2018 16:17:39 at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) error 18-Apr-2018 16:17:39 at org.gradle.initialization.DefaultGradleLauncher.configureBuild(DefaultGradleLauncher.java:173) error 18-Apr-2018 16:17:39 at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:132) error 18-Apr-2018 16:17:39 at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:115) error 18-Apr-2018 16:17:39 at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:78) error 18-Apr-2018 16:17:39 at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:75) error 18-Apr-2018 16:17:39 at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152) error 18-Apr-2018 16:17:39 at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:38) error 18-Apr-2018 16:17:39 at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100) error 18-Apr-2018 16:17:39 at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75) error 18-Apr-2018 16:17:39 at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28) error 18-Apr-2018 16:17:39 at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) error 18-Apr-2018 16:17:39 at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32) error 18-Apr-2018 16:17:39 at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.run(RunAsBuildOperationBuildActionRunner.java:45) error 18-Apr-2018 16:17:39 at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317) error 18-Apr-2018 16:17:39 at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309) error 18-Apr-2018 16:17:39 at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185) error 18-Apr-2018 16:17:39 at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97) error 18-Apr-2018 16:17:39 at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) error 18-Apr-2018 16:17:39 at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:42) error 18-Apr-2018 16:17:39 at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51) error 18-Apr-2018 16:17:39 at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47) error 18-Apr-2018 16:17:39 at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31) error 18-Apr-2018 16:17:39 at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39) error 18-Apr-2018 16:17:39 at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25) error 18-Apr-2018 16:17:39 at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80) error 18-Apr-2018 16:17:39 at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53) error 18-Apr-2018 16:17:39 at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:61) error 18-Apr-2018 16:17:39 at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:34) error 18-Apr-2018 16:17:39 at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36) error 18-Apr-2018 16:17:39 at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25) error 18-Apr-2018 16:17:39 at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43) error 18-Apr-2018 16:17:39 at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29) error 18-Apr-2018 16:17:39 at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64) error 18-Apr-2018 16:17:39 at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29) error 18-Apr-2018 16:17:39 at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59) error 18-Apr-2018 16:17:39 at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44) error 18-Apr-2018 16:17:39 at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:46) error 18-Apr-2018 16:17:39 at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72) error 18-Apr-2018 16:17:39 at org.gradle.util.Swapper.swap(Swapper.java:38) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:50) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50) error 18-Apr-2018 16:17:39 at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295) error 18-Apr-2018 16:17:39 at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) error 18-Apr-2018 16:17:39 at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) error 18-Apr-2018 16:17:39 at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) error 18-Apr-2018 16:17:39 error 18-Apr-2018 16:17:39 error 18-Apr-2018 16:17:39 * Get more help at https://help.gradle.org build 18-Apr-2018 16:17:39 build 18-Apr-2018 16:17:39 BUILD FAILED in 9s

 

Here is the content of the temporary file "artifactory.init.script2339382655360837976gradle" referenced in the stacktrace above:

import org.jfrog.gradle.plugin.artifactory.ArtifactoryPlugin
import org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask

initscript {
    dependencies

{         classpath fileTree('/bamboo-agent-home/xml-data/build-dir/org.jfrog.bamboo.bamboo-artifactory-plugin-2.4.1/artifactoryGradleBuilder')     }

}

addListener(new BuildInfoPluginListener())
class BuildInfoPluginListener extends BuildAdapter {

    def void projectsLoaded(Gradle gradle) {
        gradle.startParameter.getProjectProperties().put("build.start", Long.toString(System.currentTimeMillis()))
        Project root = gradle.getRootProject()
        root.logger.debug("Artifactory plugin: projectsEvaluated: ${root.name}")
        if (!"buildSrc".equals(root.name)) {
            root.allprojects {
                apply

{                     apply plugin: ArtifactoryPlugin                 }

            }
        }

        // Set the "archives" configuration to all Artifactory tasks.
        for (Project p : root.getAllprojects()) {
            Task t = p.getTasks().findByName(ArtifactoryTask.ARTIFACTORY_PUBLISH_TASK_NAME)
            if (t != null)

{                 ArtifactoryTask task = (ArtifactoryTask)t                 task.setAddArchivesConfigToTask(true)             }

        }
    }
}

 

The only workaround at the moment is to downgrade gradle back to 4.6 but this workaround will only work until we switch to java 10 (which needs gradle 4.7). So the problem has priority Minor at the moment but will change to Blocker when we start switching to Java 10.



 Comments   
Comment by Bar Belity [ 18/Jun/18 ]

Thank you for opening this issue, Manfred Schenk.

We have released a new plugin version - 2.5.0, which contain a fix for the issue you described.
The plugin is available for download at Atlassian Marketplace and Bintray

Please let us know if this solves your issue.

 

Comment by Manfred Schenk [ 25/Jun/18 ]

Thank you for the fix.

With the fix, our bamboo build now works with gradle 4.8.1 - so the problem is definitely solved.

Comment by Eyal Ben Moshe [ 25/Jun/18 ]

Thank you for the feedback Manfred Schenk!

Comment by Manfred Schenk [ 26/Jun/18 ]

Sorry,

I just found out that my last feedback was wrong.

The build indeed ran without errors with gradle 4.8.1 and BAP 2.5.0, but it didn't deploy any artifacts to the artifactory server.

The same situation occured with older gradle versions so we had to rollback to the older plugin and downgrade gradle.

The new situation has been described in Ticket https://www.jfrog.com/jira/browse/BAP-442.

Comment by Eyal Ben Moshe [ 26/Jun/18 ]

Manfred Schenk,

We have just reproduced this issue. We will soon publish a fix.

The following Jira issue tracks the fix:

https://www.jfrog.com/jira/browse/BAP-442

Generated at Sat Aug 24 10:13:39 UTC 2019 using JIRA 7.6.3#76005-sha1:8a4e38d34af948780dbf52044e7aafb13a7cae58.