Merge pull request #1386 from DataDog/tyler/muzzle-add-jcenter
Add jCenter as a muzzle repository to catch things that are different from Maven Central
This commit is contained in:
commit
1c141d6f5c
|
@ -37,8 +37,15 @@ class MuzzlePlugin implements Plugin<Project> {
|
|||
private static final AtomicReference<ClassLoader> TOOLING_LOADER = new AtomicReference<>()
|
||||
static {
|
||||
RemoteRepository central = new RemoteRepository.Builder("central", "default", "https://repo1.maven.org/maven2/").build()
|
||||
RemoteRepository sonatype = new RemoteRepository.Builder("sonatype", "default", "https://oss.sonatype.org/content/repositories/releases/").build()
|
||||
RemoteRepository jcenter = new RemoteRepository.Builder("jcenter", "default", "https://jcenter.bintray.com/").build()
|
||||
RemoteRepository spring = new RemoteRepository.Builder("spring", "default", "https://repo.spring.io/libs-release/").build()
|
||||
RemoteRepository jboss = new RemoteRepository.Builder("jboss", "default", "https://repository.jboss.org/nexus/content/repositories/releases/").build()
|
||||
RemoteRepository typesafe = new RemoteRepository.Builder("typesafe", "default", "https://repo.typesafe.com/typesafe/releases").build()
|
||||
MUZZLE_REPOS = new ArrayList<RemoteRepository>(Arrays.asList(central, typesafe))
|
||||
RemoteRepository akka = new RemoteRepository.Builder("akka", "default", "https://dl.bintray.com/akka/maven/").build()
|
||||
RemoteRepository atlassian = new RemoteRepository.Builder("atlassian", "default", "https://maven.atlassian.com/content/repositories/atlassian-public/").build()
|
||||
// MUZZLE_REPOS = Arrays.asList(central, sonatype, jcenter, spring, jboss, typesafe, akka, atlassian)
|
||||
MUZZLE_REPOS = Arrays.asList(central, jcenter, typesafe)
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -205,7 +212,10 @@ class MuzzlePlugin implements Plugin<Project> {
|
|||
rangeRequest.setArtifact(directiveArtifact)
|
||||
final VersionRangeResult rangeResult = system.resolveVersionRange(session, rangeRequest)
|
||||
|
||||
final List<Artifact> allVersionArtifacts = filterVersion(rangeResult.versions).collect { version ->
|
||||
// println "Range Request: " + rangeRequest
|
||||
// println "Range Result: " + rangeResult
|
||||
|
||||
final List<Artifact> allVersionArtifacts = filterVersion(rangeResult.versions, muzzleDirective.skipVersions).collect { version ->
|
||||
new DefaultArtifact(muzzleDirective.group, muzzleDirective.module, "jar", version.toString())
|
||||
}
|
||||
|
||||
|
@ -236,7 +246,7 @@ class MuzzlePlugin implements Plugin<Project> {
|
|||
rangeRequest.setArtifact(directiveArtifact)
|
||||
final VersionRangeResult rangeResult = system.resolveVersionRange(session, rangeRequest)
|
||||
|
||||
filterVersion(allRangeResult.versions).collect { version ->
|
||||
filterVersion(allRangeResult.versions, muzzleDirective.skipVersions).collect { version ->
|
||||
if (!rangeResult.versions.contains(version)) {
|
||||
final MuzzleDirective inverseDirective = new MuzzleDirective()
|
||||
inverseDirective.group = muzzleDirective.group
|
||||
|
@ -350,7 +360,7 @@ class MuzzlePlugin implements Plugin<Project> {
|
|||
/**
|
||||
* Filter out snapshot-type builds from versions list.
|
||||
*/
|
||||
private static filterVersion(List<Version> list) {
|
||||
private static filterVersion(List<Version> list, Set<String> skipVersions) {
|
||||
list.removeIf {
|
||||
def version = it.toString().toLowerCase()
|
||||
return version.contains("rc") ||
|
||||
|
@ -361,7 +371,10 @@ class MuzzlePlugin implements Plugin<Project> {
|
|||
version.contains(".m") ||
|
||||
version.contains("-m") ||
|
||||
version.contains("-dev") ||
|
||||
version.contains("-ea") ||
|
||||
version.contains("-atlassian-") ||
|
||||
version.contains("public_draft") ||
|
||||
skipVersions.contains(version) ||
|
||||
version.matches(GIT_SHA_PATTERN)
|
||||
}
|
||||
return list
|
||||
|
@ -387,6 +400,7 @@ class MuzzleDirective {
|
|||
String group
|
||||
String module
|
||||
String versions
|
||||
Set<String> skipVersions = new HashSet<>()
|
||||
List<String> additionalDependencies = new ArrayList<>()
|
||||
boolean assertPass
|
||||
boolean assertInverse = false
|
||||
|
@ -442,6 +456,7 @@ class MuzzleExtension {
|
|||
void pass(Action<? super MuzzleDirective> action) {
|
||||
final MuzzleDirective pass = objectFactory.newInstance(MuzzleDirective)
|
||||
action.execute(pass)
|
||||
postConstruct(pass)
|
||||
pass.assertPass = true
|
||||
directives.add(pass)
|
||||
}
|
||||
|
@ -449,7 +464,15 @@ class MuzzleExtension {
|
|||
void fail(Action<? super MuzzleDirective> action) {
|
||||
final MuzzleDirective fail = objectFactory.newInstance(MuzzleDirective)
|
||||
action.execute(fail)
|
||||
postConstruct(fail)
|
||||
fail.assertPass = false
|
||||
directives.add(fail)
|
||||
}
|
||||
|
||||
private postConstruct(MuzzleDirective directive) {
|
||||
// Make skipVersions case insensitive.
|
||||
directive.skipVersions = directive.skipVersions.collect {
|
||||
it.toLowerCase()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ muzzle {
|
|||
group = "commons-httpclient"
|
||||
module = "commons-httpclient"
|
||||
versions = "[,4.0)"
|
||||
skipVersions += '3.1-jenkins-1'
|
||||
}
|
||||
pass {
|
||||
group = "org.apache.httpcomponents"
|
||||
|
|
|
@ -3,6 +3,7 @@ muzzle {
|
|||
group = "commons-httpclient"
|
||||
module = "commons-httpclient"
|
||||
versions = "[2.0,]"
|
||||
skipVersions += "3.1-jenkins-1" // odd version in jcenter
|
||||
assertInverse = true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,9 +45,8 @@ dependencies {
|
|||
testCompile group: 'org.elasticsearch.plugin', name: 'transport-netty4-client', version: '6.4.0'
|
||||
|
||||
// TODO: The tests are incompatible with 7.x. The instrumentation may be as well.
|
||||
// FIXME: Lock to specific version due to bad deploy rollout.
|
||||
latestDepTestCompile group: 'org.elasticsearch.client', name: 'elasticsearch-rest-client', version: '6.8.3'
|
||||
latestDepTestCompile group: 'org.elasticsearch.client', name: 'transport', version: '6.8.3'
|
||||
latestDepTestCompile group: 'org.elasticsearch', name: 'elasticsearch', version: '6.8.3'
|
||||
latestDepTestCompile group: 'org.elasticsearch.plugin', name: 'transport-netty4-client', version: '6.8.3'
|
||||
latestDepTestCompile group: 'org.elasticsearch.client', name: 'elasticsearch-rest-client', version: '6.+'
|
||||
latestDepTestCompile group: 'org.elasticsearch.client', name: 'transport', version: '6.+'
|
||||
latestDepTestCompile group: 'org.elasticsearch', name: 'elasticsearch', version: '6.+'
|
||||
latestDepTestCompile group: 'org.elasticsearch.plugin', name: 'transport-netty4-client', version: '6.+'
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@ muzzle {
|
|||
group = "org.elasticsearch.client"
|
||||
module = "transport"
|
||||
versions = "[5.3.0,6.0.0)"
|
||||
// Work around for a bad release of 6.8.4
|
||||
// assertInverse = true
|
||||
assertInverse = true
|
||||
}
|
||||
pass {
|
||||
group = "org.elasticsearch"
|
||||
|
|
|
@ -8,8 +8,7 @@ muzzle {
|
|||
group = "org.elasticsearch.client"
|
||||
module = "transport"
|
||||
versions = "[5.0.0,5.3.0)"
|
||||
// Work around for a bad release of 6.8.4
|
||||
// assertInverse = true
|
||||
assertInverse = true
|
||||
}
|
||||
pass {
|
||||
group = "org.elasticsearch"
|
||||
|
|
|
@ -7,14 +7,13 @@ muzzle {
|
|||
pass {
|
||||
group = "org.elasticsearch.client"
|
||||
module = "transport"
|
||||
versions = "[6.0.0,6.8.4)"
|
||||
// Work around for a bad release of 6.8.4
|
||||
// assertInverse = true
|
||||
versions = "[6.0.0,]"
|
||||
assertInverse = true
|
||||
}
|
||||
pass {
|
||||
group = "org.elasticsearch"
|
||||
module = "elasticsearch"
|
||||
versions = "[6.0.0,)"
|
||||
versions = "[6.0.0,]"
|
||||
assertInverse = true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,9 @@ muzzle {
|
|||
pass {
|
||||
group = "com.sun.jersey"
|
||||
module = "jersey-client"
|
||||
versions = "[,]"
|
||||
versions = "[1.1,]"
|
||||
skipVersions += ['1.0.3-atlassian-1-logpatch', '1.8-atlassian-6']
|
||||
assertInverse = true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,45 +14,27 @@ testSets {
|
|||
}
|
||||
|
||||
muzzle {
|
||||
// 2.0.5 was a bad release
|
||||
|
||||
fail {
|
||||
group = 'com.typesafe.play'
|
||||
module = 'play-ahc-ws-standalone_2.11'
|
||||
versions = '[,2.0.4]'
|
||||
}
|
||||
fail {
|
||||
group = 'com.typesafe.play'
|
||||
module = 'play-ahc-ws-standalone_2.11'
|
||||
versions = '[2.0.6,)'
|
||||
versions = '[,]'
|
||||
}
|
||||
|
||||
fail {
|
||||
group = 'com.typesafe.play'
|
||||
module = 'play-ahc-ws-standalone_2.12'
|
||||
versions = '[,2.0.4]'
|
||||
}
|
||||
fail {
|
||||
group = 'com.typesafe.play'
|
||||
module = 'play-ahc-ws-standalone_2.12'
|
||||
versions = '[2.0.6,2.1.0)'
|
||||
}
|
||||
pass {
|
||||
group = 'com.typesafe.play'
|
||||
module = 'play-ahc-ws-standalone_2.12'
|
||||
versions = '[2.1.0,]'
|
||||
skipVersions += '2.0.5' // Bad release
|
||||
assertInverse = true
|
||||
}
|
||||
|
||||
// No Scala 2.13 versions below 2.0.6 exist
|
||||
fail {
|
||||
group = 'com.typesafe.play'
|
||||
module = 'play-ahc-ws-standalone_2.13'
|
||||
versions = '[2.0.6,2.1.0)'
|
||||
}
|
||||
pass {
|
||||
group = 'com.typesafe.play'
|
||||
module = 'play-ahc-ws-standalone_2.13'
|
||||
versions = '[2.1.0,]'
|
||||
skipVersions += '2.0.5' // Bad release
|
||||
assertInverse = true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,38 +14,20 @@ testSets {
|
|||
}
|
||||
|
||||
muzzle {
|
||||
// 2.0.5 was a bad release
|
||||
|
||||
fail {
|
||||
group = 'com.typesafe.play'
|
||||
module = 'play-ahc-ws-standalone_2.11'
|
||||
versions = '[,2.0.0)'
|
||||
}
|
||||
pass {
|
||||
group = 'com.typesafe.play'
|
||||
module = 'play-ahc-ws-standalone_2.11'
|
||||
versions = '[2.0.0,2.0.4]'
|
||||
}
|
||||
pass {
|
||||
group = 'com.typesafe.play'
|
||||
module = 'play-ahc-ws-standalone_2.11'
|
||||
versions = '[2.0.6,]'
|
||||
versions = '[2.0.0,]'
|
||||
assertInverse = true
|
||||
}
|
||||
|
||||
fail {
|
||||
group = 'com.typesafe.play'
|
||||
module = 'play-ahc-ws-standalone_2.12'
|
||||
versions = '[,2.0.0)'
|
||||
}
|
||||
pass {
|
||||
group = 'com.typesafe.play'
|
||||
module = 'play-ahc-ws-standalone_2.12'
|
||||
versions = '[2.0.0,2.0.4]'
|
||||
}
|
||||
pass {
|
||||
group = 'com.typesafe.play'
|
||||
module = 'play-ahc-ws-standalone_2.12'
|
||||
versions = '[2.0.6,2.1.0)'
|
||||
versions = '[2.0.0,2.1.0)'
|
||||
skipVersions += '2.0.5' // Bad release
|
||||
assertInverse = true
|
||||
}
|
||||
|
||||
// No Scala 2.13 versions below 2.0.6 exist
|
||||
|
|
|
@ -9,6 +9,8 @@ muzzle {
|
|||
group = "javax.servlet"
|
||||
module = 'servlet-api'
|
||||
versions = "[,]"
|
||||
skipVersions += '0'
|
||||
assertInverse = true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,36 +1,20 @@
|
|||
muzzle {
|
||||
fail {
|
||||
group = 'org.springframework'
|
||||
module = 'spring-webmvc'
|
||||
versions = "[,1.2.1)"
|
||||
extraDependency "javax.servlet:javax.servlet-api:3.0.1"
|
||||
}
|
||||
// 1.2.1-1.2.4 have broken dependencies.
|
||||
fail {
|
||||
group = 'org.springframework'
|
||||
module = 'spring-webmvc'
|
||||
versions = "(1.2.4,3.1.0.RELEASE)"
|
||||
extraDependency "javax.servlet:javax.servlet-api:3.0.1"
|
||||
}
|
||||
pass {
|
||||
group = 'org.springframework'
|
||||
module = 'spring-webmvc'
|
||||
versions = "[3.1.0.RELEASE,3.2.1.RELEASE)"
|
||||
extraDependency "javax.servlet:javax.servlet-api:3.0.1"
|
||||
}
|
||||
// 3.2.1.RELEASE is missing a required class. (bad release?)
|
||||
pass {
|
||||
group = 'org.springframework'
|
||||
module = 'spring-webmvc'
|
||||
versions = "(3.2.1.RELEASE,]"
|
||||
versions = "[3.1.0.RELEASE,]"
|
||||
skipVersions += ['1.2.1', '1.2.2', '1.2.3', '1.2.4'] // broken releases... missing dependencies
|
||||
skipVersions += '3.2.1.RELEASE' // missing a required class. (bad release?)
|
||||
extraDependency "javax.servlet:javax.servlet-api:3.0.1"
|
||||
assertInverse = true
|
||||
}
|
||||
|
||||
// FIXME: webmvc depends on web, so we need a separate integration for spring-web specifically.
|
||||
fail {
|
||||
group = 'org.springframework'
|
||||
module = 'spring-web'
|
||||
versions = "(1.2.4,]"
|
||||
versions = "[,]"
|
||||
skipVersions += ['1.2.1', '1.2.2', '1.2.3', '1.2.4'] // broken releases... missing dependencies
|
||||
extraDependency "javax.servlet:javax.servlet-api:3.0.1"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue