Skip to content

Commit

Permalink
Bamboo 9 compatibility, upgrade build-info dependencies, bug fixes (#193
Browse files Browse the repository at this point in the history
)
  • Loading branch information
RobiNino authored Feb 7, 2023
1 parent 3a35e27 commit b823b58
Show file tree
Hide file tree
Showing 37 changed files with 264 additions and 428 deletions.
104 changes: 36 additions & 68 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</scm>

<properties>
<bamboo.version>7.1.4</bamboo.version>
<bamboo.version>9.0.1</bamboo.version>
<bamboo.data.version>${bamboo.version}</bamboo.data.version>
<!-- This key is used to keep the consistency between the key in atlassian-plugin.xml and the key to generate bundle. -->
<atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
Expand All @@ -40,13 +40,8 @@
<maven.compiler.target>1.8</maven.compiler.target>
<!--Skip integration tests unless explicitly requested with -DskipITs=false-->
<skipITs>true</skipITs>
<buildinfo.version>2.26.1</buildinfo.version>
<buildinfo.maven.version>2.26.1</buildinfo.maven.version>
<buildinfo.gradle.version>4.24.1</buildinfo.gradle.version>
<buildinfo.ivy.version>2.26.1</buildinfo.ivy.version>
<buildinfo.npm.version>2.26.1</buildinfo.npm.version>
<buildinfo.nuget.version>2.26.1</buildinfo.nuget.version>
<buildinfo.docker.version>2.26.1</buildinfo.docker.version>
<buildinfo.version>2.39.1</buildinfo.version>
<buildinfo.gradle.version>4.31.1</buildinfo.gradle.version>
</properties>

<profiles>
Expand Down Expand Up @@ -84,17 +79,18 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.1</version>
<version>2.19.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
<version>3.12.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jgit</groupId>
Expand Down Expand Up @@ -168,13 +164,13 @@
<dependency>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>build-info-extractor-nuget</artifactId>
<version>${buildinfo.nuget.version}</version>
<version>${buildinfo.version}</version>
<classifier>uber</classifier>
</dependency>
<dependency>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>build-info-extractor-npm</artifactId>
<version>${buildinfo.npm.version}</version>
<version>${buildinfo.version}</version>
<classifier>uber</classifier>
<exclusions>
<exclusion>
Expand All @@ -186,7 +182,7 @@
<dependency>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>build-info-extractor-docker</artifactId>
<version>${buildinfo.docker.version}</version>
<version>${buildinfo.version}</version>
<classifier>uber</classifier>
<exclusions>
<exclusion>
Expand All @@ -206,7 +202,7 @@
<dependency>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>build-info-extractor-ivy</artifactId>
<version>${buildinfo.ivy.version}</version>
<version>${buildinfo.version}</version>
<classifier>uber</classifier>
<exclusions>
<exclusion>
Expand All @@ -218,25 +214,25 @@
<dependency>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>build-info-extractor-maven3</artifactId>
<version>${buildinfo.maven.version}</version>
<version>${buildinfo.version}</version>
<classifier>uber</classifier>
<exclusions>
<exclusion>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-smile</artifactId>
<version>1.9.13</version>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.14.1</version>
</dependency>

<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.1</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -268,7 +264,7 @@
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.1.210</version>
<version>2.1.214</version>
</dependency>

<dependency>
Expand All @@ -289,11 +285,6 @@
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.2-atlassian-1</version>
</dependency>

<dependency>
<groupId>com.atlassian.bamboo</groupId>
Expand Down Expand Up @@ -324,12 +315,12 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.0.3</version>
<version>3.8.7</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-embedder</artifactId>
<version>3.0.3</version>
<version>3.8.7</version>
</dependency>

<!-- WIRED TEST RUNNER DEPENDENCIES -->
Expand All @@ -348,7 +339,7 @@
<dependency>
<groupId>com.jfrog.testing</groupId>
<artifactId>jfrog-testing-infra</artifactId>
<version>1.0.2</version>
<version>1.1.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -364,14 +355,14 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.9</version>
<version>1.10.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.atlassian.plugins</groupId>
<artifactId>atlassian-plugins-osgi</artifactId>
<version>5.3.5</version>
<version>7.1.1</version>
<scope>provided</scope>
</dependency>

