From 773691ecb4c9f4df3d13afc1b4d2497b8491dff5 Mon Sep 17 00:00:00 2001 From: JosephMancusoa Date: Tue, 25 Apr 2023 13:47:11 +0800 Subject: [PATCH] Bump `artifactory` from 3.4.0 to 3.11.2 (#1610) * Bump artifactory from 3.4.0 to 3.11.0 Bumps [artifactory](https://github.com/jenkinsci/artifactory-plugin) from 3.4.0 to 3.11.0. - [Release notes](https://github.com/jenkinsci/artifactory-plugin/releases) - [Commits](https://github.com/jenkinsci/artifactory-plugin/compare/artifactory-3.4.0...artifactory-3.11.0) Signed-off-by: dependabot[bot] * Require upper bound dependencies error for org.jenkins-ci.main:maven-plugin:3.1.2 paths to dependency are: +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.1.2 (managed) <-- org.jenkins-ci.main:maven-plugin:3.4 * Require upper bound dependencies error for org.codehaus.plexus:plexus-classworlds:2.5.2 paths to dependency are: +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.codehaus.plexus:plexus-classworlds:2.5.2 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.codehaus.plexus:plexus-classworlds:2.6.0 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.jenkins-ci.main.maven:maven3-agent:1.13 +-org.codehaus.plexus:plexus-classworlds:2.4.2 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.jenkins-ci.main.maven:maven31-agent:1.13 +-org.codehaus.plexus:plexus-classworlds:2.4.2 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.jenkins-ci.main.maven:maven32-agent:1.13 +-org.codehaus.plexus:plexus-classworlds:2.5.1 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.jenkins-ci.main.maven:maven33-agent:1.13 +-org.codehaus.plexus:plexus-classworlds:2.5.2 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.jenkins-ci.main.maven:maven35-agent:1.13 +-org.codehaus.plexus:plexus-classworlds:2.6.0 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.jenkins-ci.main.maven:maven32-interceptor:1.13 +-org.codehaus.plexus:plexus-classworlds:2.5.1 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.apache.maven:maven-core:3.5.4 +-org.codehaus.plexus:plexus-classworlds:2.5.2 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.apache.maven:maven-embedder:3.5.4 +-org.codehaus.plexus:plexus-classworlds:2.5.2 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.eclipse.sisu:org.eclipse.sisu.plexus:0.3.3 +-org.codehaus.plexus:plexus-classworlds:2.5.2 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.jenkins-ci.lib:lib-jenkins-maven-embedder:3.14 +-org.codehaus.plexus:plexus-classworlds:2.6.0 * Require upper bound dependencies error for org.apache.maven:maven-artifact:3.5.0 paths to dependency are: +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:jira:3.0.8 +-org.apache.maven:maven-artifact:3.5.0 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.apache.maven:maven-core:3.5.4 +-org.apache.maven:maven-artifact:3.5.4 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.apache.maven:maven-compat:3.5.4 +-org.apache.maven:maven-artifact:3.5.4 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.jenkins-ci.lib:lib-jenkins-maven-embedder:3.14 +-org.apache.maven:maven-artifact:3.5.4 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.apache.maven:maven-core:3.5.4 +-org.apache.maven:maven-plugin-api:3.3.3 (managed) <-- org.apache.maven:maven-plugin-api:3.5.4 +-org.apache.maven:maven-artifact:3.3.3 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.apache.maven:maven-core:3.5.4 +-org.apache.maven:maven-model-builder:3.5.4 +-org.apache.maven:maven-artifact:3.5.4 * Require upper bound dependencies error for org.apache.maven:maven-plugin-api:3.3.3 paths to dependency are: +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.apache.maven:maven-core:3.5.4 +-org.apache.maven:maven-plugin-api:3.3.3 (managed) <-- org.apache.maven:maven-plugin-api:3.5.4 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jenkins-ci.main:maven-plugin:3.4 +-org.apache.maven:maven-embedder:3.5.4 +-org.apache.maven:maven-plugin-api:3.3.3 (managed) <-- org.apache.maven:maven-plugin-api:3.5.4 * Require upper bound dependencies error for com.github.docker-java:docker-java:3.1.1 paths to dependency are: +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jfrog.buildinfo:build-info-extractor-docker:2.26.0 +-com.github.docker-java:docker-java:3.1.1 (managed) <-- com.github.docker-java:docker-java:3.1.5 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-io.jenkins.docker:docker-plugin:1.1.2 +-org.jenkins-ci.plugins:docker-java-api:3.0.14 +-com.github.docker-java:docker-java:3.1.1 (managed) <-- com.github.docker-java:docker-java:3.0.14 * Require upper bound dependencies error for com.kohlschutter.junixsocket:junixsocket-common:2.0.4 paths to dependency are: +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-io.jenkins.docker:docker-plugin:1.1.2 +-com.kohlschutter.junixsocket:junixsocket-common:2.0.4 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-io.jenkins.docker:docker-plugin:1.1.2 +-com.kohlschutter.junixsocket:junixsocket-native-common:2.0.4 +-com.kohlschutter.junixsocket:junixsocket-common:2.0.4 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jfrog.buildinfo:build-info-extractor-docker:2.26.0 +-com.github.docker-java:docker-java:3.1.5 +-com.kohlschutter.junixsocket:junixsocket-common:2.2.0 Require upper bound dependencies error for com.kohlschutter.junixsocket:junixsocket-native-common:2.0.4 paths to dependency are: +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-io.jenkins.docker:docker-plugin:1.1.2 +-com.kohlschutter.junixsocket:junixsocket-native-common:2.0.4 and +-io.jenkins.configuration-as-code:integrations:1.52-SNAPSHOT +-org.jenkins-ci.plugins:artifactory:3.11.0 +-org.jfrog.buildinfo:build-info-extractor-docker:2.26.0 +-com.github.docker-java:docker-java:3.1.5 +-com.kohlschutter.junixsocket:junixsocket-native-common:2.2.0 * Update docs and tests for Artifactory >= 3.11.0 * More syntax updates * Pull in jfrog/jenkins-artifactory-plugin#455 * Apparently jfrog/jenkins-artifactory-plugin#478 fixed the export problem. Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- demos/artifactory/README.md | 18 ++++++++++++ demos/jenkins/jenkins.yaml | 6 ++-- integrations/pom.xml | 29 ++++++++++++++++--- .../jenkins/plugins/casc/ArtifactoryTest.java | 16 +++++----- .../jenkins/plugins/casc/JenkinsDemoTest.java | 14 ++++----- .../plugins/casc/ArtifactoryBuilderTest.yml | 9 +++--- 6 files changed, 65 insertions(+), 27 deletions(-) diff --git a/demos/artifactory/README.md b/demos/artifactory/README.md index 9af4486c..698026d4 100644 --- a/demos/artifactory/README.md +++ b/demos/artifactory/README.md @@ -4,6 +4,24 @@ Artifactory plugin configuration belongs under `unclassified` root element ## sample configuration +Since 3.11.0: + +```yaml +unclassified: + artifactorybuilder: + useCredentialsPlugin: true + jfrogInstances: + - instanceId: artifactory + url: http://acme.com/artifactory + deployerCredentialsConfig: + credentialsId: "artifactory" + resolverCredentialsConfig: + username: artifactory_user + password: "${ARTIFACTORY_PASSWORD}" +``` + +Before 3.11.0: + ```yaml unclassified: artifactorybuilder: diff --git a/demos/jenkins/jenkins.yaml b/demos/jenkins/jenkins.yaml index 8c93ca33..9644be8f 100644 --- a/demos/jenkins/jenkins.yaml +++ b/demos/jenkins/jenkins.yaml @@ -53,9 +53,9 @@ tool: unclassified: artifactorybuilder: useCredentialsPlugin: true - artifactoryServers: - - serverId: artifactory - artifactoryUrl: http://acme.com/artifactory + jfrogInstances: + - instanceId: artifactory + url: http://acme.com/artifactory resolverCredentialsConfig: username: artifactory_user password: "${ARTIFACTORY_PASSWORD}" diff --git a/integrations/pom.xml b/integrations/pom.xml index e488ea5d..982f0c42 100644 --- a/integrations/pom.xml +++ b/integrations/pom.xml @@ -16,6 +16,7 @@ 2.11.3 4.1.52.Final 2.289 + 2.2.0 @@ -61,7 +62,7 @@ org.jenkins-ci.plugins artifactory - 3.4.0 + 3.11.2 test @@ -530,7 +531,7 @@ com.github.docker-java docker-java - 3.1.1 + 3.1.5 org.glassfish.jersey.inject @@ -538,6 +539,16 @@ + + com.kohlschutter.junixsocket + junixsocket-common + ${junixsocket.version} + + + com.kohlschutter.junixsocket + junixsocket-native-common + ${junixsocket.version} + com.amazonaws @@ -652,6 +663,11 @@ httpmime 4.5.13 + + org.apache.maven + maven-artifact + 3.5.4 + org.apache.maven maven-model @@ -660,7 +676,12 @@ org.apache.maven maven-plugin-api - 3.3.3 + 3.5.4 + + + org.codehaus.plexus + plexus-classworlds + 2.6.0 org.codehaus.plexus @@ -685,7 +706,7 @@ org.jenkins-ci.main maven-plugin - 3.1.2 + 3.4 org.jenkins-ci.modules diff --git a/integrations/src/test/java/io/jenkins/plugins/casc/ArtifactoryTest.java b/integrations/src/test/java/io/jenkins/plugins/casc/ArtifactoryTest.java index 74e28f9a..f96c9533 100644 --- a/integrations/src/test/java/io/jenkins/plugins/casc/ArtifactoryTest.java +++ b/integrations/src/test/java/io/jenkins/plugins/casc/ArtifactoryTest.java @@ -5,7 +5,7 @@ import java.util.List; import jenkins.model.Jenkins; import org.jfrog.hudson.ArtifactoryBuilder; -import org.jfrog.hudson.ArtifactoryServer; +import org.jfrog.hudson.JFrogPlatformInstance; import org.junit.Rule; import org.junit.Test; import org.junit.contrib.java.lang.system.EnvironmentVariables; @@ -31,13 +31,13 @@ public void configure_artifactory() throws Exception { final ArtifactoryBuilder.DescriptorImpl descriptor = (ArtifactoryBuilder.DescriptorImpl) jenkins.getDescriptor(ArtifactoryBuilder.class); assertTrue(descriptor.getUseCredentialsPlugin()); - final List actifactoryServers = descriptor.getArtifactoryServers(); - assertThat(actifactoryServers, hasSize(1)); - assertThat(actifactoryServers.get(0).getName(), is(equalTo("artifactory"))); - assertThat(actifactoryServers.get(0).getUrl(), is(equalTo("http://acme.com/artifactory"))); - assertThat(actifactoryServers.get(0).getDeployerCredentialsConfig().getCredentialsId(), is(equalTo("artifactory"))); - assertThat(actifactoryServers.get(0).getResolverCredentialsConfig().getUsername(), is(equalTo("artifactory_user"))); - assertThat(actifactoryServers.get(0).getResolverCredentialsConfig().getPassword(), is(equalTo("password123"))); + final List jfrogInstances = descriptor.getJfrogInstances(); + assertThat(jfrogInstances, hasSize(1)); + assertThat(jfrogInstances.get(0).getId(), is(equalTo("artifactory"))); + assertThat(jfrogInstances.get(0).getUrl(), is(equalTo("http://acme.com/artifactory"))); + assertThat(jfrogInstances.get(0).getDeployerCredentialsConfig().getCredentialsId(), is(equalTo("artifactory"))); + assertThat(jfrogInstances.get(0).getResolverCredentialsConfig().getUsername(), is(equalTo("artifactory_user"))); + assertThat(jfrogInstances.get(0).getResolverCredentialsConfig().getPassword().getPlainText(), is(equalTo("password123"))); } } diff --git a/integrations/src/test/java/io/jenkins/plugins/casc/JenkinsDemoTest.java b/integrations/src/test/java/io/jenkins/plugins/casc/JenkinsDemoTest.java index 594397f6..6d34e92b 100644 --- a/integrations/src/test/java/io/jenkins/plugins/casc/JenkinsDemoTest.java +++ b/integrations/src/test/java/io/jenkins/plugins/casc/JenkinsDemoTest.java @@ -12,7 +12,7 @@ import org.jenkinsci.plugins.workflow.libs.GlobalLibraries; import org.jenkinsci.plugins.workflow.libs.LibraryConfiguration; import org.jfrog.hudson.ArtifactoryBuilder; -import org.jfrog.hudson.ArtifactoryServer; +import org.jfrog.hudson.JFrogPlatformInstance; import org.junit.Rule; import org.junit.Test; import org.junit.contrib.java.lang.system.EnvironmentVariables; @@ -71,12 +71,12 @@ public void configure_demo_yaml() throws Exception { final ArtifactoryBuilder.DescriptorImpl artifactory = (ArtifactoryBuilder.DescriptorImpl) jenkins.getDescriptor(ArtifactoryBuilder.class); assertTrue(artifactory.getUseCredentialsPlugin()); - final List actifactoryServers = artifactory.getArtifactoryServers(); - assertThat(actifactoryServers, hasSize(1)); - assertThat(actifactoryServers.get(0).getName(), is(equalTo("artifactory"))); - assertThat(actifactoryServers.get(0).getUrl(), is(equalTo("http://acme.com/artifactory"))); - assertThat(actifactoryServers.get(0).getResolverCredentialsConfig().getUsername(), is(equalTo("artifactory_user"))); - assertThat(actifactoryServers.get(0).getResolverCredentialsConfig().getPassword(), is(equalTo("password123"))); + final List jfrogInstances = artifactory.getJfrogInstances(); + assertThat(jfrogInstances, hasSize(1)); + assertThat(jfrogInstances.get(0).getId(), is(equalTo("artifactory"))); + assertThat(jfrogInstances.get(0).getUrl(), is(equalTo("http://acme.com/artifactory"))); + assertThat(jfrogInstances.get(0).getResolverCredentialsConfig().getUsername(), is(equalTo("artifactory_user"))); + assertThat(jfrogInstances.get(0).getResolverCredentialsConfig().getPassword().getPlainText(), is(equalTo("password123"))); } } diff --git a/test-harness/src/test/resources/io/jenkins/plugins/casc/ArtifactoryBuilderTest.yml b/test-harness/src/test/resources/io/jenkins/plugins/casc/ArtifactoryBuilderTest.yml index 59780781..34911af9 100644 --- a/test-harness/src/test/resources/io/jenkins/plugins/casc/ArtifactoryBuilderTest.yml +++ b/test-harness/src/test/resources/io/jenkins/plugins/casc/ArtifactoryBuilderTest.yml @@ -1,10 +1,9 @@ -jenkins: +unclassified: artifactorybuilder: useCredentialsPlugin: true - artifactoryServers: - - name: foo - serverId: artifactory - artifactoryUrl: http://acme.com/artifactory + jfrogInstances: + - instanceId: artifactory + url: http://acme.com/artifactory resolverCredentialsConfig: username: artifactory_user password: ${ARTIFACTORY_PASSWORD}