jfrog / bamboo-artifactory-plugin

Atlassian Bamboo plugin that enables traceable build artifacts with Artifactory
https://plugins.atlassian.com/plugin/details/27818
Apache License 2.0
42 stars 55 forks source link

Artifactory plugin 3.3.3 for Bamboo does not work in Bamboo 9.6.0 #213

Closed staubesv closed 7 months ago

staubesv commented 8 months ago

Describe the bug After upgrading Bamboo Datacenter from version 9.5.1 to version 9.6.0 using the official Atlassian docker image, our build plans fail at the very end of the build (see stack trace below).

To Reproduce Upgrade Bamboo to 9.6.0 und run any build plan using the plugin version 3.3.3.

Expected behavior Plugin should work with Bamboo 9.6.0

Versions

Additional context According to the release notes of Bamboo 9.6.0 (https://confluence.atlassian.com/bambooreleases/bamboo-9-6-release-notes-1376026732.html), support for jgit has been removed:

Pushing to remote repositories with JGit no longer possible We’ve found a bug in Bamboo’s long-deprecated JGit feature that poses a risk to the integrity of repositories using the Large File Storage (LFS) extension. Because of the way we’ve implemented JGit’s push functionality in Bamboo, pushing local commits to LFS-enabled repositories may not work as expected. To prevent issues with file integrity, we’ve disabled pushing to remote repositories with JGit.

Bamboo’s JGit feature has never supported making any modification of the repository, including the creation of commits, branches, or tags. If you need this functionality, install native git.

The stack trace kind of suggests that this has become a problem:

Failed to execute plugin 'Artifactory Release Management Staging' with error: com/jcraft/jsch/JSchException
java.lang.NoClassDefFoundError: com/jcraft/jsch/JSchException
        at org.eclipse.jgit.transport.Transport.<clinit>(Transport.java:120)
        at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:155)
        at org.jfrog.bamboo.release.vcs.git.GitManager.pushTag(GitManager.java:189)
        at org.jfrog.bamboo.release.vcs.git.GitCoordinator.afterSuccessfulReleaseVersionBuild(GitCoordinator.java:90)
        at org.jfrog.bamboo.release.provider.AbstractReleaseProvider.afterSuccessfulReleaseVersionBuild(AbstractReleaseProvider.java:112)
        at org.jfrog.bamboo.release.action.ArtifactoryPostBuildCompleteAction.call(ArtifactoryPostBuildCompleteAction.java:80)
        at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.performCustomBuildProcess(ExecuteBuildTask.java:142)
        at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:82)
        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.executeBuildPhase(DefaultBuildAgent.java:242)
        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:214)
        at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.lambda$waitAndPerformBuild$0(BuildAgentControllerImpl.java:168)
        at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:115)
        at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:161)
        at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.lambda$start$0(DefaultBuildAgent.java:159)
        at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48)
        at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)
        at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)
        at com.atlassian.bamboo.security.ImpersonationHelper.lambda$makeRunnableWithSystemAuthority$0(ImpersonationHelper.java:38)
        at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.ClassNotFoundException: com.jcraft.jsch.JSchException not found by org.jfrog.bamboo.bamboo-artifactory-plugin [33]
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1591)
        at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1976)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
        ... 19 more
szymonbienkowski commented 7 months ago

We've got same error after update to bamboo 9.6.0

staubesv commented 7 months ago

As a workaround, we have manually added the missing dependency (com/jcraft/jsch/JSchException) directly to the JAR file - that way, the plugin works with 9.6.0 ;-)

szymonbienkowski commented 7 months ago

ok - I added in the pom.xml file:

<dependency> <groupId>com.jcraft</groupId> <artifactId>jsch</artifactId> <version>0.1.55</version> </dependency>

and build package. After that jar have had necessary dependencies.

RobiNino commented 7 months ago

Hi @staubesv @szymonbienkowski , Plugin version 3.3.4 was just released with support to Bamboo 9.6.0. We'd appreciate your feedback for it, thanks.

staubesv commented 7 months ago

@RobiNino Thank you very much!

We will install 3.3.4 next week and report our findings back here.

staubesv commented 7 months ago

Just testet version 3.3.4 with Bamboo Datacenter 9.6.1 - works like charm ;-)