From c46422fe0d1e120f222127c0b4e1a07b9f2e11ca Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Sun, 24 Jun 2012 20:59:37 +0000 Subject: [PATCH] [MPLUGIN-216] fixed default dependency resolution value as none for java 5 annotations git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1353331 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/maven/plugins/annotations/Mojo.java | 4 ++-- .../apache/maven/plugins/annotations/ResolutionScope.java | 4 ++++ .../it/annotation-with-inheritance-from-deps/verify.groovy | 2 +- .../it/annotation-with-inheritance-reactor/verify.groovy | 2 +- .../src/it/annotation-with-inheritance/verify.groovy | 2 +- .../src/it/java-basic-annotations/verify.groovy | 6 +++--- .../plugin/annotations/datamodel/MojoAnnotationContent.java | 4 ++-- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java index ff55a71..13bc2db 100644 --- a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java +++ b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/Mojo.java @@ -54,13 +54,13 @@ public @interface Mojo * the required dependency resolution scope. * @return */ - ResolutionScope requiresDependencyResolution() default ResolutionScope.RUNTIME; + ResolutionScope requiresDependencyResolution() default ResolutionScope.NONE; /** * the required dependency collection scope. * @return */ - ResolutionScope requiresDependencyCollection() default ResolutionScope.RUNTIME; + ResolutionScope requiresDependencyCollection() default ResolutionScope.NONE; /** * your Mojo instantiation strategy. (Only per-lookup and singleton are supported) diff --git a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/ResolutionScope.java b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/ResolutionScope.java index 572cd44..f8eaf61 100644 --- a/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/ResolutionScope.java +++ b/maven-plugin-annotations/src/main/java/org/apache/maven/plugins/annotations/ResolutionScope.java @@ -30,6 +30,10 @@ import org.apache.maven.artifact.Artifact; */ public enum ResolutionScope { + /** + * empty resolution scope + */ + NONE( null ), /** * compile resolution scope * = compile + system + provided dependencies diff --git a/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/verify.groovy b/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/verify.groovy index 43316be..6aefc31 100644 --- a/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/verify.groovy +++ b/maven-plugin-plugin/src/it/annotation-with-inheritance-from-deps/verify.groovy @@ -18,7 +18,7 @@ assert mojo.language.text() == 'java' assert mojo.description.text() == 'Touches a test file.' assert mojo.deprecated.text() == "Don't use!" assert mojo.requiresDependencyResolution.text() == 'test' -assert mojo.requiresDependencyCollection.text() == 'runtime' +assert mojo.requiresDependencyCollection.text() == '' assert mojo.requiresProject.text() == 'true' assert mojo.requiresOnline.text() == 'false' assert mojo.requiresDirectInvocation.text() == 'false' diff --git a/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/verify.groovy b/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/verify.groovy index b76ba5f..7659c5d 100644 --- a/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/verify.groovy +++ b/maven-plugin-plugin/src/it/annotation-with-inheritance-reactor/verify.groovy @@ -16,7 +16,7 @@ assert mojo.language.text() == 'java' assert mojo.description.text() == 'Touches a test file.' assert mojo.deprecated.text() == "Don't use!" assert mojo.requiresDependencyResolution.text() == 'test' -assert mojo.requiresDependencyCollection.text() == 'runtime' +assert mojo.requiresDependencyCollection.text() == '' assert mojo.requiresProject.text() == 'true' assert mojo.requiresOnline.text() == 'false' assert mojo.requiresDirectInvocation.text() == 'false' diff --git a/maven-plugin-plugin/src/it/annotation-with-inheritance/verify.groovy b/maven-plugin-plugin/src/it/annotation-with-inheritance/verify.groovy index 53f6191..d80de86 100644 --- a/maven-plugin-plugin/src/it/annotation-with-inheritance/verify.groovy +++ b/maven-plugin-plugin/src/it/annotation-with-inheritance/verify.groovy @@ -20,7 +20,7 @@ assert mojo.language.text() == 'java' assert mojo.description.text() == 'Touches a test file.' assert mojo.deprecated.text() == "Don't use!" assert mojo.requiresDependencyResolution.text() == 'compile' -assert mojo.requiresDependencyCollection.text() == 'runtime' +assert mojo.requiresDependencyCollection.text() == '' assert mojo.requiresProject.text() == 'true' assert mojo.requiresOnline.text() == 'false' assert mojo.requiresDirectInvocation.text() == 'false' diff --git a/maven-plugin-plugin/src/it/java-basic-annotations/verify.groovy b/maven-plugin-plugin/src/it/java-basic-annotations/verify.groovy index cef9399..c49b7fb 100644 --- a/maven-plugin-plugin/src/it/java-basic-annotations/verify.groovy +++ b/maven-plugin-plugin/src/it/java-basic-annotations/verify.groovy @@ -14,7 +14,7 @@ assert mojo.language.text() == 'java' assert mojo.description.text() == 'Touches a test file.' assert mojo.deprecated.text() == "Don't use!" assert mojo.requiresDependencyResolution.text() == 'test' -assert mojo.requiresDependencyCollection.text() == 'runtime' +assert mojo.requiresDependencyCollection.text() == '' assert mojo.requiresProject.text() == 'true' assert mojo.requiresOnline.text() == 'false' assert mojo.requiresDirectInvocation.text() == 'false' @@ -140,8 +140,8 @@ assert mojo.implementation.text() == 'org.apache.maven.plugin.coreit.Minimal' assert mojo.language.text() == 'java' assert mojo.description.text() == '' assert mojo.deprecated.text() == '' -assert mojo.requiresDependencyResolution.text() == 'runtime' -assert mojo.requiresDependencyCollection.text() == 'runtime' +assert mojo.requiresDependencyResolution.text() == '' +assert mojo.requiresDependencyCollection.text() == '' assert mojo.requiresProject.text() == 'true' assert mojo.requiresOnline.text() == 'false' assert mojo.requiresDirectInvocation.text() == 'false' diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/MojoAnnotationContent.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/MojoAnnotationContent.java index 660fa71..84ab739 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/MojoAnnotationContent.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/datamodel/MojoAnnotationContent.java @@ -38,9 +38,9 @@ public class MojoAnnotationContent private LifecyclePhase defaultPhase = LifecyclePhase.NONE; - private ResolutionScope requiresDependencyResolution = ResolutionScope.RUNTIME; + private ResolutionScope requiresDependencyResolution = ResolutionScope.NONE; - private ResolutionScope requiresDependencyCollection = ResolutionScope.RUNTIME; + private ResolutionScope requiresDependencyCollection = ResolutionScope.NONE; private InstanciationStrategy instantiationStrategy = InstanciationStrategy.PER_LOOKUP;