You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2018/10/10 04:42:25 UTC
[maven-plugin-tools] branch master updated: add some testing for
annotation inheritance but not sure we need it...
This is an automated email from the ASF dual-hosted git repository.
olamy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git
The following commit(s) were added to refs/heads/master by this push:
new 8bd74fc add some testing for annotation inheritance but not sure we need it...
8bd74fc is described below
commit 8bd74fc4db0531e650cd1a795f85211001ff816a
Author: olivier lamy <ol...@apache.org>
AuthorDate: Wed Oct 10 14:42:10 2018 +1000
add some testing for annotation inheritance but not sure we need it...
Signed-off-by: olivier lamy <ol...@apache.org>
---
.../extractor/annotations/AbstractFooMojo.java | 30 ++++++++++++++++++++++
.../plugin/extractor/annotations/FooMojo.java | 2 +-
.../annotations/TestAnnotationsReader.java | 3 +--
3 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/AbstractFooMojo.java b/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/AbstractFooMojo.java
new file mode 100644
index 0000000..2cfd97d
--- /dev/null
+++ b/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/AbstractFooMojo.java
@@ -0,0 +1,30 @@
+package org.apache.maven.tools.plugin.extractor.annotations;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+
+@Mojo(name = "abstract", requiresDependencyResolution = ResolutionScope.COMPILE, requiresDependencyCollection = ResolutionScope.COMPILE)
+public abstract class AbstractFooMojo
+ extends AbstractMojo
+{
+}
diff --git a/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/FooMojo.java b/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/FooMojo.java
index 673f8b1..95b339d 100644
--- a/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/FooMojo.java
+++ b/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/FooMojo.java
@@ -36,7 +36,7 @@ import org.codehaus.plexus.compiler.manager.CompilerManager;
@Mojo( name = "foo", defaultPhase = LifecyclePhase.COMPILE, threadSafe = true )
@Execute( goal = "compiler", lifecycle = "my-lifecycle", phase = LifecyclePhase.PACKAGE )
public class FooMojo
- extends AbstractMojo
+ extends AbstractFooMojo
{
/**
* the cool bar to go
diff --git a/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/TestAnnotationsReader.java b/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/TestAnnotationsReader.java
index d39123a..be625d6 100644
--- a/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/TestAnnotationsReader.java
+++ b/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/TestAnnotationsReader.java
@@ -19,7 +19,6 @@ package org.apache.maven.tools.plugin.extractor.annotations;
* under the License.
*/
-import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugins.annotations.Execute;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
@@ -63,7 +62,7 @@ public class TestAnnotationsReader
MojoAnnotatedClass mojoAnnotatedClass = mojoAnnotatedClasses.values().iterator().next();
assertEquals( FooMojo.class.getName(), mojoAnnotatedClass.getClassName() );
- assertEquals( AbstractMojo.class.getName(), mojoAnnotatedClass.getParentClassName() );
+ assertEquals( AbstractFooMojo.class.getName(), mojoAnnotatedClass.getParentClassName() );
Mojo mojo = mojoAnnotatedClass.getMojo();