diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 84d3cb6f9af..4e2af9953da 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -7,6 +7,6 @@ jobs: update_release_draft: runs-on: ubuntu-latest steps: - - uses: release-drafter/release-drafter@v5.11.0 + - uses: release-drafter/release-drafter@v5.15.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Jenkinsfile b/Jenkinsfile index f7a67b77a52..9d3e0528a53 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -33,7 +33,7 @@ envs = [ 'GIT_AUTHOR_EMAIL=hates@cake.com' ] -jenkinsVersions = ['2.176.4'] +jenkinsVersions = ['2.222.4'] if (params.USE_SAUCELABS) { credentials.add(usernamePassword(credentialsId: 'saucelabs', passwordVariable: 'SAUCE_ACCESS_KEY', usernameVariable: 'SAUCE_USERNAME')) @@ -81,7 +81,7 @@ node() { stage('Building BlueOcean') { timeout(time: 90, unit: 'MINUTES') { - sh "mvn clean install -V -B -DcleanNode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Dmaven.test.failure.ignore -s settings.xml -Dmaven.artifact.threads=30" + sh "mvn clean install -T1C -V -B -DcleanNode --no-transfer-progress -Dmaven.test.failure.ignore -s settings.xml -Dmaven.artifact.threads=30" } junit '**/target/surefire-reports/TEST-*.xml' @@ -91,7 +91,7 @@ node() { jenkinsVersions.each { version -> stage("ATH - Jenkins ${version}") { - timeout(time: 90, unit: 'MINUTES') { + timeout(time: 150, unit: 'MINUTES') { dir('acceptance-tests') { sh "bash -x ./run.sh -v=${version} --host=${ip} --no-selenium --settings='-s ${env.WORKSPACE}/settings.xml'" junit '**/target/surefire-reports/*.xml' diff --git a/acceptance-tests/pom.xml b/acceptance-tests/pom.xml index e529656300a..9ac96830d8e 100644 --- a/acceptance-tests/pom.xml +++ b/acceptance-tests/pom.xml @@ -12,7 +12,7 @@ 1.8 ./target/phantomjs-maven-plugin/phantomjs-2.1.1-linux-x86_64/bin/phantomjs -Djdk.net.URLClassPath.disableClassPathURLCheck=true - 1.7.25 + 1.7.30 3.141.59 diff --git a/acceptance-tests/runner/runtime-plugins/fake-security-realm-plugin/pom.xml b/acceptance-tests/runner/runtime-plugins/fake-security-realm-plugin/pom.xml index 704d39c574f..d8324bb582a 100644 --- a/acceptance-tests/runner/runtime-plugins/fake-security-realm-plugin/pom.xml +++ b/acceptance-tests/runner/runtime-plugins/fake-security-realm-plugin/pom.xml @@ -15,7 +15,7 @@ - 2.176.4 + 2.222.4 diff --git a/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/AbstractGithubOrganization.java b/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/AbstractGithubOrganization.java index c57f5f995e8..406a9270b97 100644 --- a/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/AbstractGithubOrganization.java +++ b/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/AbstractGithubOrganization.java @@ -25,7 +25,7 @@ public abstract class AbstractGithubOrganization extends ScmOrganization { @Override public boolean isJenkinsOrganizationPipeline() { - for(TopLevelItem item: Jenkins.getInstance().getItems()){ + for(TopLevelItem item: Jenkins.get().getItems()){ if(item instanceof OrganizationFolder){ OrganizationFolder folder = (OrganizationFolder) item; for(SCMNavigator navigator: folder.getNavigators()) { diff --git a/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GitHubFactory.java b/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GitHubFactory.java index 0a7923f1565..6d486ec8f96 100644 --- a/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GitHubFactory.java +++ b/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GitHubFactory.java @@ -29,7 +29,7 @@ class GitHubFactory { */ public static GitHub connect(String accessToken, String endpointUri) throws IOException { URL apiUrl = new URL(endpointUri); - ProxyConfiguration proxyConfig = Jenkins.getInstance().proxy; + ProxyConfiguration proxyConfig = Jenkins.get().proxy; Proxy proxy = proxyConfig == null ? Proxy.NO_PROXY : proxyConfig.createProxy(apiUrl.getHost()); OkHttpClient.Builder builder = baseClient.newBuilder().proxy(proxy); diff --git a/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubIssue.java b/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubIssue.java index 2852a4fc6dc..6327f70c17a 100644 --- a/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubIssue.java +++ b/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubIssue.java @@ -8,7 +8,6 @@ import io.jenkins.blueocean.rest.model.BlueIssue; import jenkins.branch.MultiBranchProject; import jenkins.scm.api.SCMSource; -import org.jenkinsci.plugins.github.config.GitHubServerConfig; import org.jenkinsci.plugins.github_branch_source.GitHubSCMSource; import org.jenkinsci.plugins.github_branch_source.HttpsRepositoryUriResolver; diff --git a/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubPipelineCreateRequest.java b/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubPipelineCreateRequest.java index 012a7655460..578b2290c26 100644 --- a/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubPipelineCreateRequest.java +++ b/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubPipelineCreateRequest.java @@ -1,10 +1,6 @@ package io.jenkins.blueocean.blueocean_github_pipeline; import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials; -import com.google.common.base.Predicate; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; import edu.umd.cs.findbugs.annotations.NonNull; import io.jenkins.blueocean.commons.ErrorMessage; import io.jenkins.blueocean.commons.ServiceException; @@ -34,8 +30,11 @@ import javax.annotation.Nullable; import java.io.IOException; import java.net.HttpURLConnection; +import java.util.ArrayList; +import java.util.Collections; import java.util.HashSet; import java.util.List; +import java.util.Optional; import java.util.Set; /** @@ -88,7 +87,7 @@ public boolean isMatch(@NonNull SCMSource source) { @Override protected List validate(String name, BlueScmConfig scmConfig) { - List errors = Lists.newArrayList(); + List errors = new ArrayList(); StandardUsernamePasswordCredentials credentials = null; String credentialId = computeCredentialIdWithGithubDefault(scmConfig); if(StringUtils.isBlank(scmConfig.getUri())){ @@ -144,14 +143,14 @@ private void updateEndpoints(String apiUrl) { GitHubConfiguration config = GitHubConfiguration.get(); synchronized (config) { final String finalApiUrl = apiUrl; - Endpoint endpoint = Iterables.find(config.getEndpoints(), new Predicate() { - @Override - public boolean apply(@Nullable Endpoint input) { - return input != null && input.getApiUri().equals(finalApiUrl); - } - }, null); + Optional optionalEndpoint = config.getEndpoints() + .stream() + .filter( input -> input != null && input.getApiUri().equals( finalApiUrl)) + .findFirst(); + Endpoint endpoint = optionalEndpoint.isPresent()? optionalEndpoint.get():null; + if (endpoint == null) { - config.setEndpoints(ImmutableList.of(new Endpoint(apiUrl, apiUrl))); + config.setEndpoints(Collections.singletonList(new Endpoint( apiUrl, apiUrl))); config.save(); } } diff --git a/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubScm.java b/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubScm.java index 7217c139cbf..e6033fb5557 100644 --- a/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubScm.java +++ b/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubScm.java @@ -2,12 +2,10 @@ import com.cloudbees.plugins.credentials.CredentialsScope; import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials; -import com.cloudbees.plugins.credentials.domains.DomainSpecification; import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl; import com.fasterxml.jackson.databind.ObjectReader; import com.fasterxml.jackson.databind.ObjectWriter; import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableList; import hudson.Extension; import hudson.model.Item; import hudson.model.User; @@ -18,7 +16,6 @@ import io.jenkins.blueocean.credential.CredentialsUtils; import io.jenkins.blueocean.rest.Reachable; import io.jenkins.blueocean.rest.hal.Link; -import io.jenkins.blueocean.rest.impl.pipeline.PipelineImpl; import io.jenkins.blueocean.rest.impl.pipeline.credential.BlueOceanDomainRequirement; import io.jenkins.blueocean.rest.impl.pipeline.credential.BlueOceanDomainSpecification; import io.jenkins.blueocean.rest.impl.pipeline.scm.AbstractScm; @@ -26,7 +23,6 @@ import io.jenkins.blueocean.rest.impl.pipeline.scm.ScmFactory; import io.jenkins.blueocean.rest.impl.pipeline.scm.ScmOrganization; import io.jenkins.blueocean.rest.impl.pipeline.scm.ScmServerEndpointContainer; -import io.jenkins.blueocean.rest.model.BluePipeline; import io.jenkins.blueocean.rest.model.Container; import jenkins.model.Jenkins; import net.sf.json.JSONObject; @@ -47,7 +43,6 @@ import org.kohsuke.stapler.WebMethod; import org.kohsuke.stapler.json.JsonBody; import org.kohsuke.stapler.verb.GET; -import org.kohsuke.stapler.verb.PUT; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -57,7 +52,9 @@ import java.net.URI; import java.net.URISyntaxException; import java.net.UnknownHostException; +import java.nio.charset.Charset; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; @@ -304,7 +301,7 @@ public HttpResponse validateAndCreate(@JsonBody JSONObject request) { HttpURLConnection connection = connect(String.format("%s/%s", getUri(), "user"),accessToken); validateAccessTokenScopes(connection); - String data = IOUtils.toString(HttpRequest.getInputStream(connection)); + String data = IOUtils.toString(HttpRequest.getInputStream(connection), Charset.defaultCharset()); GHUser user = GithubScm.getMappingObjectReader().forType(GHUser.class).readValue(data); if(user.getEmail() != null){ @@ -323,12 +320,12 @@ public HttpResponse validateAndCreate(@JsonBody JSONObject request) { if(githubCredential == null) { CredentialsUtils.createCredentialsInUserStore( - credential, authenticatedUser, getCredentialDomainName(), - ImmutableList.of(new BlueOceanDomainSpecification())); + credential, authenticatedUser, getCredentialDomainName(), + Collections.singletonList(new BlueOceanDomainSpecification())); }else{ CredentialsUtils.updateCredentialsInUserStore( githubCredential, credential, authenticatedUser, getCredentialDomainName(), - ImmutableList.of(new BlueOceanDomainSpecification())); + Collections.singletonList(new BlueOceanDomainSpecification())); } return createResponse(credential.getId()); diff --git a/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubScmContentProvider.java b/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubScmContentProvider.java index e2b451de444..282812398cf 100644 --- a/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubScmContentProvider.java +++ b/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubScmContentProvider.java @@ -226,21 +226,15 @@ protected StandardUsernamePasswordCredentials getCredentialForUser(final Item it //tests might add scmId to indicate which Scm should be used to find credential //We have to do this because apiUrl might be of WireMock server and not Github || (StringUtils.isNotBlank(scmId) && scmId.equals(GithubScm.ID))) { - scm = new GithubScm(new Reachable() { - @Override - public Link getLink() { - Preconditions.checkNotNull(organization); - return organization.getLink().rel("scm"); - } - }); + scm = new GithubScm( () -> { + Preconditions.checkNotNull(organization); + return organization.getLink().rel("scm"); + } ); }else{ //GHE - scm = new GithubEnterpriseScm((new Reachable() { - @Override - public Link getLink() { - Preconditions.checkNotNull(organization); - return organization.getLink().rel("scm"); - } - })); + scm = new GithubEnterpriseScm(( () -> { + Preconditions.checkNotNull(organization); + return organization.getLink().rel("scm"); + } )); } //pick up github credential from user's store diff --git a/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubServerContainer.java b/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubServerContainer.java index 0f5dd17deee..829a20cd52c 100644 --- a/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubServerContainer.java +++ b/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubServerContainer.java @@ -9,7 +9,6 @@ import com.google.common.collect.Ordering; import com.google.common.hash.Hashing; import hudson.model.Item; -import hudson.model.User; import hudson.security.ACL; import hudson.security.ACLContext; import io.jenkins.blueocean.commons.ErrorMessage; @@ -60,7 +59,7 @@ public class GithubServerContainer extends ScmServerEndpointContainer { throw new ServiceException.ForbiddenException("User does not have permission to create repository.", e); } - List errors = new LinkedList(); + List errors = new LinkedList<>(); // Validate name final String name = (String) request.get(GithubServer.NAME); @@ -149,12 +148,8 @@ public Link getLink() { @Override public GithubServer get(final String encodedApiUrl) { - Endpoint endpoint = Iterables.find(GitHubConfiguration.get().getEndpoints(), new Predicate() { - @Override - public boolean apply(@Nullable Endpoint input) { - return input != null && encodedApiUrl.equals(Hashing.sha256().hashString(input.getApiUri(), Charsets.UTF_8).toString()); - } - }, null); + Endpoint endpoint = Iterables.find(GitHubConfiguration.get().getEndpoints(), input -> + input != null && encodedApiUrl.equals( Hashing.sha256().hashString( input.getApiUri(), Charsets.UTF_8).toString()), null); if (endpoint == null) { throw new ServiceException.NotFoundException("not found"); } @@ -163,18 +158,10 @@ public boolean apply(@Nullable Endpoint input) { @Override public Iterator iterator() { - List endpoints = Ordering.from(new Comparator() { - @Override - public int compare(Endpoint o1, Endpoint o2) { - return ComparatorUtils.NATURAL_COMPARATOR.compare(o1.getName(), o2.getName()); - } - }).sortedCopy(GitHubConfiguration.get().getEndpoints()); - return Iterators.transform(endpoints.iterator(), new Function() { - @Override - public ScmServerEndpoint apply(Endpoint input) { - return new GithubServer(input, getLink()); - } - }); + List endpoints = Ordering.from((Comparator) (o1, o2) -> + ComparatorUtils.NATURAL_COMPARATOR.compare(o1.getName(), o2.getName())) + .sortedCopy( GitHubConfiguration.get().getEndpoints()); + return Iterators.transform( endpoints.iterator(), input -> new GithubServer(input, getLink())); } private String discardQueryString(String apiUrl) { @@ -185,11 +172,6 @@ private String discardQueryString(String apiUrl) { } private GithubServer findByName(final String name) { - return (GithubServer) Iterators.find(iterator(), new Predicate() { - @Override - public boolean apply(ScmServerEndpoint input) { - return input.getName().equals(name); - } - }, null); + return (GithubServer) Iterators.find( iterator(), input -> input.getName().equals( name), null); } } diff --git a/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/HttpRequest.java b/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/HttpRequest.java index 01d328acc86..e3c03c1dd08 100644 --- a/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/HttpRequest.java +++ b/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/HttpRequest.java @@ -13,6 +13,7 @@ import java.net.HttpURLConnection; import java.net.Proxy; import java.net.URL; +import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.concurrent.TimeUnit; import java.util.zip.GZIPInputStream; @@ -73,38 +74,40 @@ public T to(Class type) throws IOException { GithubScm.getMappingObjectWriter().writeValue(connection.getOutputStream(), body); } } - InputStreamReader r=null; - try { - int status = connection.getResponseCode(); - if (status == 304) { - return null; - } - if (status == 204 && type != null && type.isArray()) { - return type.cast(Array.newInstance(type.getComponentType(), 0)); - } - if(status == 401 || status == 403){ - throw new ServiceException.ForbiddenException("Invalid accessToken"); - } - if(status == 404){ - throw new ServiceException.NotFoundException("Not Found. Remote server sent code " + getErrorResponse(connection)); - } - if(status > 399) { - throw new ServiceException.BadRequestException(String.format("%s %s returned error: %s. Error message: %s.", method, url ,status, getErrorResponse(connection))); - } - if(!method.equals("HEAD")) { - r = new InputStreamReader(wrapStream(connection.getInputStream(), connection.getContentEncoding()), "UTF-8"); + + + int status = connection.getResponseCode(); + if (status == 304) { + return null; + } + if (status == 204 && type != null && type.isArray()) { + return type.cast(Array.newInstance(type.getComponentType(), 0)); + } + if(status == 401 || status == 403){ + throw new ServiceException.ForbiddenException("Invalid accessToken"); + } + if(status == 404){ + throw new ServiceException.NotFoundException("Not Found. Remote server sent code " + getErrorResponse(connection)); + } + if(status > 399) { + throw new ServiceException.BadRequestException(String.format("%s %s returned error: %s. Error message: %s.", method, url ,status, getErrorResponse(connection))); + } + if(!method.equals("HEAD")) { + try(InputStreamReader r = new InputStreamReader( + wrapStream( connection.getInputStream(), connection.getContentEncoding()), + StandardCharsets.UTF_8 )){ + String data = IOUtils.toString(r); - if (type != null) { + if (type != null ){ try { return GithubScm.getMappingObjectReader().forType(type).readValue(data); } catch (JsonMappingException e) { - throw new IOException("Failed to deserialize: "+e.getMessage()+"\n" + data, e); + throw new IOException("Failed to deserialize: " + e.getMessage() + "\n" + data, e); } } } - }finally { - IOUtils.closeQuietly(r); } + return null; } @@ -112,7 +115,7 @@ private String getErrorResponse(HttpURLConnection connection) throws IOException if(connection.getErrorStream() == null){ return ""; } - return IOUtils.toString(wrapStream(connection.getErrorStream(), connection.getContentEncoding())); + return IOUtils.toString(wrapStream( connection.getErrorStream(), connection.getContentEncoding())); } private boolean methodNeedsBody(){ @@ -121,7 +124,7 @@ private boolean methodNeedsBody(){ HttpURLConnection connect() throws IOException { URL apiUrl = new URL(url); - ProxyConfiguration proxyConfig = Jenkins.getInstance().proxy; + ProxyConfiguration proxyConfig = Jenkins.get().proxy; Proxy proxy = proxyConfig == null ? Proxy.NO_PROXY : proxyConfig.createProxy(apiUrl.getHost()); HttpURLConnection connect=(HttpURLConnection) apiUrl.openConnection(proxy); diff --git a/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubApiTest.java b/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubApiTest.java index 92b62448859..7efb18d612b 100644 --- a/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubApiTest.java +++ b/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubApiTest.java @@ -72,7 +72,7 @@ public void fetchExistingCredentialTokenInvalid() throws UnirestException { .get("/organizations/jenkins/scm/github/?apiUrl="+githubApiUrl) .build(Map.class); - assertTrue(r.get("message").toString().equals("Invalid accessToken")); + assertEquals("Invalid accessToken", r.get("message").toString()); } @Test diff --git a/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubEnterpriseApiTest.java b/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubEnterpriseApiTest.java index 4cfbb835725..4b548e2a98b 100644 --- a/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubEnterpriseApiTest.java +++ b/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubEnterpriseApiTest.java @@ -111,7 +111,7 @@ public void fetchExistingCredentialTokenInvalid() throws UnirestException { .get("/organizations/jenkins/scm/github-enterprise/?apiUrl="+githubApiUrl) .build(Map.class); - assertTrue(r.get("message").toString().equals("Invalid accessToken")); + assertEquals("Invalid accessToken", r.get("message").toString()); } @Test diff --git a/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubIssueTest.java b/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubIssueTest.java index 5b125cf4116..48032bdf24a 100644 --- a/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubIssueTest.java +++ b/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubIssueTest.java @@ -2,7 +2,6 @@ import com.cloudbees.hudson.plugins.folder.AbstractFolder; import com.google.common.base.Function; -import com.google.common.collect.Lists; import com.google.common.collect.Maps; import hudson.model.ItemGroup; import hudson.model.Job; @@ -23,7 +22,10 @@ import org.powermock.modules.junit4.PowerMockRunner; import javax.annotation.Nonnull; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.Map; import static org.mockito.Mockito.mock; @@ -55,9 +57,9 @@ protected MockJob(ItemGroup parent, String name) { @Test public void findIssueKeys() { - Assert.assertEquals("Find single", Lists.newArrayList("123"), GithubIssue.findIssueKeys("Closed #123")); - Assert.assertEquals("Find multiple", Lists.newArrayList("123", "143"), GithubIssue.findIssueKeys("Closed #123 and #143")); - Assert.assertEquals("Do not find alpha", Lists.newArrayList(), GithubIssue.findIssueKeys("#AAA")); + Assert.assertEquals("Find single", Collections.singletonList("123"), GithubIssue.findIssueKeys("Closed #123")); + Assert.assertEquals("Find multiple", Arrays.asList("123", "143"), GithubIssue.findIssueKeys( "Closed #123 and #143")); + Assert.assertEquals("Do not find alpha", new ArrayList(), GithubIssue.findIssueKeys( "#AAA")); } @Test @@ -82,19 +84,14 @@ public void changeSetEntry() throws Exception { when(job.getParent()).thenReturn(project); GitHubSCMSource source = new GitHubSCMSource("foo", null, null, null, "example", "repo"); - when(project.getSCMSources()).thenReturn(Lists.newArrayList(source)); + when(project.getSCMSources()).thenReturn(Collections.singletonList(source)); when(entry.getMsg()).thenReturn("Closed #123 #124"); Collection resolved = BlueIssueFactory.resolve(entry); Assert.assertEquals(2, resolved.size()); - Map issueMap = Maps.uniqueIndex(resolved, new Function() { - @Override - public String apply(BlueIssue input) { - return input.getId(); - } - }); + Map issueMap = Maps.uniqueIndex( resolved, input -> input.getId() ); BlueIssue issue123 = issueMap.get("#123"); Assert.assertEquals("https://github.com/example/repo/issues/123", issue123.getURL()); @@ -118,7 +115,7 @@ public void changeSetEntryIsNotGithub() throws Exception { when(job.getParent()).thenReturn(project); when(entry.getMsg()).thenReturn("Closed #123 #124"); - when(project.getSCMSources()).thenReturn(Lists.newArrayList(new GitSCMSource("http://example.com/repo.git"))); + when(project.getSCMSources()).thenReturn(Collections.singletonList(new GitSCMSource("http://example.com/repo.git"))); Collection resolved = BlueIssueFactory.resolve(entry); Assert.assertEquals(0, resolved.size()); diff --git a/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubMockBase.java b/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubMockBase.java index 435ac465fa8..b79447ee574 100644 --- a/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubMockBase.java +++ b/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubMockBase.java @@ -109,7 +109,7 @@ public void setup() throws Exception { .atPriority(10) .willReturn(aResponse().proxiedFrom("https://api.github.com/"))); } - + this.user = login("vivek", "Vivek Pandey", "vivek.pandey@gmail.com"); this.githubApiUrl = String.format("http://localhost:%s",githubApi.port()); this.crumb = getCrumb( j.jenkins ); @@ -185,7 +185,7 @@ protected MultiBranchProject mockMbp(String credentialId,User user, String crede when(scmSource.getRepository()).thenReturn("PR-demo"); when(mbp.getSCMSources()).thenReturn(Lists.newArrayList(scmSource)); BlueOceanCredentialsProvider.FolderPropertyImpl folderProperty = mock(BlueOceanCredentialsProvider.FolderPropertyImpl.class); - DescribableList,AbstractFolderPropertyDescriptor> mbpProperties = new DescribableList,AbstractFolderPropertyDescriptor>(mbp); + DescribableList,AbstractFolderPropertyDescriptor> mbpProperties = new DescribableList<>(mbp); mbpProperties.add(new BlueOceanCredentialsProvider.FolderPropertyImpl( user.getId(), credentialId, BlueOceanCredentialsProvider.createDomain(githubApiUrl) diff --git a/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubOrgFolderPermissionsTest.java b/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubOrgFolderPermissionsTest.java index 6e87254485b..46a9fb2dab9 100644 --- a/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubOrgFolderPermissionsTest.java +++ b/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubOrgFolderPermissionsTest.java @@ -110,7 +110,7 @@ public static class TestOrganizationFactoryImpl extends OrganizationFactoryImpl private OrganizationImpl instance; public TestOrganizationFactoryImpl() throws IOException { - Folder f = Jenkins.getInstance().createProject(Folder.class, "CustomOrg"); + Folder f = Jenkins.get().createProject(Folder.class, "CustomOrg"); instance = new OrganizationImpl("custom", f); } diff --git a/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubPipelineCreateRequestTest.java b/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubPipelineCreateRequestTest.java index 0572cf5dae5..d073320c889 100644 --- a/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubPipelineCreateRequestTest.java +++ b/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubPipelineCreateRequestTest.java @@ -44,7 +44,6 @@ import org.jenkinsci.plugins.github_branch_source.OriginPullRequestDiscoveryTrait; import org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject; import org.junit.Assert; -import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.jvnet.hudson.test.TestExtension; @@ -70,7 +69,7 @@ public class GithubPipelineCreateRequestTest extends GithubMockBase { @Test - public void createPipeline() throws UnirestException, IOException { + public void createPipeline() throws UnirestException { PowerMockito.mockStatic(GitHubWebHook.class); GitHubWebHook gitHubWebHookMock = Mockito.spy(GitHubWebHook.class); PowerMockito.when(GitHubWebHook.get()).thenReturn(gitHubWebHookMock); @@ -308,7 +307,7 @@ public void shouldFindUserStoreCredential() throws IOException { store.addCredentials(domain, credential); //create another credentials with same id in system store with different description - for(CredentialsStore s: CredentialsProvider.lookupStores(Jenkins.getInstance())){ + for(CredentialsStore s: CredentialsProvider.lookupStores(Jenkins.get())){ s.addCredentials(Domain.global(), new UsernamePasswordCredentialsImpl(CredentialsScope.USER, "github", "System GitHub Access Token", user.getId(), "12345")); } diff --git a/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubScmTest.java b/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubScmTest.java index 0385aeb9620..1ef346b809c 100644 --- a/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubScmTest.java +++ b/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubScmTest.java @@ -7,12 +7,10 @@ import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials; import com.cloudbees.plugins.credentials.domains.Domain; import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl; -import com.google.common.collect.Lists; import hudson.model.User; import hudson.security.SecurityRealm; import hudson.tasks.Mailer; import hudson.util.Secret; -import io.jenkins.blueocean.rest.Reachable; import io.jenkins.blueocean.rest.hal.Link; import io.jenkins.blueocean.rest.impl.pipeline.credential.BlueOceanDomainRequirement; import jenkins.model.Jenkins; @@ -29,7 +27,6 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.Mockito; -import org.mockito.verification.VerificationMode; import org.powermock.core.classloader.annotations.PowerMockIgnore; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; @@ -38,6 +35,9 @@ import java.net.HttpURLConnection; import java.net.Proxy; import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Collections; import static io.jenkins.blueocean.rest.impl.pipeline.scm.Scm.CREDENTIAL_ID; import static org.powermock.api.mockito.PowerMockito.*; @@ -65,10 +65,10 @@ public class GithubScmTest { public void setup() throws Exception { mockStatic(Jenkins.class); - when(Jenkins.getInstance()).thenReturn(jenkins); + when(Jenkins.get()).thenReturn(jenkins); when(Jenkins.getInstanceOrNull()).thenReturn(jenkins); when(Jenkins.getAuthentication()).thenReturn(authentication); - GrantedAuthority[] grantedAuthorities = Lists.newArrayList(SecurityRealm.AUTHENTICATED_AUTHORITY).toArray(new GrantedAuthority[1]); + GrantedAuthority[] grantedAuthorities = new GrantedAuthority[]{SecurityRealm.AUTHENTICATED_AUTHORITY}; Mockito.when(authentication.getAuthorities()).thenReturn(grantedAuthorities); Mockito.when(authentication.getPrincipal()).thenReturn("joe"); @@ -112,12 +112,7 @@ protected void validateAndCreate(String accessToken) throws Exception { Mailer.UserProperty userProperty = mock(Mailer.UserProperty.class); when(userProperty.getAddress()).thenReturn("joe@example.com"); JSONObject req = new JSONObject().element("accessToken", accessToken); - GithubScm githubScm = new GithubScm(new Reachable() { - @Override - public Link getLink() { - return new Link("/blue/organizations/jenkins/scm/"); - } - }); + GithubScm githubScm = new GithubScm(() -> new Link( "/blue/organizations/jenkins/scm/")); mockCredentials("joe", accessToken, githubScm.getId(), GithubScm.DOMAIN_NAME); @@ -143,7 +138,7 @@ public Link getLink() { StaplerRequest request = mock(StaplerRequest.class); when(Stapler.getCurrentRequest()).thenReturn(request); - when(HttpRequest.getInputStream(httpURLConnectionMock)).thenReturn(new ByteArrayInputStream(guser.getBytes("UTF-8"))); + when(HttpRequest.getInputStream(httpURLConnectionMock)).thenReturn(new ByteArrayInputStream(guser.getBytes(StandardCharsets.UTF_8))); githubScm.validateAndCreate(req); @@ -185,9 +180,10 @@ void mockCredentials(String userId, String accessToken, String credentialId, Str when(CredentialsProvider.class, "lookupCredentials", StandardUsernamePasswordCredentials.class, jenkins, authentication, blueOceanDomainRequirement) - .thenReturn(Lists.newArrayList(credentials)); + .thenReturn(Collections.singletonList(credentials)); - when(CredentialsMatchers.class, "firstOrNull", Lists.newArrayList(credentials), credentialsMatcher).thenReturn(credentials); + when(CredentialsMatchers.class, "firstOrNull", + Collections.singletonList(credentials), credentialsMatcher).thenReturn(credentials); when(CredentialsMatchers.allOf(credentialsMatcher)).thenReturn(credentialsMatcher); @@ -201,8 +197,10 @@ void mockCredentials(String userId, String accessToken, String credentialId, Str when(credentialsStore.hasPermission(CredentialsProvider.UPDATE)).thenReturn(true); when(credentialsStore.getDomainByName(domainName)).thenReturn(domain); - when(CredentialsProvider.class, "lookupStores", user).thenReturn(Lists.newArrayList(credentialsStore)); + when(CredentialsProvider.class, "lookupStores", user). + thenReturn(Collections.singletonList(credentialsStore)); + when(credentialsStore.addCredentials(domain, credentials)).thenReturn(true); when(credentialsStore.updateCredentials(domain, credentials, credentials)).thenReturn(true); } } diff --git a/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubServerTest.java b/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubServerTest.java index a67976dfd60..8138c1f62c0 100644 --- a/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubServerTest.java +++ b/blueocean-github-pipeline/src/test/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubServerTest.java @@ -10,7 +10,6 @@ import hudson.model.User; import hudson.security.GlobalMatrixAuthorizationStrategy; import hudson.security.HudsonPrivateSecurityRealm; -import hudson.security.Permission; import io.jenkins.blueocean.rest.impl.pipeline.PipelineBaseTest; import jenkins.model.Jenkins; import org.junit.Assert; diff --git a/blueocean-pipeline-api-impl/src/test/java/io/jenkins/blueocean/rest/impl/pipeline/MultiBranchTest.java b/blueocean-pipeline-api-impl/src/test/java/io/jenkins/blueocean/rest/impl/pipeline/MultiBranchTest.java index fb040f10182..0d7fed27ef1 100644 --- a/blueocean-pipeline-api-impl/src/test/java/io/jenkins/blueocean/rest/impl/pipeline/MultiBranchTest.java +++ b/blueocean-pipeline-api-impl/src/test/java/io/jenkins/blueocean/rest/impl/pipeline/MultiBranchTest.java @@ -1082,6 +1082,7 @@ public void getPipelineJobRunsNoBranches() throws Exception { @Test public void testMultiBranchPipelineQueueContainer() throws Exception { + j.jenkins.setQuietPeriod(0); WorkflowMultiBranchProject mp = j.jenkins.createProject(WorkflowMultiBranchProject.class, "p"); sampleRepo1.init(); sampleRepo1.write("Jenkinsfile", "stage 'build'\n " + "node {echo 'Building'}\n" + diff --git a/blueocean-pipeline-editor/pom.xml b/blueocean-pipeline-editor/pom.xml index 2c312237631..7a667ff16ce 100644 --- a/blueocean-pipeline-editor/pom.xml +++ b/blueocean-pipeline-editor/pom.xml @@ -62,10 +62,6 @@ org.jenkinsci.plugins pipeline-model-definition - - org.jenkins-ci.plugins - docker-workflow - org.jenkins-ci.plugins sonar diff --git a/blueocean-pipeline-editor/src/test/java/io/blueocean/rest/pipeline/editor/PipelineMetadataServiceTest.java b/blueocean-pipeline-editor/src/test/java/io/blueocean/rest/pipeline/editor/PipelineMetadataServiceTest.java index 76f91c3a2ee..97e72b7d0ab 100644 --- a/blueocean-pipeline-editor/src/test/java/io/blueocean/rest/pipeline/editor/PipelineMetadataServiceTest.java +++ b/blueocean-pipeline-editor/src/test/java/io/blueocean/rest/pipeline/editor/PipelineMetadataServiceTest.java @@ -4,7 +4,7 @@ import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.hamcrest.Matcher; -import org.jenkinsci.plugins.docker.workflow.declarative.DockerPipeline; +import org.jenkinsci.plugins.pipeline.modeldefinition.agent.impl.Label; import org.junit.Rule; import org.junit.Test; import org.jvnet.hudson.test.JenkinsRule; @@ -57,7 +57,7 @@ public void declarativeAgents() throws Exception { ExportedDescribableModel m = null; for (ExportedDescribableModel a : agents) { - if (a.getType().equals(DockerPipeline.class.getName())) { + if (a.getType().endsWith(Label.class.getName())) { m = a; } } diff --git a/blueocean-pipeline-scm-api/pom.xml b/blueocean-pipeline-scm-api/pom.xml index c779115dca6..3f8a2736869 100644 --- a/blueocean-pipeline-scm-api/pom.xml +++ b/blueocean-pipeline-scm-api/pom.xml @@ -31,10 +31,6 @@ org.jenkins-ci.plugins credentials - - commons-lang - commons-lang - org.jenkins-ci.plugins pubsub-light diff --git a/blueocean-pipeline-scm-api/src/main/java/io/jenkins/blueocean/credential/CredentialsUtils.java b/blueocean-pipeline-scm-api/src/main/java/io/jenkins/blueocean/credential/CredentialsUtils.java index b74d093f817..dba56417c63 100644 --- a/blueocean-pipeline-scm-api/src/main/java/io/jenkins/blueocean/credential/CredentialsUtils.java +++ b/blueocean-pipeline-scm-api/src/main/java/io/jenkins/blueocean/credential/CredentialsUtils.java @@ -111,7 +111,7 @@ public boolean apply(@Nullable Credentials input) { return CredentialsMatchers.firstOrNull( CredentialsProvider.lookupCredentials( type, - Jenkins.getInstance(), + Jenkins.get(), Jenkins.getAuthentication(), domainRequirements), CredentialsMatchers.allOf(CredentialsMatchers.withId(credentialId)) diff --git a/blueocean-rest-impl/pom.xml b/blueocean-rest-impl/pom.xml index f475db7f038..c217c29db4b 100644 --- a/blueocean-rest-impl/pom.xml +++ b/blueocean-rest-impl/pom.xml @@ -92,8 +92,14 @@ - ua_parser - ua-parser + com.github.ua-parser + uap-java + + + org.yaml + snakeyaml + + diff --git a/blueocean-rest-impl/src/main/java/io/jenkins/blueocean/service/embedded/analytics/BrowserAndOperatingSystemAnalyticsProperties.java b/blueocean-rest-impl/src/main/java/io/jenkins/blueocean/service/embedded/analytics/BrowserAndOperatingSystemAnalyticsProperties.java index 95c19444d45..30a127f6c79 100644 --- a/blueocean-rest-impl/src/main/java/io/jenkins/blueocean/service/embedded/analytics/BrowserAndOperatingSystemAnalyticsProperties.java +++ b/blueocean-rest-impl/src/main/java/io/jenkins/blueocean/service/embedded/analytics/BrowserAndOperatingSystemAnalyticsProperties.java @@ -19,20 +19,7 @@ @Extension public class BrowserAndOperatingSystemAnalyticsProperties extends AdditionalAnalyticsProperties { - private static final Logger LOGGER = Logger.getLogger(BrowserAndOperatingSystemAnalyticsProperties.class.getName()); - - private static final Parser PARSER; - - static { - Parser parser; - try { - parser = new Parser(); - } catch (IOException e) { - parser = null; - LOGGER.log(Level.SEVERE, "There was a problem loading the UAParser. Browser detection is unavailable.", e); - } - PARSER = parser; - } + private static final Parser PARSER = new Parser(); @Override public Map properties(TrackRequest req) { diff --git a/blueocean-rest-impl/src/main/java/io/jenkins/blueocean/service/embedded/rest/PipelineContainerImpl.java b/blueocean-rest-impl/src/main/java/io/jenkins/blueocean/service/embedded/rest/PipelineContainerImpl.java index c0887b3f934..4dc104909e7 100644 --- a/blueocean-rest-impl/src/main/java/io/jenkins/blueocean/service/embedded/rest/PipelineContainerImpl.java +++ b/blueocean-rest-impl/src/main/java/io/jenkins/blueocean/service/embedded/rest/PipelineContainerImpl.java @@ -1,25 +1,16 @@ package io.jenkins.blueocean.service.embedded.rest; -import com.google.common.base.Predicate; -import com.google.common.collect.Collections2; import hudson.model.Item; import hudson.model.ItemGroup; -import hudson.model.TopLevelItem; -import hudson.security.FullControlOnceLoggedInAuthorizationStrategy; import io.jenkins.blueocean.commons.ServiceException; import io.jenkins.blueocean.rest.Reachable; import io.jenkins.blueocean.rest.factory.BluePipelineFactory; -import io.jenkins.blueocean.rest.factory.organization.OrganizationFactory; import io.jenkins.blueocean.rest.hal.Link; import io.jenkins.blueocean.rest.model.BlueOrganization; import io.jenkins.blueocean.rest.model.BluePipeline; import io.jenkins.blueocean.rest.model.BluePipelineContainer; -import jenkins.model.Jenkins; -import org.acegisecurity.AccessDeniedException; import javax.annotation.Nonnull; -import java.io.File; -import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; @@ -34,7 +25,7 @@ public class PipelineContainerImpl extends BluePipelineContainer { public PipelineContainerImpl(BlueOrganization organization, ItemGroup itemGroup, Reachable parent) { super(organization); - this.itemGroup = itemGroup instanceof Jenkins ? new PermissionFilteredItemGroup((Jenkins) itemGroup) : itemGroup; + this.itemGroup = itemGroup; this.self = parent.getLink().rel("pipelines"); } @Override @@ -70,82 +61,4 @@ public Iterator getPipelines(Collection items){ } return pipelines.iterator(); } - - /** - * Jenkins.getItems will return all items regardless of {@link FullControlOnceLoggedInAuthorizationStrategy#isAllowAnonymousRead()} - * This implementation filters out {@link Item}s that do not have {@link Item#READ} which maintains backward compatibility - * for versions without a fix for SECURITY-380 - */ - static class PermissionFilteredItemGroup implements ItemGroup { - private final Jenkins jenkins; - - public PermissionFilteredItemGroup(Jenkins jenkins) { - this.jenkins = jenkins; - } - - @Override - public TopLevelItem getItem(String name) throws AccessDeniedException { - return jenkins.getItem(name); - } - - @Override - public Collection getItems() { - return Collections2.filter(this.jenkins.getItems(), new Predicate() { - @Override - public boolean apply(TopLevelItem input) { - return input.hasPermission(Item.READ); - } - }); - } - - @Override - public String getFullName() { - throw new UnsupportedOperationException(); - } - - @Override - public String getFullDisplayName() { - throw new UnsupportedOperationException(); - } - - @Override - public String getUrl() { - throw new UnsupportedOperationException(); - } - - @Override - public String getUrlChildPrefix() { - throw new UnsupportedOperationException(); - } - - @Override - public File getRootDirFor(TopLevelItem child) { - throw new UnsupportedOperationException(); - } - - @Override - public void onRenamed(TopLevelItem item, String oldName, String newName) throws IOException { - throw new UnsupportedOperationException(); - } - - @Override - public void onDeleted(TopLevelItem item) throws IOException { - throw new UnsupportedOperationException(); - } - - @Override - public String getDisplayName() { - throw new UnsupportedOperationException(); - } - - @Override - public File getRootDir() { - throw new UnsupportedOperationException(); - } - - @Override - public void save() throws IOException { - throw new UnsupportedOperationException(); - } - } } diff --git a/blueocean/pom.xml b/blueocean/pom.xml index a2266150775..3563812bdcc 100644 --- a/blueocean/pom.xml +++ b/blueocean/pom.xml @@ -106,12 +106,14 @@ ${project.groupId} blueocean-jira + true ${project.groupId} blueocean-executor-info + true @@ -147,6 +149,12 @@ com.mashape.unirest unirest-java test + + + org.json + json + + diff --git a/pom.xml b/pom.xml index 7d66440ed47..51f3e1c540e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 4.9 + 4.16 @@ -25,11 +25,12 @@ - 1.24.2 + 1.24.6 -SNAPSHOT jenkinsci/blueocean-plugin 8 - 2.176.4 + + 2.222.4 javadoc-no-fork 1.7.5 10.13.0 @@ -44,9 +45,6 @@ 0.00 runtime true - 3.3 - 1.6.0 - 2.6.3 @@ -162,6 +160,41 @@ + + org.slf4j + slf4j-api + provided + + + org.slf4j + jcl-over-slf4j + provided + + + org.slf4j + log4j-over-slf4j + provided + + + org.slf4j + slf4j-jdk14 + provided + + + commons-io + commons-io + provided + + + commons-codec + commons-codec + provided + + + commons-lang + commons-lang + provided + org.mockito mockito-core @@ -196,6 +229,12 @@ com.mashape.unirest unirest-java test + + + org.json + json + + @@ -228,8 +267,8 @@ io.jenkins.tools.bom - bom-2.176.x - 11 + bom-2.222.x + 26 import pom @@ -359,118 +398,11 @@ ${project.version} - - org.jenkins-ci.plugins - ssh-credentials - 1.17.3 - - - - - - - - - org.jenkins-ci.plugins - git - 4.2.2 - - - org.jenkins-ci.plugins - git - 4.2.2 - tests - test - - - - - org.jenkinsci.plugins - pipeline-model-definition - ${pipeline-model-definition.version} - - - org.jenkins-ci.plugins - git-client - - - - - org.jenkinsci.plugins - pipeline-stage-tags-metadata - ${pipeline-model-definition.version} - - - org.jenkinsci.plugins - pipeline-model-api - ${pipeline-model-definition.version} - - - org.jenkinsci.plugins - pipeline-model-extensions - ${pipeline-model-definition.version} - - - org.jenkins-ci.plugins.workflow - workflow-job - 2.33 - org.jenkins-ci.plugins pipeline-graph-analysis 1.10 - - org.jenkins-ci.plugins.workflow - workflow-multibranch - 2.20 - - - org.jenkins-ci.plugins.workflow - workflow-step-api - 2.22 - - - org.jenkins-ci.plugins.workflow - workflow-durable-task-step - 2.31 - - - org.jenkins-ci.plugins.workflow - workflow-support - ${workflow-support.version} - - - org.jenkins-ci.plugins.workflow - workflow-support - ${workflow-support.version} - tests - - - org.jenkins-ci.plugins.workflow - workflow-basic-steps - 2.18 - - - org.jenkins-ci.plugins.workflow - workflow-scm-step - 2.11 - - - org.jenkins-ci.plugins - pipeline-stage-step - 2.3 - - - org.jenkins-ci.plugins - pipeline-input-step - 2.8 - - - org.jenkins-ci.plugins - pipeline-build-step - 2.7 - org.jenkins-ci.plugins @@ -478,31 +410,7 @@ 1.3.1 - - - org.jenkins-ci.plugins - scm-api - ${scm-api-plugin.version} - - - org.jenkins-ci.plugins - branch-api - 2.0.20 - - - - org.jenkins-ci - annotation-indexer - - - - - - org.jenkins-ci.plugins - docker-workflow - 1.23 - org.jenkins-ci.plugins github-branch-source @@ -567,11 +475,6 @@ - - org.jenkins-ci.plugins - cloudbees-folder - 6.9 - org.jenkins-ci.main jenkins-test-harness-tools @@ -584,11 +487,6 @@ ${jenkins-test-harness.version} test - - org.jenkins-ci.plugins - structs - 1.20 - org.jenkins-ci.plugins pubsub-light @@ -597,19 +495,8 @@ org.jenkins-ci.plugins sse-gateway - 1.21 - - - org.jenkins-ci.plugins - variant - 1.1 - - - org.jenkins-ci.plugins - htmlpublisher - 1.14 + 1.24 - org.jenkins-ci.plugins github-api @@ -625,41 +512,16 @@ okhttp 3.12.12 - - org.jenkins-ci.plugins - jackson2-api - 2.10.2 - - - commons-io - commons-io - 2.6 - - - commons-codec - commons-codec - 1.10 - - - commons-lang - commons-lang - 2.6 - org.apache.commons commons-lang3 - 3.9 + 3.11 oro oro 2.0.8 - - org.jenkins-ci.plugins - display-url-api - 2.3.1 - org.bitbucket.b_c jose4j @@ -705,9 +567,9 @@ - ua_parser - ua-parser - 1.3.0 + com.github.ua-parser + uap-java + 1.5.0 @@ -717,23 +579,6 @@ - - - org.jenkins-ci.plugins - matrix-auth - 1.7 - test - - - - org.jenkins-ci.plugins.icon-shim - icon-set - - - - org.jenkins-ci.plugins @@ -845,13 +690,6 @@ org.eclipse.sisu.plexus 0.1.0 - - org.jenkins-ci.plugins - scm-api - tests - ${scm-api-plugin.version} - test - com.damnhandy handy-uri-templates