From 074cf5ba40bd21bcbdd58fad85465e8ea5ccbe0c Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sun, 10 May 2009 10:06:36 +0000 Subject: [PATCH] [MPLUGIN-150] Update to QDox 1.9.1 o Updated dependency and added IT to motivate update git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@773320 13f79535-47bb-0310-9956-ffa450edef68 --- .../ignore-plugin-class-realm/dep-a/pom.xml | 40 ++++++++++ .../dep-a/src/main/java/test/ClassA.java | 5 ++ .../ignore-plugin-class-realm/dep-b/pom.xml | 48 ++++++++++++ .../dep-b/src/main/java/test/ClassB.java | 14 ++++ .../invoker.properties | 5 ++ .../src/it/ignore-plugin-class-realm/pom.xml | 64 ++++++++++++++++ .../it/ignore-plugin-class-realm/test/pom.xml | 73 +++++++++++++++++++ .../test/src/main/java/test/SomeMojo.java | 15 ++++ maven-plugin-tools-java/pom.xml | 2 +- 9 files changed, 265 insertions(+), 1 deletion(-) create mode 100644 maven-plugin-plugin/src/it/ignore-plugin-class-realm/dep-a/pom.xml create mode 100644 maven-plugin-plugin/src/it/ignore-plugin-class-realm/dep-a/src/main/java/test/ClassA.java create mode 100644 maven-plugin-plugin/src/it/ignore-plugin-class-realm/dep-b/pom.xml create mode 100644 maven-plugin-plugin/src/it/ignore-plugin-class-realm/dep-b/src/main/java/test/ClassB.java create mode 100644 maven-plugin-plugin/src/it/ignore-plugin-class-realm/invoker.properties create mode 100644 maven-plugin-plugin/src/it/ignore-plugin-class-realm/pom.xml create mode 100644 maven-plugin-plugin/src/it/ignore-plugin-class-realm/test/pom.xml create mode 100644 maven-plugin-plugin/src/it/ignore-plugin-class-realm/test/src/main/java/test/SomeMojo.java diff --git a/maven-plugin-plugin/src/it/ignore-plugin-class-realm/dep-a/pom.xml b/maven-plugin-plugin/src/it/ignore-plugin-class-realm/dep-a/pom.xml new file mode 100644 index 0000000..8c772fe --- /dev/null +++ b/maven-plugin-plugin/src/it/ignore-plugin-class-realm/dep-a/pom.xml @@ -0,0 +1,40 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.plugin + ipcr + 1.0 + + + ipcr-dep-a + jar + + Dependency A + + Test that the component used to scan sources for annotations does not analyze classes from the plugin's own class + realm while traversing the class hierarchy (see QDOX-148). This module provides a simple dependency to build up + the class realm of interest. + + diff --git a/maven-plugin-plugin/src/it/ignore-plugin-class-realm/dep-a/src/main/java/test/ClassA.java b/maven-plugin-plugin/src/it/ignore-plugin-class-realm/dep-a/src/main/java/test/ClassA.java new file mode 100644 index 0000000..a813ec4 --- /dev/null +++ b/maven-plugin-plugin/src/it/ignore-plugin-class-realm/dep-a/src/main/java/test/ClassA.java @@ -0,0 +1,5 @@ +package test; + +public class ClassA +{ +} diff --git a/maven-plugin-plugin/src/it/ignore-plugin-class-realm/dep-b/pom.xml b/maven-plugin-plugin/src/it/ignore-plugin-class-realm/dep-b/pom.xml new file mode 100644 index 0000000..254d8d6 --- /dev/null +++ b/maven-plugin-plugin/src/it/ignore-plugin-class-realm/dep-b/pom.xml @@ -0,0 +1,48 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.plugin + ipcr + 1.0 + + + ipcr-dep-b + jar + + Dependency B + + Test that the component used to scan sources for annotations does not analyze classes from the plugin's own class + realm while traversing the class hierarchy (see QDOX-148). This module provides a simple dependency to build up + the class realm of interest. + + + + + org.apache.maven.its.plugin + ipcr-dep-a + 1.0 + + + diff --git a/maven-plugin-plugin/src/it/ignore-plugin-class-realm/dep-b/src/main/java/test/ClassB.java b/maven-plugin-plugin/src/it/ignore-plugin-class-realm/dep-b/src/main/java/test/ClassB.java new file mode 100644 index 0000000..e72de12 --- /dev/null +++ b/maven-plugin-plugin/src/it/ignore-plugin-class-realm/dep-b/src/main/java/test/ClassB.java @@ -0,0 +1,14 @@ +package test; + +public class ClassB +{ + + /** + * For the test we want to trigger a linkage error when resolving ClassA. However, we want this error to occur when + * analyzing ClassB and not when loading ClassB itself. + */ + public void triggerLazyLinkageError(ClassA param) + { + } + +} diff --git a/maven-plugin-plugin/src/it/ignore-plugin-class-realm/invoker.properties b/maven-plugin-plugin/src/it/ignore-plugin-class-realm/invoker.properties new file mode 100644 index 0000000..0fd616a --- /dev/null +++ b/maven-plugin-plugin/src/it/ignore-plugin-class-realm/invoker.properties @@ -0,0 +1,5 @@ +invoker.goals.1 = clean install +invoker.profiles.1 = setup + +invoker.goals.2 = clean process-classes +invoker.profiles.2 = test diff --git a/maven-plugin-plugin/src/it/ignore-plugin-class-realm/pom.xml b/maven-plugin-plugin/src/it/ignore-plugin-class-realm/pom.xml new file mode 100644 index 0000000..1d9752d --- /dev/null +++ b/maven-plugin-plugin/src/it/ignore-plugin-class-realm/pom.xml @@ -0,0 +1,64 @@ + + + + + + 4.0.0 + + org.apache.maven.its.plugin + ipcr + 1.0 + pom + + Aggregator + + Test that the component used to scan sources for annotations does not analyze classes from the plugin's own class + realm while traversing the class hierarchy (see QDOX-148). + + + + + + setup + + dep-a + dep-b + + + + + test + + test + + + + + + org.apache.maven.plugins + maven-plugin-plugin + @project.version@ + + + + + + + diff --git a/maven-plugin-plugin/src/it/ignore-plugin-class-realm/test/pom.xml b/maven-plugin-plugin/src/it/ignore-plugin-class-realm/test/pom.xml new file mode 100644 index 0000000..df1dd9e --- /dev/null +++ b/maven-plugin-plugin/src/it/ignore-plugin-class-realm/test/pom.xml @@ -0,0 +1,73 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.plugin + ipcr + 1.0 + + + ipcr-plugin + maven-plugin + + Test Plugin + + Test that the component used to scan sources for annotations does not analyze classes from the plugin's own class + realm while traversing the class hierarchy (see QDOX-148). This module provides the plugin sources to scan. + + + + + + org.apache.maven.its.plugin + ipcr-dep-b + 1.0 + + + + + + + org.apache.maven.plugins + maven-plugin-plugin + + + org.apache.maven.its.plugin + ipcr-dep-b + 1.0 + + + org.apache.maven.its.plugin + ipcr-dep-a + + + + + + + + diff --git a/maven-plugin-plugin/src/it/ignore-plugin-class-realm/test/src/main/java/test/SomeMojo.java b/maven-plugin-plugin/src/it/ignore-plugin-class-realm/test/src/main/java/test/SomeMojo.java new file mode 100644 index 0000000..f378d2b --- /dev/null +++ b/maven-plugin-plugin/src/it/ignore-plugin-class-realm/test/src/main/java/test/SomeMojo.java @@ -0,0 +1,15 @@ +package test; + +/** + * This is the source class to be scanned for annotations. While scanning, QDox must not try to resolve references to + * other types like the super class from the plugin class realm. The plugin class realm has no relation at all to + * the project class path. In particular, the plugin class realm could (by incident) contain different versions of those + * types or could be incomplete (due to exclusions). The later case leads to NoClassDefFoundErrors, crashing the scan. + * + * @goal test + */ +public class SomeMojo + extends ClassB +{ + +} diff --git a/maven-plugin-tools-java/pom.xml b/maven-plugin-tools-java/pom.xml index 1a8a67e..c5a7b62 100644 --- a/maven-plugin-tools-java/pom.xml +++ b/maven-plugin-tools-java/pom.xml @@ -74,7 +74,7 @@ com.thoughtworks.qdox qdox - 1.6.3 + 1.9.1