Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support Jenkins >= 2.475 #235

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,13 @@ private static DependencyFactory findbugsFor(VersionNumber version, boolean befo
}

private static DependencyFactory servletFor(VersionNumber version) {
boolean isBefore2 = version.isOlderThan(new VersionNumber("2.0"));
String notation = isBefore2 ? "javax.servlet:servlet-api:2.4" : "javax.servlet:javax.servlet-api:3.1.0";
return new MavenDependency(notation);
if (version.isOlderThan(new VersionNumber("2.0"))) {
return new MavenDependency("javax.servlet:servlet-api:2.4");
} else if (version.isOlderThan(new VersionNumber("2.475"))) {
return new MavenDependency("javax.servlet:javax.servlet-api:3.1.0");
} else {
return new MavenDependency("jakarta.servlet:jakarta.servlet-api:5.0.0");
}
}

private static DependencyFactory testHarnessFor(VersionNumber version) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class JenkinsVersionIntegrationSpec extends IntegrationSpec {
'findbugs:annotations:1.0.0' : NOWHERE,
'javax.servlet:servlet-api:2.4' : NOWHERE,
'javax.servlet:javax.servlet-api:3.1.0' : COMPILE_ONLY,
'jakarta.servlet:jakarta.servlet-api:5.0.0' : NOWHERE,
'org.jenkins-ci.main:jenkins-test-harness:2112.ve584e0edc63b_': TEST_IMPLEMENTATION_ONLY,
'org.jenkins-ci.main:ui-samples-plugin:2.0' : NOWHERE,
'junit:junit-dep:4.10' : NOWHERE,
Expand All @@ -150,6 +151,7 @@ class JenkinsVersionIntegrationSpec extends IntegrationSpec {
'findbugs:annotations:1.0.0' : NOWHERE,
'javax.servlet:servlet-api:2.4' : NOWHERE,
'javax.servlet:javax.servlet-api:3.1.0' : COMPILE_ONLY,
'jakarta.servlet:jakarta.servlet-api:5.0.0' : NOWHERE,
'org.jenkins-ci.main:jenkins-test-harness:2112.ve584e0edc63b_': TEST_IMPLEMENTATION_ONLY,
'org.jenkins-ci.main:ui-samples-plugin:2.0' : NOWHERE,
'junit:junit-dep:4.10' : NOWHERE,
Expand Down Expand Up @@ -190,6 +192,7 @@ class JenkinsVersionIntegrationSpec extends IntegrationSpec {
'findbugs:annotations:1.0.0' : NOWHERE,
'javax.servlet:servlet-api:2.4' : COMPILE_ONLY,
'javax.servlet:javax.servlet-api:3.1.0' : NOWHERE,
'jakarta.servlet:jakarta.servlet-api:5.0.0' : NOWHERE,
'org.jenkins-ci.main:jenkins-test-harness:2.0': TEST_IMPLEMENTATION_ONLY,
'org.jenkins-ci.main:ui-samples-plugin:2.0' : NOWHERE,
'junit:junit-dep:4.10' : NOWHERE,
Expand All @@ -200,6 +203,7 @@ class JenkinsVersionIntegrationSpec extends IntegrationSpec {
'findbugs:annotations:1.0.0' : NOWHERE,
'javax.servlet:servlet-api:2.4' : COMPILE_ONLY,
'javax.servlet:javax.servlet-api:3.1.0' : NOWHERE,
'jakarta.servlet:jakarta.servlet-api:5.0.0' : NOWHERE,
'org.jenkins-ci.main:jenkins-test-harness:2.0': TEST_IMPLEMENTATION_ONLY,
'org.jenkins-ci.main:ui-samples-plugin:2.0' : NOWHERE,
'junit:junit-dep:4.10' : NOWHERE,
Expand All @@ -210,6 +214,7 @@ class JenkinsVersionIntegrationSpec extends IntegrationSpec {
'findbugs:annotations:1.0.0' : NOWHERE,
'javax.servlet:servlet-api:2.4' : COMPILE_ONLY,
'javax.servlet:javax.servlet-api:3.1.0' : NOWHERE,
'jakarta.servlet:jakarta.servlet-api:5.0.0' : NOWHERE,
'org.jenkins-ci.main:jenkins-test-harness:1.644': TEST_IMPLEMENTATION_ONLY,
'org.jenkins-ci.main:ui-samples-plugin:2.0' : NOWHERE,
'junit:junit-dep:4.10' : NOWHERE,
Expand All @@ -220,6 +225,7 @@ class JenkinsVersionIntegrationSpec extends IntegrationSpec {
'findbugs:annotations:1.0.0' : NOWHERE,
'javax.servlet:servlet-api:2.4' : COMPILE_ONLY,
'javax.servlet:javax.servlet-api:3.1.0' : NOWHERE,
'jakarta.servlet:jakarta.servlet-api:5.0.0' : NOWHERE,
'org.jenkins-ci.main:jenkins-test-harness:1.618': TEST_IMPLEMENTATION_ONLY,
'org.jenkins-ci.main:ui-samples-plugin:2.0' : NOWHERE,
'junit:junit-dep:4.10' : NOWHERE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import spock.lang.Unroll

class DependencyLookupSpec extends Specification {
private static final MavenDependency JCIP_ANNOTATIONS = new MavenDependency('net.jcip:jcip-annotations:1.0')
private static final MavenDependency SERVLET_5_0 = new MavenDependency('jakarta.servlet:jakarta.servlet-api:5.0.0')
private static final MavenDependency SERVLET_3_1 = new MavenDependency('javax.servlet:javax.servlet-api:3.1.0')
private static final MavenDependency SERVLET_2_4 = new MavenDependency('javax.servlet:servlet-api:2.4')
private static final MavenDependency GOOGLE_FINDBUGS = new MavenDependency('com.google.code.findbugs:annotations:3.0.0')
Expand All @@ -28,6 +29,8 @@ class DependencyLookupSpec extends Specification {
'2.222.3' | [jenkinsBom('2.222.3'), jenkinsCore('2.222.3'), SERVLET_3_1] as Set
'2.361.2-rc32710.c1a_5e8c179f6' | [jenkinsBom('2.361.2-rc32710.c1a_5e8c179f6'), jenkinsCore('2.361.2-rc32710.c1a_5e8c179f6'), SERVLET_3_1] as Set
'2.369-rc32854.076293e36922' | [jenkinsBom('2.369-rc32854.076293e36922'), jenkinsCore('2.369-rc32854.076293e36922'), SERVLET_3_1] as Set
'2.475' | [jenkinsBom('2.475'), jenkinsCore('2.475'), SERVLET_5_0] as Set
'2.479.2' | [jenkinsBom('2.479.2'), jenkinsCore('2.479.2'), SERVLET_5_0] as Set
}

@Unroll
Expand Down
Loading