From 95c16c4a3c177cf824b446a85f175a56ab3ea998 Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Sat, 15 May 2021 16:22:05 +0900 Subject: [PATCH] Start migrating Muzzle plugin to Java (#2996) --- buildSrc/src/main/groovy/MuzzlePlugin.groovy | 134 +++--------------- .../gradle/muzzle/MuzzleDirective.java | 99 +++++++++++++ .../gradle/muzzle/MuzzleExtension.java | 37 +++++ docs/contributing/muzzle.md | 6 +- .../javaagent/couchbase-2.6-javaagent.gradle | 2 +- .../javaagent/couchbase-3.1-javaagent.gradle | 2 +- ...asticsearch-transport-5.0-javaagent.gradle | 4 +- ...asticsearch-transport-5.3-javaagent.gradle | 4 +- ...asticsearch-transport-6.0-javaagent.gradle | 4 +- .../javaagent/grails-3.0-javaagent.gradle | 2 +- .../jaxws-2.0-axis2-1.6-javaagent.gradle | 2 +- .../jaxws-2.0-metro-2.2-javaagent.gradle | 2 +- .../javaagent/jsp-2.3-javaagent.gradle | 2 +- .../javaagent/log4j-1.2-javaagent.gradle | 2 +- .../javaagent/play-ws-2.0-javaagent.gradle | 2 +- .../javaagent/play-ws-2.1-javaagent.gradle | 4 +- .../javaagent/play-2.4-javaagent.gradle | 2 +- .../javaagent/play-2.6-javaagent.gradle | 2 +- .../javaagent/rxjava-2.0-javaagent.gradle | 2 +- .../javaagent/rxjava-3.0-javaagent.gradle | 2 +- .../spring-webmvc-3.1-javaagent.gradle | 6 +- 21 files changed, 181 insertions(+), 141 deletions(-) create mode 100644 buildSrc/src/main/java/io/opentelemetry/instrumentation/gradle/muzzle/MuzzleDirective.java create mode 100644 buildSrc/src/main/java/io/opentelemetry/instrumentation/gradle/muzzle/MuzzleExtension.java diff --git a/buildSrc/src/main/groovy/MuzzlePlugin.groovy b/buildSrc/src/main/groovy/MuzzlePlugin.groovy index c7e2d527e06c..e7f13ed1b62b 100644 --- a/buildSrc/src/main/groovy/MuzzlePlugin.groovy +++ b/buildSrc/src/main/groovy/MuzzlePlugin.groovy @@ -3,12 +3,13 @@ * SPDX-License-Identifier: Apache-2.0 */ +import io.opentelemetry.instrumentation.gradle.muzzle.MuzzleDirective +import io.opentelemetry.instrumentation.gradle.muzzle.MuzzleExtension import java.lang.reflect.Method import java.security.SecureClassLoader import java.util.concurrent.atomic.AtomicReference import java.util.function.Predicate import java.util.regex.Pattern -import javax.inject.Inject import org.apache.maven.repository.internal.MavenRepositorySystemUtils import org.eclipse.aether.DefaultRepositorySystemSession import org.eclipse.aether.RepositorySystem @@ -25,12 +26,11 @@ import org.eclipse.aether.spi.connector.RepositoryConnectorFactory import org.eclipse.aether.spi.connector.transport.TransporterFactory import org.eclipse.aether.transport.http.HttpTransporterFactory import org.eclipse.aether.version.Version -import org.gradle.api.Action import org.gradle.api.GradleException import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.model.ObjectFactory import org.gradle.api.tasks.TaskProvider + /** * muzzle task plugin which runs muzzle validation against a range of dependencies. */ @@ -90,16 +90,16 @@ class MuzzlePlugin implements Plugin { // use runAfter to set up task finalizers in version order TaskProvider runAfter = muzzle - for (MuzzleDirective muzzleDirective : project.muzzle.directives) { + for (MuzzleDirective muzzleDirective : project.muzzle.directives.get()) { project.getLogger().info("configured $muzzleDirective") - if (muzzleDirective.coreJdk) { + if (muzzleDirective.coreJdk.get()) { runAfter = addMuzzleTask(muzzleDirective, null, project, runAfter) } else { muzzleDirectiveToArtifacts(project, muzzleDirective, system, session).collect() { Artifact singleVersion -> runAfter = addMuzzleTask(muzzleDirective, singleVersion, project, runAfter) } - if (muzzleDirective.assertInverse) { + if (muzzleDirective.assertInverse.get()) { inverseOf(project, muzzleDirective, system, session).collect() { MuzzleDirective inverseDirective -> muzzleDirectiveToArtifacts(project, inverseDirective, system, session).collect() { Artifact singleVersion -> runAfter = addMuzzleTask(inverseDirective, singleVersion, project, runAfter) @@ -184,19 +184,19 @@ class MuzzlePlugin implements Plugin { * Convert a muzzle directive to a list of artifacts */ private static Set muzzleDirectiveToArtifacts(Project instrumentationProject, MuzzleDirective muzzleDirective, RepositorySystem system, RepositorySystemSession session) { - Artifact directiveArtifact = new DefaultArtifact(muzzleDirective.group, muzzleDirective.module, "jar", muzzleDirective.versions) + Artifact directiveArtifact = new DefaultArtifact(muzzleDirective.group.get(), muzzleDirective.module.get(), "jar", muzzleDirective.versions.get()) VersionRangeRequest rangeRequest = new VersionRangeRequest() rangeRequest.setRepositories(getProjectRepositories(instrumentationProject)) rangeRequest.setArtifact(directiveArtifact) VersionRangeResult rangeResult = system.resolveVersionRange(session, rangeRequest) - Set allVersionArtifacts = filterVersions(rangeResult, muzzleDirective.skipVersions).collect { version -> - new DefaultArtifact(muzzleDirective.group, muzzleDirective.module, "jar", version) + Set allVersionArtifacts = filterVersions(rangeResult, muzzleDirective.normalizedSkipVersions).collect { version -> + new DefaultArtifact(muzzleDirective.group.get(), muzzleDirective.module.get(), "jar", version) }.toSet() if (allVersionArtifacts.isEmpty()) { - throw new GradleException("No muzzle artifacts found for $muzzleDirective.group:$muzzleDirective.module $muzzleDirective.versions") + throw new GradleException("No muzzle artifacts found for $muzzleDirective") } return allVersionArtifacts @@ -214,8 +214,8 @@ class MuzzlePlugin implements Plugin { private static Set inverseOf(Project instrumentationProject, MuzzleDirective muzzleDirective, RepositorySystem system, RepositorySystemSession session) { Set inverseDirectives = new HashSet<>() - Artifact allVersionsArtifact = new DefaultArtifact(muzzleDirective.group, muzzleDirective.module, "jar", "[,)") - Artifact directiveArtifact = new DefaultArtifact(muzzleDirective.group, muzzleDirective.module, "jar", muzzleDirective.versions) + Artifact allVersionsArtifact = new DefaultArtifact(muzzleDirective.group.get(), muzzleDirective.module.get(), "jar", "[,)") + Artifact directiveArtifact = new DefaultArtifact(muzzleDirective.group.get(), muzzleDirective.module.get(), "jar", muzzleDirective.versions.get()) List repos = getProjectRepositories(instrumentationProject) VersionRangeRequest allRangeRequest = new VersionRangeRequest() @@ -230,8 +230,8 @@ class MuzzlePlugin implements Plugin { allRangeResult.getVersions().removeAll(rangeResult.getVersions()) - filterVersions(allRangeResult, muzzleDirective.skipVersions).each { version -> - MuzzleDirective inverseDirective = new MuzzleDirective() + filterVersions(allRangeResult, muzzleDirective.normalizedSkipVersions).each { version -> + MuzzleDirective inverseDirective = instrumentationProject.objects.newInstance(MuzzleDirective) inverseDirective.group = muzzleDirective.group inverseDirective.module = muzzleDirective.module inverseDirective.versions = version @@ -316,14 +316,14 @@ class MuzzlePlugin implements Plugin { */ private static TaskProvider addMuzzleTask(MuzzleDirective muzzleDirective, Artifact versionArtifact, Project instrumentationProject, TaskProvider runAfter) { def taskName - if (muzzleDirective.coreJdk) { + if (muzzleDirective.coreJdk.get()) { taskName = "muzzle-Assert$muzzleDirective" } else { - taskName = "muzzle-Assert${muzzleDirective.assertPass ? "Pass" : "Fail"}-$versionArtifact.groupId-$versionArtifact.artifactId-$versionArtifact.version${muzzleDirective.name ? "-${muzzleDirective.getNameSlug()}" : ""}" + taskName = "muzzle-Assert${muzzleDirective.assertPass ? "Pass" : "Fail"}-$versionArtifact.groupId-$versionArtifact.artifactId-$versionArtifact.version${!muzzleDirective.name.get().isEmpty() ? "-${muzzleDirective.getNameSlug()}" : ""}" } def config = instrumentationProject.configurations.create(taskName) - if (!muzzleDirective.coreJdk) { + if (!muzzleDirective.coreJdk.get()) { def dep = instrumentationProject.dependencies.create("$versionArtifact.groupId:$versionArtifact.artifactId:$versionArtifact.version") { transitive = true } @@ -334,7 +334,7 @@ class MuzzlePlugin implements Plugin { config.dependencies.add(dep) } - for (String additionalDependency : muzzleDirective.additionalDependencies) { + for (String additionalDependency : muzzleDirective.additionalDependencies.get()) { if (additionalDependency.count(":") < 2) { // Dependency definition without version, use the artifact's version. additionalDependency += ":${versionArtifact.version}" @@ -362,7 +362,7 @@ class MuzzlePlugin implements Plugin { // find all instrumenters, get muzzle, and assert Method assertionMethod = instrumentationCL.loadClass('io.opentelemetry.javaagent.tooling.muzzle.matcher.MuzzleGradlePluginUtil') .getMethod('assertInstrumentationMuzzled', ClassLoader.class, ClassLoader.class, boolean.class) - assertionMethod.invoke(null, instrumentationCL, userCL, muzzleDirective.assertPass) + assertionMethod.invoke(null, instrumentationCL, userCL, muzzleDirective.assertPass.get()) } finally { Thread.currentThread().contextClassLoader = ccl } @@ -406,99 +406,3 @@ class MuzzlePlugin implements Plugin { return session } } - -// plugin extension classes - -/** - * A pass or fail directive for a single dependency. - */ -class MuzzleDirective { - - /** - * Name is optional and is used to further define the scope of a directive. The motivation for this is that this - * plugin creates a config for each of the dependencies under test with name '...---'. - * The problem is that if we want to test multiple times the same configuration under different conditions, e.g. - * with different extra dependencies, the plugin would throw an error as it would try to create several times the - * same config. This property can be used to differentiate those config names for different directives. - */ - String name - - String group - String module - String versions - Set skipVersions = new HashSet<>() - List additionalDependencies = new ArrayList<>() - boolean assertPass - boolean assertInverse = false - boolean coreJdk = false - - void coreJdk() { - coreJdk = true - } - - /** - * Adds extra dependencies to the current muzzle test. - * - * @param compileString An extra dependency in the gradle canonical form: '::'. - */ - void extraDependency(String compileString) { - additionalDependencies.add(compileString) - } - - /** - * Slug of directive name. - * - * @return A slug of the name or an empty string if name is empty. E.g. 'My Directive' --> 'My-Directive' - */ - String getNameSlug() { - if (null == name) { - return "" - } - - return name.trim().replaceAll("[^a-zA-Z0-9]+", "-") - } - - String toString() { - if (coreJdk) { - return "${assertPass ? 'Pass' : 'Fail'}-core-jdk" - } else { - return "${assertPass ? 'pass' : 'fail'} $group:$module:$versions" - } - } -} - -/** - * Muzzle extension containing all pass and fail directives. - */ -class MuzzleExtension { - final List directives = new ArrayList<>() - private final ObjectFactory objectFactory - - @Inject - MuzzleExtension(final ObjectFactory objectFactory) { - this.objectFactory = objectFactory - } - - void pass(Action action) { - MuzzleDirective pass = objectFactory.newInstance(MuzzleDirective) - action.execute(pass) - postConstruct(pass) - pass.assertPass = true - directives.add(pass) - } - - void fail(Action action) { - 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() - } - } -} diff --git a/buildSrc/src/main/java/io/opentelemetry/instrumentation/gradle/muzzle/MuzzleDirective.java b/buildSrc/src/main/java/io/opentelemetry/instrumentation/gradle/muzzle/MuzzleDirective.java new file mode 100644 index 000000000000..4177bd145237 --- /dev/null +++ b/buildSrc/src/main/java/io/opentelemetry/instrumentation/gradle/muzzle/MuzzleDirective.java @@ -0,0 +1,99 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.gradle.muzzle; + +import java.util.Collections; +import java.util.Set; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import org.gradle.api.provider.ListProperty; +import org.gradle.api.provider.Property; +import org.gradle.api.provider.SetProperty; + +public abstract class MuzzleDirective { + + private static final Pattern NORMALIZE_NAME_SLUG = Pattern.compile("[^a-zA-Z0-9]+"); + + public MuzzleDirective() { + getName().convention(""); + getSkipVersions().convention(Collections.emptySet()); + getAdditionalDependencies().convention(Collections.emptyList()); + getAssertPass().convention(false); + getAssertInverse().convention(false); + getCoreJdk().convention(false); + } + + public abstract Property getName(); + + public abstract Property getGroup(); + + public abstract Property getModule(); + + public abstract Property getVersions(); + + public abstract SetProperty getSkipVersions(); + + public abstract ListProperty getAdditionalDependencies(); + + public abstract Property getAssertPass(); + + public abstract Property getAssertInverse(); + + public abstract Property getCoreJdk(); + + public void coreJdk() { + getCoreJdk().set(true); + } + + /** + * Adds extra dependencies to the current muzzle test. + * + * @param compileString An extra dependency in the gradle canonical form: + * '::'. + */ + public void extraDependency(String compileString) { + getAdditionalDependencies().add(compileString); + } + + public void skip(String... version) { + getSkipVersions().addAll(version); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + if (getCoreJdk().getOrElse(false)) { + if (getAssertPass().getOrElse(false)) { + sb.append("Pass"); + } else { + sb.append("Fail"); + } + sb.append("-core-jdk"); + } else { + if (getAssertPass().getOrElse(false)) { + sb.append("pass"); + } else { + sb.append("fail"); + } + sb.append(getGroup().get()) + .append(':') + .append(getModule().get()) + .append(':') + .append(getVersions().get()); + } + return sb.toString(); + } + + String getNameSlug() { + return NORMALIZE_NAME_SLUG.matcher(getName().get().trim()).replaceAll("-"); + } + + Set getNormalizedSkipVersions() { + return getSkipVersions().getOrElse(Collections.emptySet()).stream() + .map(String::toLowerCase) + .collect(Collectors.toSet()); + } +} diff --git a/buildSrc/src/main/java/io/opentelemetry/instrumentation/gradle/muzzle/MuzzleExtension.java b/buildSrc/src/main/java/io/opentelemetry/instrumentation/gradle/muzzle/MuzzleExtension.java new file mode 100644 index 000000000000..d7a056ac5ffd --- /dev/null +++ b/buildSrc/src/main/java/io/opentelemetry/instrumentation/gradle/muzzle/MuzzleExtension.java @@ -0,0 +1,37 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +package io.opentelemetry.instrumentation.gradle.muzzle; + +import javax.inject.Inject; +import org.gradle.api.Action; +import org.gradle.api.model.ObjectFactory; +import org.gradle.api.provider.ListProperty; + +public abstract class MuzzleExtension { + + private final ObjectFactory objectFactory; + + @Inject + public MuzzleExtension(ObjectFactory objectFactory) { + this.objectFactory = objectFactory; + } + + public abstract ListProperty getDirectives(); + + public void pass(Action action) { + MuzzleDirective pass = objectFactory.newInstance(MuzzleDirective.class); + action.execute(pass); + pass.getAssertPass().set(true); + getDirectives().add(pass); + } + + public void fail(Action action) { + MuzzleDirective fail = objectFactory.newInstance(MuzzleDirective.class); + action.execute(fail); + fail.getAssertPass().set(false); + getDirectives().add(fail); + } +} diff --git a/docs/contributing/muzzle.md b/docs/contributing/muzzle.md index 2db56a1cca62..c14a8a3fe50f 100644 --- a/docs/contributing/muzzle.md +++ b/docs/contributing/muzzle.md @@ -98,7 +98,7 @@ muzzle { // versions from this range are checked versions = "[,4.0)" // this version is not checked by muzzle - skipVersions += '3.1-jenkins-1' + skip('3.1-jenkins-1') } // it is expected that muzzle passes the runtime check for this component pass { @@ -106,8 +106,8 @@ muzzle { module = 'spring-webmvc' versions = "[3.1.0.RELEASE,]" // except these versions - skipVersions += ['1.2.1', '1.2.2', '1.2.3', '1.2.4'] - skipVersions += '3.2.1.RELEASE' + skip('1.2.1', '1.2.2', '1.2.3', '1.2.4') + skip('3.2.1.RELEASE') // this dependency will be added to the classpath when muzzle check is run extraDependency "javax.servlet:javax.servlet-api:3.0.1" // verify that all other versions - [,3.1.0.RELEASE) in this case - fail the muzzle runtime check diff --git a/instrumentation/couchbase/couchbase-2.6/javaagent/couchbase-2.6-javaagent.gradle b/instrumentation/couchbase/couchbase-2.6/javaagent/couchbase-2.6-javaagent.gradle index 9370ca9c4f4e..52dc4b0d0462 100644 --- a/instrumentation/couchbase/couchbase-2.6/javaagent/couchbase-2.6-javaagent.gradle +++ b/instrumentation/couchbase/couchbase-2.6/javaagent/couchbase-2.6-javaagent.gradle @@ -6,7 +6,7 @@ muzzle { module = 'java-client' versions = "[2.6.0,3)" // these versions were released as ".bundle" instead of ".jar" - skipVersions += ['2.7.5', '2.7.8'] + skip('2.7.5', '2.7.8') assertInverse = true } fail { diff --git a/instrumentation/couchbase/couchbase-3.1/javaagent/couchbase-3.1-javaagent.gradle b/instrumentation/couchbase/couchbase-3.1/javaagent/couchbase-3.1-javaagent.gradle index 3fd6ae864f2f..043c193965c5 100644 --- a/instrumentation/couchbase/couchbase-3.1/javaagent/couchbase-3.1-javaagent.gradle +++ b/instrumentation/couchbase/couchbase-3.1/javaagent/couchbase-3.1-javaagent.gradle @@ -6,7 +6,7 @@ muzzle { module = "java-client" versions = "[3.1,)" // these versions were released as ".bundle" instead of ".jar" - skipVersions += ['2.7.5', '2.7.8'] + skip('2.7.5', '2.7.8') assertInverse = true } } diff --git a/instrumentation/elasticsearch/elasticsearch-transport-5.0/javaagent/elasticsearch-transport-5.0-javaagent.gradle b/instrumentation/elasticsearch/elasticsearch-transport-5.0/javaagent/elasticsearch-transport-5.0-javaagent.gradle index 20398c78d28b..a785a5ba3165 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-5.0/javaagent/elasticsearch-transport-5.0-javaagent.gradle +++ b/instrumentation/elasticsearch/elasticsearch-transport-5.0/javaagent/elasticsearch-transport-5.0-javaagent.gradle @@ -7,7 +7,7 @@ muzzle { versions = "[5.0.0,5.3.0)" // version 7.11.0 depends on org.elasticsearch:elasticsearch:7.11.0 which depends on // org.elasticsearch:elasticsearch-plugin-classloader:7.11.0 which does not exist - skipVersions += ['7.11.0'] + skip('7.11.0') assertInverse = true } pass { @@ -16,7 +16,7 @@ muzzle { versions = "[5.0.0,5.3.0)" // version 7.11.0 depends on org.elasticsearch:elasticsearch:7.11.0 which depends on // org.elasticsearch:elasticsearch-plugin-classloader:7.11.0 which does not exist - skipVersions += ['7.11.0'] + skip('7.11.0') assertInverse = true } } diff --git a/instrumentation/elasticsearch/elasticsearch-transport-5.3/javaagent/elasticsearch-transport-5.3-javaagent.gradle b/instrumentation/elasticsearch/elasticsearch-transport-5.3/javaagent/elasticsearch-transport-5.3-javaagent.gradle index ec909457521e..0cba83b6a3fe 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-5.3/javaagent/elasticsearch-transport-5.3-javaagent.gradle +++ b/instrumentation/elasticsearch/elasticsearch-transport-5.3/javaagent/elasticsearch-transport-5.3-javaagent.gradle @@ -7,7 +7,7 @@ muzzle { versions = "[5.3.0,6.0.0)" // version 7.11.0 depends on org.elasticsearch:elasticsearch:7.11.0 which depends on // org.elasticsearch:elasticsearch-plugin-classloader:7.11.0 which does not exist - skipVersions += ['7.11.0'] + skip('7.11.0') assertInverse = true } pass { @@ -16,7 +16,7 @@ muzzle { versions = "[5.3.0,6.0.0)" // version 7.11.0 depends on org.elasticsearch:elasticsearch-plugin-classloader:7.11.0 // which does not exist - skipVersions += ['7.11.0'] + skip('7.11.0') assertInverse = true } } diff --git a/instrumentation/elasticsearch/elasticsearch-transport-6.0/javaagent/elasticsearch-transport-6.0-javaagent.gradle b/instrumentation/elasticsearch/elasticsearch-transport-6.0/javaagent/elasticsearch-transport-6.0-javaagent.gradle index 3f6476fd0dc8..5014d8785c49 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-6.0/javaagent/elasticsearch-transport-6.0-javaagent.gradle +++ b/instrumentation/elasticsearch/elasticsearch-transport-6.0/javaagent/elasticsearch-transport-6.0-javaagent.gradle @@ -7,7 +7,7 @@ muzzle { versions = "[6.0.0,)" // version 7.11.0 depends on org.elasticsearch:elasticsearch:7.11.0 which depends on // org.elasticsearch:elasticsearch-plugin-classloader:7.11.0 which does not exist - skipVersions += ['7.11.0'] + skip('7.11.0') assertInverse = true } pass { @@ -16,7 +16,7 @@ muzzle { versions = "[6.0.0,)" // version 7.11.0 depends on org.elasticsearch:elasticsearch:7.11.0 which depends on // org.elasticsearch:elasticsearch-plugin-classloader:7.11.0 which does not exist - skipVersions += ['7.11.0'] + skip('7.11.0') assertInverse = true } } diff --git a/instrumentation/grails-3.0/javaagent/grails-3.0-javaagent.gradle b/instrumentation/grails-3.0/javaagent/grails-3.0-javaagent.gradle index f40b0a751940..216b591a1cd5 100644 --- a/instrumentation/grails-3.0/javaagent/grails-3.0-javaagent.gradle +++ b/instrumentation/grails-3.0/javaagent/grails-3.0-javaagent.gradle @@ -9,7 +9,7 @@ muzzle { // which (obviously) does not exist // version 3.3.6 depends on org.grails:grails-datastore-core:6.1.10.BUILD-SNAPSHOT // which (also obviously) does not exist - skipVersions += ['3.1.15', '3.3.6'] + skip('3.1.15', '3.3.6') assertInverse = true } } diff --git a/instrumentation/jaxws/jaxws-2.0-axis2-1.6/javaagent/jaxws-2.0-axis2-1.6-javaagent.gradle b/instrumentation/jaxws/jaxws-2.0-axis2-1.6/javaagent/jaxws-2.0-axis2-1.6-javaagent.gradle index f11a90db53e7..706d3778b52e 100644 --- a/instrumentation/jaxws/jaxws-2.0-axis2-1.6/javaagent/jaxws-2.0-axis2-1.6-javaagent.gradle +++ b/instrumentation/jaxws/jaxws-2.0-axis2-1.6/javaagent/jaxws-2.0-axis2-1.6-javaagent.gradle @@ -10,7 +10,7 @@ muzzle { // which depends on org.apache.neethi:neethi:2.0.1 which does not exist // version 1.3 depends on org.apache.axis2:axis2-kernel:1.3 // which depends on org.apache.woden:woden:1.0-incubating-M7b which does not exist - skipVersions += ['1.2', '1.3'] + skip('1.2', '1.3') } } diff --git a/instrumentation/jaxws/jaxws-2.0-metro-2.2/javaagent/jaxws-2.0-metro-2.2-javaagent.gradle b/instrumentation/jaxws/jaxws-2.0-metro-2.2/javaagent/jaxws-2.0-metro-2.2-javaagent.gradle index 7ac73788eb7f..93e8808cefa6 100644 --- a/instrumentation/jaxws/jaxws-2.0-metro-2.2/javaagent/jaxws-2.0-metro-2.2-javaagent.gradle +++ b/instrumentation/jaxws/jaxws-2.0-metro-2.2/javaagent/jaxws-2.0-metro-2.2-javaagent.gradle @@ -6,7 +6,7 @@ muzzle { module = "jaxws-rt" versions = "[2.2.0.1,3)" // version 2.3.4 depends on org.glassfish.gmbal:gmbal-api-only:4.0.3 which does not exist - skipVersions += "2.3.4" + skip('2.3.4') assertInverse = true extraDependency "javax.servlet:javax.servlet-api:3.0.1" } diff --git a/instrumentation/jsp-2.3/javaagent/jsp-2.3-javaagent.gradle b/instrumentation/jsp-2.3/javaagent/jsp-2.3-javaagent.gradle index 00fe7022264d..29b3af3e6a53 100644 --- a/instrumentation/jsp-2.3/javaagent/jsp-2.3-javaagent.gradle +++ b/instrumentation/jsp-2.3/javaagent/jsp-2.3-javaagent.gradle @@ -8,7 +8,7 @@ muzzle { // tomcat 10 uses JSP 3.0 versions = "[7.0.19,10)" // version 8.0.9 depends on org.eclipse.jdt.core.compiler:ecj:4.4RC4 which does not exist - skipVersions += '8.0.9' + skip('8.0.9') } } diff --git a/instrumentation/log4j/log4j-1.2/javaagent/log4j-1.2-javaagent.gradle b/instrumentation/log4j/log4j-1.2/javaagent/log4j-1.2-javaagent.gradle index 01a286ee819a..8607dc435188 100644 --- a/instrumentation/log4j/log4j-1.2/javaagent/log4j-1.2-javaagent.gradle +++ b/instrumentation/log4j/log4j-1.2/javaagent/log4j-1.2-javaagent.gradle @@ -6,7 +6,7 @@ muzzle { module = "log4j" versions = "[1.2,)" // version 1.2.15 has a bad dependency on javax.jms:jms:1.1 which was released as pom only - skipVersions += '1.2.15' + skip('1.2.15') } } diff --git a/instrumentation/play-ws/play-ws-2.0/javaagent/play-ws-2.0-javaagent.gradle b/instrumentation/play-ws/play-ws-2.0/javaagent/play-ws-2.0-javaagent.gradle index 092f0619a11d..2ee6b4e86e74 100644 --- a/instrumentation/play-ws/play-ws-2.0/javaagent/play-ws-2.0-javaagent.gradle +++ b/instrumentation/play-ws/play-ws-2.0/javaagent/play-ws-2.0-javaagent.gradle @@ -14,7 +14,7 @@ muzzle { module = 'play-ahc-ws-standalone_2.12' versions = '[2.0.0,2.1.0)' // 2.0.5 is missing play.shaded.ahc.org.asynchttpclient.AsyncHandler#onTlsHandshakeSuccess()V - skipVersions += '2.0.5' + skip('2.0.5') assertInverse = true } diff --git a/instrumentation/play-ws/play-ws-2.1/javaagent/play-ws-2.1-javaagent.gradle b/instrumentation/play-ws/play-ws-2.1/javaagent/play-ws-2.1-javaagent.gradle index eda20df004eb..8cae32e31d39 100644 --- a/instrumentation/play-ws/play-ws-2.1/javaagent/play-ws-2.1-javaagent.gradle +++ b/instrumentation/play-ws/play-ws-2.1/javaagent/play-ws-2.1-javaagent.gradle @@ -12,7 +12,7 @@ muzzle { group = 'com.typesafe.play' module = 'play-ahc-ws-standalone_2.12' versions = '[2.1.0,]' - skipVersions += '2.0.5' // muzzle passes but expecting failure, see play-ws-2.0-javaagent.gradle + skip('2.0.5') // muzzle passes but expecting failure, see play-ws-2.0-javaagent.gradle assertInverse = true } @@ -20,7 +20,7 @@ muzzle { group = 'com.typesafe.play' module = 'play-ahc-ws-standalone_2.13' versions = '[2.1.0,]' - skipVersions += '2.0.5' // muzzle passes but expecting failure, see play-ws-2.0-javaagent.gradle + skip('2.0.5') // muzzle passes but expecting failure, see play-ws-2.0-javaagent.gradle assertInverse = true } } diff --git a/instrumentation/play/play-2.4/javaagent/play-2.4-javaagent.gradle b/instrumentation/play/play-2.4/javaagent/play-2.4-javaagent.gradle index a0d2f00adb89..754741056d8e 100644 --- a/instrumentation/play/play-2.4/javaagent/play-2.4-javaagent.gradle +++ b/instrumentation/play/play-2.4/javaagent/play-2.4-javaagent.gradle @@ -13,7 +13,7 @@ muzzle { assertInverse = true // versions 2.3.9 and 2.3.10 depends on com.typesafe.netty:netty-http-pipelining:1.1.2 // which does not exist - skipVersions += ['2.3.9', '2.3.10'] + skip('2.3.9', '2.3.10') } fail { group = 'com.typesafe.play' diff --git a/instrumentation/play/play-2.6/javaagent/play-2.6-javaagent.gradle b/instrumentation/play/play-2.6/javaagent/play-2.6-javaagent.gradle index 92666d6c723d..ea1d8d060c64 100644 --- a/instrumentation/play/play-2.6/javaagent/play-2.6-javaagent.gradle +++ b/instrumentation/play/play-2.6/javaagent/play-2.6-javaagent.gradle @@ -16,7 +16,7 @@ muzzle { assertInverse = true // versions 2.3.9 and 2.3.10 depends on com.typesafe.netty:netty-http-pipelining:1.1.2 // which does not exist - skipVersions += ['2.3.9', '2.3.10'] + skip('2.3.9', '2.3.10') } pass { group = 'com.typesafe.play' diff --git a/instrumentation/rxjava/rxjava-2.0/javaagent/rxjava-2.0-javaagent.gradle b/instrumentation/rxjava/rxjava-2.0/javaagent/rxjava-2.0-javaagent.gradle index f79b260aa949..dca67855b8f4 100644 --- a/instrumentation/rxjava/rxjava-2.0/javaagent/rxjava-2.0-javaagent.gradle +++ b/instrumentation/rxjava/rxjava-2.0/javaagent/rxjava-2.0-javaagent.gradle @@ -5,7 +5,7 @@ muzzle { group = "io.reactivex.rxjava2" module = "rxjava" versions = "[2.0.6,)" - assertInverse true + assertInverse = true } } diff --git a/instrumentation/rxjava/rxjava-3.0/javaagent/rxjava-3.0-javaagent.gradle b/instrumentation/rxjava/rxjava-3.0/javaagent/rxjava-3.0-javaagent.gradle index 80583060fb5f..2f5d25e13f27 100644 --- a/instrumentation/rxjava/rxjava-3.0/javaagent/rxjava-3.0-javaagent.gradle +++ b/instrumentation/rxjava/rxjava-3.0/javaagent/rxjava-3.0-javaagent.gradle @@ -5,7 +5,7 @@ muzzle { group = "io.reactivex.rxjava3" module = "rxjava" versions = "[3.0.0,)" - assertInverse true + assertInverse = true } } diff --git a/instrumentation/spring/spring-webmvc-3.1/javaagent/spring-webmvc-3.1-javaagent.gradle b/instrumentation/spring/spring-webmvc-3.1/javaagent/spring-webmvc-3.1-javaagent.gradle index ee549cb03028..0c2d23569226 100644 --- a/instrumentation/spring/spring-webmvc-3.1/javaagent/spring-webmvc-3.1-javaagent.gradle +++ b/instrumentation/spring/spring-webmvc-3.1/javaagent/spring-webmvc-3.1-javaagent.gradle @@ -7,9 +7,9 @@ muzzle { versions = "[3.1.0.RELEASE,]" // these versions depend on org.springframework:spring-web which has a bad dependency on // javax.faces:jsf-api:1.1 which was released as pom only - skipVersions += ['1.2.1', '1.2.2', '1.2.3', '1.2.4'] + skip('1.2.1', '1.2.2', '1.2.3', '1.2.4') // 3.2.1.RELEASE has transitive dependencies like spring-web as "provided" instead of "compile" - skipVersions += '3.2.1.RELEASE' + skip('3.2.1.RELEASE') extraDependency "javax.servlet:javax.servlet-api:3.0.1" assertInverse = true } @@ -21,7 +21,7 @@ muzzle { versions = "[,]" // these versions depend on org.springframework:spring-web which has a bad dependency on // javax.faces:jsf-api:1.1 which was released as pom only - skipVersions += ['1.2.1', '1.2.2', '1.2.3', '1.2.4'] + skip('1.2.1', '1.2.2', '1.2.3', '1.2.4') extraDependency "javax.servlet:javax.servlet-api:3.0.1" } }