Skip to content

Commit

Permalink
Merge pull request #235 from rahulsom/support-jee9
Browse files Browse the repository at this point in the history
  • Loading branch information
sghill authored Jan 14, 2025
2 parents 8868c82 + b1908ca commit 7387a74
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
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

0 comments on commit 7387a74

Please sign in to comment.