Expand Down Expand Up @@ -526,7 +517,7 @@
<excludes>META-INF/**/*</excludes>
<excludeClassifiers>uber</excludeClassifiers>
<includeArtifactIds>
build-info-api,build-info-client,build-info-extractor,build-info-extractor-maven3,build-info-vcs,jackson-core-asl,jackson-mapper-asl,p4java-jfrog,org.eclipse.jgit
build-info-api,build-info-client,build-info-extractor,build-info-extractor-maven3,build-info-vcs,p4java-jfrog,org.eclipse.jgit
</includeArtifactIds>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<overWriteReleases>true</overWriteReleases>
Expand All @@ -544,12 +535,12 @@
<artifactItem>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>build-info-extractor-maven3</artifactId>
<version>${buildinfo.maven.version}</version>
<version>${buildinfo.version}</version>
<type>jar</type>
<classifier>uber</classifier>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/classes/META-INF/lib</outputDirectory>
<destFileName>build-info-extractor-maven3-${buildinfo.maven.version}-uber.jar
<destFileName>build-info-extractor-maven3-${buildinfo.version}-uber.jar
</destFileName>
</artifactItem>
<artifactItem>
Expand All @@ -566,75 +557,52 @@
<artifactItem>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>build-info-extractor-nuget</artifactId>
<version>${buildinfo.nuget.version}</version>
<version>${buildinfo.version}</version>
<type>jar</type>
<classifier>uber</classifier>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/classes/META-INF/lib</outputDirectory>
<destFileName>build-info-extractor-nuget-${buildinfo.nuget.version}-uber.jar
<destFileName>build-info-extractor-nuget-${buildinfo.version}-uber.jar
</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>build-info-extractor-npm</artifactId>
<version>${buildinfo.npm.version}</version>
<version>${buildinfo.version}</version>
<type>jar</type>
<classifier>uber</classifier>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/classes/META-INF/lib</outputDirectory>
<destFileName>build-info-extractor-npm-${buildinfo.npm.version}-uber.jar
<destFileName>build-info-extractor-npm-${buildinfo.version}-uber.jar
</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>build-info-extractor-docker</artifactId>
<version>${buildinfo.docker.version}</version>
<version>${buildinfo.version}</version>
<type>jar</type>
<classifier>uber</classifier>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/classes/META-INF/lib</outputDirectory>
<destFileName>build-info-extractor-docker-${buildinfo.docker.version}-uber.jar
<destFileName>build-info-extractor-docker-${buildinfo.version}-uber.jar
</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>build-info-extractor-ivy</artifactId>
<version>${buildinfo.ivy.version}</version>
<version>${buildinfo.version}</version>
<type>jar</type>
<classifier>uber</classifier>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/classes/META-INF/lib</outputDirectory>
<destFileName>build-info-extractor-ivy-${buildinfo.ivy.version}-uber.jar
<destFileName>build-info-extractor-ivy-${buildinfo.version}-uber.jar
</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>

<!-- The following plugin removes GroovyAssert from the created jat to prevent agent loading failure -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>remove-GroovyAssert</id>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<delete>
<fileset dir="${project.build.directory}/classes/groovy/test/"
includes="GroovyAssert.class"/>
</delete>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.codehaus.jackson.JsonFactory;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.map.ObjectMapper;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.ObjectMapper;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
import org.jfrog.bamboo.security.EncryptionHelper;
import org.jfrog.bamboo.util.BuildInfoLog;
import org.jfrog.bamboo.util.TaskUtils;
import org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient;
import org.jfrog.build.util.VersionException;
import org.jfrog.build.extractor.clientConfiguration.ArtifactoryManagerBuilder;
import org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

Expand Down Expand Up @@ -191,21 +192,21 @@ public void setSendTest(String sendTest) {
}

private void testConnection() {
ArtifactoryBuildInfoClient testClient;
ArtifactoryManagerBuilder managerBuilder;
if (StringUtils.isNotBlank(username)) {
testClient = TaskUtils.getArtifactoryBuildInfoClient(new ServerConfig(serverId, url, username,
managerBuilder = TaskUtils.getArtifactoryManagerBuilderBuilder(new ServerConfig(serverId, url, username,
password, timeout), new BuildInfoLog(log));
} else {
testClient = TaskUtils.getArtifactoryBuildInfoClient(new ServerConfig(serverId, url,
managerBuilder = TaskUtils.getArtifactoryManagerBuilderBuilder(new ServerConfig(serverId, url,
"", "", timeout), new BuildInfoLog(log));
}
try {
testClient.verifyCompatibleArtifactoryVersion();
try (ArtifactoryManager client = managerBuilder.build()) {
client.getVersion();
addActionMessage("Connection successful!");
} catch (VersionException ve) {
handleConnectionException(ve);
} catch (IllegalArgumentException iae) {
handleConnectionException(iae);
} catch (IOException e) {
throw new RuntimeException(e);
}
}

Expand Down
Loading

0 comments on commit b823b58

Please sign in to comment.