diff --git a/README.md b/README.md index c800498f..01510c2b 100644 --- a/README.md +++ b/README.md @@ -86,17 +86,22 @@ The strategy can be specified either on the task or as a system property for ad gradle dependencyUpdates -Drevision=release ``` -The latest versions can be further filtered using [Component Selection Rules][component_selection_rules]. -For example, to disallow release candidates as upgradable versions a selection rule could be defined as: +The latest versions can be further filtered using [Component Selection Rules][component_selection_rules]. +The current version of a component can be retrieved with `currentVersion` property. For example, to +disallow release candidates as upgradable versions from stable versions, a selection rule could be +defined as: ```groovy dependencyUpdates.resolutionStrategy { componentSelection { rules -> - rules.all { ComponentSelection selection -> - boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'preview', 'b', 'ea'].any { qualifier -> - selection.candidate.version ==~ /(?i).*[.-]$qualifier[.\d-+]*/ + rules.all { + def isNonStable = { String version -> + ['alpha', 'beta', 'rc', 'cr', 'm', 'preview', 'b', 'ea'].any { qualifier -> + version ==~ /(?i).*[.-]\$qualifier[.\\d-+]*/ + } } - if (rejected) { + + if (isNonStable(candidate.version) && !isNonStable(currentVersion)) { selection.reject('Release candidate') } } @@ -113,10 +118,10 @@ tasks.named("dependencyUpdates") { resolutionStrategy { componentSelection { all { - val rejected = listOf("alpha", "beta", "rc", "cr", "m", "preview", "b", "ea").any { qualifier -> - candidate.version.matches(Regex("(?i).*[.-]$qualifier[.\\d-+]*")) + fun isNonStable(version: String) = listOf("alpha", "beta", "rc", "cr", "m", "preview", "b", "ea").any { qualifier -> + version.matches(Regex("(?i).*[.-]\$qualifier[.\\d-+]*")) } - if (rejected) { + if (isNonStable(candidate.version) && !isNonStable(currentVersion)) { reject("Release candidate") } } diff --git a/src/main/groovy/com/github/benmanes/gradle/versions/updates/Coordinate.groovy b/src/main/groovy/com/github/benmanes/gradle/versions/updates/Coordinate.groovy index 82a10f21..55487d51 100644 --- a/src/main/groovy/com/github/benmanes/gradle/versions/updates/Coordinate.groovy +++ b/src/main/groovy/com/github/benmanes/gradle/versions/updates/Coordinate.groovy @@ -20,6 +20,7 @@ import groovy.transform.TypeChecked import org.gradle.api.artifacts.Dependency import org.gradle.api.artifacts.ModuleVersionIdentifier import org.gradle.api.artifacts.ModuleVersionSelector +import org.gradle.api.artifacts.component.ModuleComponentIdentifier /** * The dependency's coordinate. @@ -64,6 +65,10 @@ class Coordinate implements Comparable { return new Coordinate(identifier.group, identifier.name, identifier.version) } + static Coordinate from(ModuleComponentIdentifier identifier) { + return new Coordinate(identifier.group, identifier.module, identifier.version) + } + @EqualsAndHashCode static class Key implements Comparable { final String groupId diff --git a/src/main/groovy/com/github/benmanes/gradle/versions/updates/DependencyUpdates.groovy b/src/main/groovy/com/github/benmanes/gradle/versions/updates/DependencyUpdates.groovy index 6b37d426..a4d9a2d4 100644 --- a/src/main/groovy/com/github/benmanes/gradle/versions/updates/DependencyUpdates.groovy +++ b/src/main/groovy/com/github/benmanes/gradle/versions/updates/DependencyUpdates.groovy @@ -16,14 +16,14 @@ package com.github.benmanes.gradle.versions.updates import com.github.benmanes.gradle.versions.updates.gradle.GradleUpdateChecker +import com.github.benmanes.gradle.versions.updates.resolutionstrategy.ResolutionStrategyWithCurrent import groovy.transform.TupleConstructor import groovy.transform.TypeChecked +import org.gradle.api.Action import org.gradle.api.Project import org.gradle.api.artifacts.Configuration import org.gradle.api.artifacts.UnresolvedDependency -import static groovy.transform.TypeCheckingMode.SKIP - /** * An evaluator for reporting of which dependencies have later versions. *

@@ -38,7 +38,7 @@ import static groovy.transform.TypeCheckingMode.SKIP @TupleConstructor class DependencyUpdates { Project project - Closure resolutionStrategy + Action resolutionStrategy String revision Object outputFormatter String outputDir diff --git a/src/main/groovy/com/github/benmanes/gradle/versions/updates/DependencyUpdatesTask.groovy b/src/main/groovy/com/github/benmanes/gradle/versions/updates/DependencyUpdatesTask.groovy index 2d4fdc86..66551056 100644 --- a/src/main/groovy/com/github/benmanes/gradle/versions/updates/DependencyUpdatesTask.groovy +++ b/src/main/groovy/com/github/benmanes/gradle/versions/updates/DependencyUpdatesTask.groovy @@ -15,10 +15,10 @@ */ package com.github.benmanes.gradle.versions.updates +import com.github.benmanes.gradle.versions.updates.resolutionstrategy.ResolutionStrategyWithCurrent import groovy.transform.TypeChecked import org.gradle.api.Action import org.gradle.api.DefaultTask -import org.gradle.api.artifacts.ResolutionStrategy import org.gradle.api.tasks.Input import org.gradle.api.tasks.Optional import org.gradle.api.tasks.TaskAction @@ -52,8 +52,8 @@ class DependencyUpdatesTask extends DefaultTask { @Input boolean checkForGradleUpdate = true - Object outputFormatter = 'plain'; - Closure resolutionStrategy = null; + Object outputFormatter = 'plain' + Action resolutionStrategyAction = null DependencyUpdatesTask() { description = 'Displays the dependency updates for the project.' @@ -66,7 +66,7 @@ class DependencyUpdatesTask extends DefaultTask { def dependencyUpdates() { project.evaluationDependsOnChildren() - def evaluator = new DependencyUpdates(project, resolutionStrategy, revisionLevel(), + def evaluator = new DependencyUpdates(project, resolutionStrategyAction, revisionLevel(), outputFormatterProp(), outputDirectory(), getReportfileName(), checkForGradleUpdate, gradleReleaseChannelLevel()) DependencyUpdatesReporter reporter = evaluator.run() reporter?.write() @@ -76,10 +76,8 @@ class DependencyUpdatesTask extends DefaultTask { * Sets the {@link #resolutionStrategy} to the provided strategy. * @param resolutionStrategy the resolution strategy */ - void resolutionStrategy(final Action resolutionStrategy) { - // The delegate of the Closure body is ResolutionStrategy: - // https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/Configuration.html#resolutionStrategy-groovy.lang.Closure- - this.resolutionStrategy = { resolutionStrategy.execute(delegate as ResolutionStrategy) } + void resolutionStrategy(final Action resolutionStrategy) { + this.resolutionStrategyAction = resolutionStrategy } /** Returns the resolution revision level. */ diff --git a/src/main/groovy/com/github/benmanes/gradle/versions/updates/Resolver.groovy b/src/main/groovy/com/github/benmanes/gradle/versions/updates/Resolver.groovy index eda6a9a1..67579dff 100644 --- a/src/main/groovy/com/github/benmanes/gradle/versions/updates/Resolver.groovy +++ b/src/main/groovy/com/github/benmanes/gradle/versions/updates/Resolver.groovy @@ -15,9 +15,11 @@ */ package com.github.benmanes.gradle.versions.updates +import com.github.benmanes.gradle.versions.updates.resolutionstrategy.ResolutionStrategyWithCurrent import groovy.transform.TypeChecked import java.util.concurrent.ConcurrentMap import java.util.concurrent.ConcurrentHashMap +import org.gradle.api.Action import org.gradle.api.Project import org.gradle.api.artifacts.ComponentMetadata import org.gradle.api.artifacts.ComponentSelection @@ -51,12 +53,12 @@ import static org.gradle.api.specs.Specs.SATISFIES_ALL @TypeChecked class Resolver { final Project project - final Closure resolutionStrategy + final Action resolutionStrategy final boolean useSelectionRules final boolean collectProjectUrls final ConcurrentMap projectUrls - Resolver(Project project, Closure resolutionStrategy) { + Resolver(Project project, Action resolutionStrategy) { this.projectUrls = new ConcurrentHashMap<>() this.resolutionStrategy = resolutionStrategy this.project = project @@ -72,7 +74,8 @@ class Resolver { /** Returns the version status of the configuration's dependencies at the given revision. */ public Set resolve(Configuration configuration, String revision) { Map coordinates = getCurrentCoordinates(configuration) - Configuration latestConfiguration = createLatestConfiguration(configuration, revision) + Configuration latestConfiguration = createLatestConfiguration(configuration, revision, + coordinates) LenientConfiguration lenient = latestConfiguration.resolvedConfiguration.lenientConfiguration Set resolved = lenient.getFirstLevelModuleDependencies(SATISFIES_ALL) @@ -106,7 +109,8 @@ class Resolver { } /** Returns a copy of the configuration where dependencies will be resolved up to the revision. */ - private Configuration createLatestConfiguration(Configuration configuration, String revision) { + private Configuration createLatestConfiguration(Configuration configuration, String revision, + Map currentCoordinates) { List latest = configuration.dependencies.findAll { dependency -> dependency instanceof ExternalDependency }.collect { dependency -> @@ -124,7 +128,7 @@ class Resolver { if (useSelectionRules) { addRevisionFilter(copy, revision) - addCustomResolutionStrategy(copy) + addCustomResolutionStrategy(copy, currentCoordinates) } return copy } @@ -165,9 +169,16 @@ class Resolver { } /** Adds a custom resolution strategy only applicable for the dependency updates task. */ - private void addCustomResolutionStrategy(Configuration configuration) { + private void addCustomResolutionStrategy(Configuration configuration, + Map currentCoordinates) { if (resolutionStrategy != null) { - configuration.resolutionStrategy(resolutionStrategy) + configuration.resolutionStrategy(new Action() { + @java.lang.Override + void execute(ResolutionStrategy inner) { + resolutionStrategy.execute(new ResolutionStrategyWithCurrent(inner as ResolutionStrategy, + currentCoordinates)) + } + }) } } diff --git a/src/main/groovy/com/github/benmanes/gradle/versions/updates/resolutionstrategy/ComponentSelectionRulesWithCurrent.groovy b/src/main/groovy/com/github/benmanes/gradle/versions/updates/resolutionstrategy/ComponentSelectionRulesWithCurrent.groovy new file mode 100644 index 00000000..097b5180 --- /dev/null +++ b/src/main/groovy/com/github/benmanes/gradle/versions/updates/resolutionstrategy/ComponentSelectionRulesWithCurrent.groovy @@ -0,0 +1,89 @@ +package com.github.benmanes.gradle.versions.updates.resolutionstrategy + +import com.github.benmanes.gradle.versions.updates.Coordinate +import groovy.transform.TupleConstructor +import org.gradle.api.Action +import org.gradle.api.artifacts.ComponentSelection +import org.gradle.api.artifacts.ComponentSelectionRules +import org.gradle.internal.rules.RuleAction +import org.gradle.internal.rules.RuleSourceBackedRuleAction +import org.gradle.model.internal.type.ModelType + +@TupleConstructor(includeFields=true) +class ComponentSelectionRulesWithCurrent { + + private final ComponentSelectionRules delegate + private final Map currentCoordinates + + ComponentSelectionRulesWithCurrent all( + Action selectionAction) { + delegate.all(new Action() { + void execute(ComponentSelection inner) { + selectionAction.execute(wrapComponentSelection(inner)) + } + }) + return this + } + + ComponentSelectionRulesWithCurrent all(Closure closure) { + delegate.all(new Action() { + void execute(ComponentSelection inner) { + ComponentSelectionWithCurrent wrapped = wrapComponentSelection(inner) + closure.delegate = wrapped + closure(wrapped) + } + }) + return this + } + + ComponentSelectionRulesWithCurrent all(Object ruleSource) { + RuleAction ruleAction = RuleSourceBackedRuleAction.create( + ModelType.of(ComponentSelectionWithCurrent), ruleSource) + delegate.all(new Action() { + void execute(ComponentSelection inner) { + ruleAction.execute(wrapComponentSelection(inner), []) + } + }) + return this + } + + ComponentSelectionRulesWithCurrent withModule(Object id, + Action selectionAction) { + delegate.withModule(id, new Action() { + void execute(ComponentSelection inner) { + selectionAction.execute(wrapComponentSelection(inner)) + } + }) + return this + } + + ComponentSelectionRulesWithCurrent withModule(Object id, Closure closure) { + delegate.withModule(id, new Action() { + void execute(ComponentSelection inner) { + ComponentSelectionWithCurrent wrapped = wrapComponentSelection(inner) + closure.delegate = wrapped + closure(wrapped) + } + }) + return this + } + + ComponentSelectionRulesWithCurrent withModule(Object id, Object ruleSource) { + RuleAction ruleAction = RuleSourceBackedRuleAction.create( + ModelType.of(ComponentSelectionWithCurrent), ruleSource) + delegate.withModule(id, new Action() { + void execute(ComponentSelection inner) { + ruleAction.execute(wrapComponentSelection(inner), []) + } + }) + return this + } + + private ComponentSelectionWithCurrent wrapComponentSelection(ComponentSelection inner) { + Coordinate candidateCoordinate = Coordinate.from(inner.candidate) + Coordinate current = currentCoordinates.get(candidateCoordinate.key) + ComponentSelectionWithCurrent wrapped = new ComponentSelectionWithCurrent(current.version, + inner) + return wrapped + } +} diff --git a/src/main/groovy/com/github/benmanes/gradle/versions/updates/resolutionstrategy/ComponentSelectionWithCurrent.groovy b/src/main/groovy/com/github/benmanes/gradle/versions/updates/resolutionstrategy/ComponentSelectionWithCurrent.groovy new file mode 100644 index 00000000..61bb201b --- /dev/null +++ b/src/main/groovy/com/github/benmanes/gradle/versions/updates/resolutionstrategy/ComponentSelectionWithCurrent.groovy @@ -0,0 +1,13 @@ +package com.github.benmanes.gradle.versions.updates.resolutionstrategy + +import groovy.transform.TupleConstructor +import org.gradle.api.artifacts.ComponentSelection + +@TupleConstructor(includeFields=true) +class ComponentSelectionWithCurrent { + + final String currentVersion + + @Delegate + private final ComponentSelection delegate +} diff --git a/src/main/groovy/com/github/benmanes/gradle/versions/updates/resolutionstrategy/ResolutionStrategyWithCurrent.groovy b/src/main/groovy/com/github/benmanes/gradle/versions/updates/resolutionstrategy/ResolutionStrategyWithCurrent.groovy new file mode 100644 index 00000000..e96f2764 --- /dev/null +++ b/src/main/groovy/com/github/benmanes/gradle/versions/updates/resolutionstrategy/ResolutionStrategyWithCurrent.groovy @@ -0,0 +1,69 @@ +package com.github.benmanes.gradle.versions.updates.resolutionstrategy + +import com.github.benmanes.gradle.versions.updates.Coordinate +import groovy.transform.TupleConstructor +import org.gradle.api.Action +import org.gradle.api.artifacts.DependencyResolveDetails +import org.gradle.api.artifacts.DependencySubstitutions +import org.gradle.api.artifacts.ResolutionStrategy + +@TupleConstructor(includeFields = true) +class ResolutionStrategyWithCurrent { + + @Delegate(interfaces = false, excludes = ['componentSelection', 'getComponentSelection']) + private ResolutionStrategy delegate + + private Map currentCoordinates + + ResolutionStrategyWithCurrent failOnVersionConflict() { + delegate.failOnVersionConflict() + return this + } + + ResolutionStrategyWithCurrent activateDependencyLocking() { + delegate.activateDependencyLocking() + return this + } + + ResolutionStrategyWithCurrent force(Object... moduleVersionSelectorNotations) { + delegate.force(moduleVersionSelectorNotations) + return this + } + + ResolutionStrategyWithCurrent setForcedModules(Object... moduleVersionSelectorNotations) { + delegate.setForcedModules(moduleVersionSelectorNotations) + return this + } + + ResolutionStrategyWithCurrent eachDependency(Action rule) { + delegate.eachDependency(rule) + return this + } + + ComponentSelectionRulesWithCurrent getComponentSelection() { + return new ComponentSelectionRulesWithCurrent(delegate.getComponentSelection(), + currentCoordinates) + } + + ResolutionStrategyWithCurrent componentSelection( + Action action) { + action.execute(getComponentSelection()) + return this + } + + ResolutionStrategyWithCurrent componentSelection(Closure closure) { + return componentSelection(new Action() { + @java.lang.Override + void execute(ComponentSelectionRulesWithCurrent componentSelectionRulesWithCurrent) { + closure.delegate = componentSelectionRulesWithCurrent + closure(componentSelectionRulesWithCurrent) + } + }) + } + + ResolutionStrategyWithCurrent dependencySubstitution( + Action action) { + delegate.dependencySubstitution(action) + return this + } +} diff --git a/src/test/groovy/com/github/benmanes/gradle/versions/ComponentSelectionRuleSourceSpec.groovy b/src/test/groovy/com/github/benmanes/gradle/versions/ComponentSelectionRuleSourceSpec.groovy new file mode 100644 index 00000000..fbfb93dd --- /dev/null +++ b/src/test/groovy/com/github/benmanes/gradle/versions/ComponentSelectionRuleSourceSpec.groovy @@ -0,0 +1,87 @@ +package com.github.benmanes.gradle.versions + +import org.gradle.testkit.runner.GradleRunner +import org.junit.Rule +import org.junit.rules.TemporaryFolder +import spock.lang.Specification +import spock.lang.Unroll + +final class ComponentSelectionRuleSourceSpec extends Specification { + + @Rule TemporaryFolder testProjectDir = new TemporaryFolder() + private File buildFile + private List pluginClasspath + + def 'setup'() { + def pluginClasspathResource = getClass().classLoader.findResource('plugin-classpath.txt') + if (pluginClasspathResource == null) { + throw new IllegalStateException( + 'Did not find plugin classpath resource, run `testClasses` build task.') + } + + pluginClasspath = pluginClasspathResource.readLines().collect { new File(it) } + } + + @Unroll + def 'component selection works with rule-source'() { + given: + def classpathString = pluginClasspath + .collect { it.absolutePath.replace('\\', '\\\\') } // escape backslashes in Windows paths + .collect { "'$it'" } + .join(', ') + def mavenRepoUrl = getClass().getResource('/maven/').toURI() + def srdErrWriter = new StringWriter() + + buildFile = testProjectDir.newFile('build.gradle') + buildFile << + """ + import com.github.benmanes.gradle.versions.updates.resolutionstrategy.ComponentSelectionWithCurrent + + buildscript { + dependencies { + classpath files($classpathString) + } + } + + apply plugin: 'java' + apply plugin: "com.github.ben-manes.versions" + + repositories { + maven { + url '${mavenRepoUrl}' + } + } + + dependencies { + compile 'com.google.inject:guice:2.0' + } + + dependencyUpdates.resolutionStrategy { + componentSelection { + all(new Rule()) + } + } + + class Rule { + + @Mutate + void select(ComponentSelectionWithCurrent selection) { + if (selection.candidate.version == "3.1" && selection.currentVersion == "2.0") { + selection.reject("Guice 3.1 not allowed") + } + } + } + """.stripIndent() + + when: + def result = GradleRunner.create() + .withProjectDir(testProjectDir.root) + .withArguments('dependencyUpdates') + .forwardStdError(srdErrWriter) + .build() + + then: + result.output.contains('com.google.inject:guice [2.0 -> 3.0]') + srdErrWriter.toString().empty + } +} diff --git a/src/test/groovy/com/github/benmanes/gradle/versions/DifferentGradleVersionsSpec.groovy b/src/test/groovy/com/github/benmanes/gradle/versions/DifferentGradleVersionsSpec.groovy index b1336998..a6f4bfa5 100644 --- a/src/test/groovy/com/github/benmanes/gradle/versions/DifferentGradleVersionsSpec.groovy +++ b/src/test/groovy/com/github/benmanes/gradle/versions/DifferentGradleVersionsSpec.groovy @@ -55,6 +55,16 @@ final class DifferentGradleVersionsSpec extends Specification { dependencies { compile 'com.google.inject:guice:2.0' } + + dependencyUpdates.resolutionStrategy { + componentSelection { + all { + if (candidate.version == "3.1" && currentVersion == "2.0") { + reject("Guice 3.1 not allowed") + } + } + } + } """.stripIndent() when: @@ -71,7 +81,6 @@ final class DifferentGradleVersionsSpec extends Specification { where: gradleVersion << [ - '2.0', '3.3', '3.4', '3.5', @@ -86,7 +95,13 @@ final class DifferentGradleVersionsSpec extends Specification { '4.8', '4.9', '4.10', - '5.0' + '5.0', + '5.1.1', + '5.2.1', + '5.3.1', + '5.4.1', + '5.5.1', + '5.6.1' ] } diff --git a/src/test/groovy/com/github/benmanes/gradle/versions/JavaLibrarySpec.groovy b/src/test/groovy/com/github/benmanes/gradle/versions/JavaLibrarySpec.groovy index 64d19e8e..fb199680 100644 --- a/src/test/groovy/com/github/benmanes/gradle/versions/JavaLibrarySpec.groovy +++ b/src/test/groovy/com/github/benmanes/gradle/versions/JavaLibrarySpec.groovy @@ -43,7 +43,7 @@ final class JavaLibrarySpec extends Specification { .build() then: - result.output.contains('com.google.inject:guice [2.0 -> 3.0]') + result.output.contains('com.google.inject:guice [2.0 -> 3.1]') result.task(':dependencyUpdates').outcome == SUCCESS } } diff --git a/src/test/groovy/com/github/benmanes/gradle/versions/KotlinDslUsageSpec.groovy b/src/test/groovy/com/github/benmanes/gradle/versions/KotlinDslUsageSpec.groovy index 94d4fb07..0a0c4d1d 100644 --- a/src/test/groovy/com/github/benmanes/gradle/versions/KotlinDslUsageSpec.groovy +++ b/src/test/groovy/com/github/benmanes/gradle/versions/KotlinDslUsageSpec.groovy @@ -46,8 +46,8 @@ final class KotlinDslUsageSpec extends Specification { resolutionStrategy { componentSelection { all { - if (candidate.version == "3.0") { - reject("Guava 3.0 not allowed") + if (candidate.version == "3.1" && currentVersion != "") { + reject("Guice 3.1 not allowed") } } } @@ -66,8 +66,7 @@ final class KotlinDslUsageSpec extends Specification { .build() then: - result.output.contains('''Failed to determine the latest version for the following dependencies (use --info for details): - | - com.google.inject:guice'''.stripMargin()) + result.output.contains('''com.google.inject:guice [2.0 -> 3.0]''') srdErrWriter.toString().empty where: diff --git a/src/test/resources/maven/com/google/inject/guice/2.2/guice-2.2.pom b/src/test/resources/maven/com/google/inject/guice/2.2/guice-2.2.pom new file mode 100644 index 00000000..55e550d5 --- /dev/null +++ b/src/test/resources/maven/com/google/inject/guice/2.2/guice-2.2.pom @@ -0,0 +1,240 @@ + + + + 4.0.0 + + + com.google.inject + guice-parent + 3.0 + + + guice + + Google Guice - Core Library + + + 2.2.1-v20090111 + + + + + javax.inject + javax.inject + 1 + + + aopalliance + aopalliance + 1.0 + + + + org.sonatype.sisu.inject + cglib + ${cglib.version} + + + javax.inject + javax.inject-tck + 1 + test + + + org.springframework + spring-beans + 3.0.5.RELEASE + test + + + biz.aQute + bnd + 0.0.384 + test + + + org.apache.felix + org.apache.felix.framework + 3.0.5 + test + + + + + + + + maven-remote-resources-plugin + + + + org.codehaus.mojo + animal-sniffer-maven-plugin + + + maven-surefire-plugin + + + + **/OSGiContainerTest* + **/ScopesTest* + **/TypeConversionTest* + + + + + + org.apache.felix + maven-bundle-plugin + + + + maven-jar-plugin + + + LICENSE + NOTICE + + + + + + + + + + guice.with.no_aop + + + guice.with.no_aop + !false + + + + + + org.sonatype.plugins + munge-maven-plugin + 1.0 + + + prepare-package + + munge-fork + + + NO_AOP + + **/InterceptorBinding.java, + **/InterceptorBindingProcessor.java, + **/InterceptorStackCallback.java, + **/LineNumbers.java, + **/MethodAspect.java, + **/ProxyFactory.java, + **/BytecodeGenTest.java, + **/IntegrationTest.java, + **/MethodInterceptionTest.java, + **/ProxyFactoryTest.java + + + + + + + + maven-jar-plugin + + + no_aop + package + + jar + + + ${project.build.directory}/munged/classes + no_aop + + ${project.build.directory}/munged/classes/META-INF/MANIFEST.MF + + + + + + + + + + + guice.with.jarjar + + + guice.with.jarjar + !false + + + + + + org.sonatype.sisu.inject + cglib + ${cglib.version} + true + + + + + + org.sonatype.plugins + jarjar-maven-plugin + + + *:asm + *:cglib + + + + + + maven-jar-plugin + + + no_deps + package + + jar + + + ${project.build.directory}/original-classes + no_deps + + + + + + + + + + diff --git a/src/test/resources/maven/com/google/inject/guice/3.1/guice-3.1.pom b/src/test/resources/maven/com/google/inject/guice/3.1/guice-3.1.pom new file mode 100644 index 00000000..66674ec4 --- /dev/null +++ b/src/test/resources/maven/com/google/inject/guice/3.1/guice-3.1.pom @@ -0,0 +1,241 @@ + + + + 4.0.0 + + + com.google.inject + guice-parent + 3.0 + + + guice + 3.1 + + Google Guice - Core Library + + + 2.2.1-v20090111 + + + + + javax.inject + javax.inject + 1 + + + aopalliance + aopalliance + 1.0 + + + + org.sonatype.sisu.inject + cglib + ${cglib.version} + + + javax.inject + javax.inject-tck + 1 + test + + + org.springframework + spring-beans + 3.0.5.RELEASE + test + + + biz.aQute + bnd + 0.0.384 + test + + + org.apache.felix + org.apache.felix.framework + 3.0.5 + test + + + + + + + + maven-remote-resources-plugin + + + + org.codehaus.mojo + animal-sniffer-maven-plugin + + + maven-surefire-plugin + + + + **/OSGiContainerTest* + **/ScopesTest* + **/TypeConversionTest* + + + + + + org.apache.felix + maven-bundle-plugin + + + + maven-jar-plugin + + + LICENSE + NOTICE + + + + + + + + + + guice.with.no_aop + + + guice.with.no_aop + !false + + + + + + org.sonatype.plugins + munge-maven-plugin + 1.0 + + + prepare-package + + munge-fork + + + NO_AOP + + **/InterceptorBinding.java, + **/InterceptorBindingProcessor.java, + **/InterceptorStackCallback.java, + **/LineNumbers.java, + **/MethodAspect.java, + **/ProxyFactory.java, + **/BytecodeGenTest.java, + **/IntegrationTest.java, + **/MethodInterceptionTest.java, + **/ProxyFactoryTest.java + + + + + + + + maven-jar-plugin + + + no_aop + package + + jar + + + ${project.build.directory}/munged/classes + no_aop + + ${project.build.directory}/munged/classes/META-INF/MANIFEST.MF + + + + + + + + + + + guice.with.jarjar + + + guice.with.jarjar + !false + + + + + + org.sonatype.sisu.inject + cglib + ${cglib.version} + true + + + + + + org.sonatype.plugins + jarjar-maven-plugin + + + *:asm + *:cglib + + + + + + maven-jar-plugin + + + no_deps + package + + jar + + + ${project.build.directory}/original-classes + no_deps + + + + + + + + + + diff --git a/src/test/resources/maven/com/google/inject/guice/maven-metadata.xml b/src/test/resources/maven/com/google/inject/guice/maven-metadata.xml index 70c1249c..b90c67ab 100644 --- a/src/test/resources/maven/com/google/inject/guice/maven-metadata.xml +++ b/src/test/resources/maven/com/google/inject/guice/maven-metadata.xml @@ -8,7 +8,10 @@ 1.0 2.0 + 2.1 + 2.2 3.0 + 3.1 20100320162336