diff -Nru plexus-containers-1.0~beta3.0.7/debian/changelog plexus-containers-1.7.1/debian/changelog
--- plexus-containers-1.0~beta3.0.7/debian/changelog 2017-07-24 12:54:38.000000000 +0000
+++ plexus-containers-1.7.1/debian/changelog 2017-11-07 12:32:00.000000000 +0000
@@ -1,95 +1,175 @@
-plexus-containers (1.0~beta3.0.7-9) unstable; urgency=medium
+plexus-containers (1.7.1-7) unstable; urgency=medium
* Team upload.
- * Build with maven-debian-helper instead of maven-ant-helper
- * Moved the package to Git
+ * Renamed the libplexus-container-default1.5-java package to
+ libplexus-container-default-java (but keep a transitional package)
+ * Removed libplexus-containers1.5-java (no longer used)
+ * Relocate the version 1.5.5 of the plexus-component-metadata plugin
+ to the current version instead of patching the pom
+
+ -- Emmanuel Bourg Tue, 07 Nov 2017 13:32:00 +0100
+
+plexus-containers (1.7.1-6) unstable; urgency=medium
+
+ * Team upload.
+ * Renamed the package to plexus-containers
+ * Install the Maven artifacts for plexus-component-annotations and
+ plexus-container-default with the 'debian' generic version and relocate
+ the version 1.5.5
+ * Install versionless jars in /usr/share/java but keep compatibility links
+ * Depend on libplexus-classworlds-java (>= 2.5.2)
+ instead of libplexus-classworlds2-java
+ * Removed the unused Maven rule for plexus-component-javadoc
+ * Standards-Version updated to 4.1.1
+
+ -- Emmanuel Bourg Tue, 07 Nov 2017 11:22:49 +0100
+
+plexus-containers1.5 (1.7.1-5) unstable; urgency=medium
+
+ * Team upload.
+ * Depend on libxbean-reflect-java instead of libxbean-java
+ * Standards-Version updated to 4.1.0
+ * Documented the upstream bug for 03-reproducible-metadata.patch
+
+ -- Emmanuel Bourg Mon, 18 Sep 2017 13:07:31 +0200
+
+plexus-containers1.5 (1.7.1-4) unstable; urgency=medium
+
+ * Team upload.
+ * Depend on libmaven3-core-java instead of libmaven2-core-java
+
+ -- Emmanuel Bourg Sun, 30 Jul 2017 01:17:10 +0200
+
+plexus-containers1.5 (1.7.1-3) unstable; urgency=medium
+
+ * Team upload.
+ * Fixed the compatibility with qdox 2.0~M5
+
+ -- Emmanuel Bourg Fri, 30 Jun 2017 22:34:09 +0200
+
+plexus-containers1.5 (1.7.1-2) unstable; urgency=medium
+
+ * Team upload.
+ * Added a symlink for plexus-component-annotations-1.5-1.6.jar
+ in /usr/share/java to work around a gradle issue (see #865499)
* Standards-Version updated to 4.0.0
- * Switch to debhelper level 10
- * Updated the Homepage field
- * Track and download the releases from GitHub
- * Converted debian/copyright to the Copyright Format 1.0
- -- Emmanuel Bourg Mon, 24 Jul 2017 14:54:38 +0200
+ -- Emmanuel Bourg Fri, 23 Jun 2017 09:57:14 +0200
-plexus-containers (1.0~beta3.0.7-8) unstable; urgency=medium
+plexus-containers1.5 (1.7.1-1) unstable; urgency=medium
* Team upload.
- * No longer build plexus-component-javadoc (never used)
- * Set the locale when generating the javadoc to make the build reproducible
- * Standards-Version updated to 3.9.7 (no changes)
- * Switch to debhelper level 9
+ * Upload to unstable
- -- Emmanuel Bourg Fri, 12 Feb 2016 10:03:38 +0100
+ -- Emmanuel Bourg Mon, 19 Jun 2017 15:34:19 +0200
-plexus-containers (1.0~beta3.0.7-7) unstable; urgency=low
+plexus-containers1.5 (1.7.1-1~exp2) experimental; urgency=medium
* Team upload.
- * Replaced Google Collections by Guava in the pom installed
- in /usr/share/maven-repo (Closes: #724149)
+ * Ensure that libplexus-component-metadata-java pulls the same version
+ of libplexus-container-default1.5-java
+
+ -- Emmanuel Bourg Mon, 22 May 2017 17:19:22 +0200
+
+plexus-containers1.5 (1.7.1-1~exp1) experimental; urgency=medium
+
+ * New upstream release
+ - Refreshed the patches
+ - Depend on libjdom2-java instead of libjdom1-java
+ * Updated the URL of the project homepage
+ * Switch to debhelper level 10
- -- Emmanuel Bourg Mon, 23 Sep 2013 13:00:53 +0200
+ -- Emmanuel Bourg Thu, 18 May 2017 14:48:04 +0200
-plexus-containers (1.0~beta3.0.7-6) unstable; urgency=low
+plexus-containers1.5 (1.6-3) unstable; urgency=medium
* Team upload.
- * Replaced the dependency on Google Collections by Guava
- * Use canonical URLs for the Vcs-* fields
- * debian/rules: Improved the clean target to allow rebuilds
+ * Depend on libasm-java (>= 5.0) instead of libasm4-java
+ * Standards-Version updated to 3.9.8
+ * Use a secure Vcs-Git URL
+
+ -- Emmanuel Bourg Tue, 27 Sep 2016 23:55:07 +0200
+
+plexus-containers1.5 (1.6-2) unstable; urgency=medium
- -- Emmanuel Bourg Wed, 11 Sep 2013 19:13:31 +0200
+ * Team upload.
+ * Build with maven-debian-helper
+ * Sort the components in the components.xml files generated by the metadata
+ plugin. This should improve the reproducibility of the packages affected
+ by the random_order_in_plexus_comonents_xml issue.
+ * Moved the artifact to distinct packages to optimize the dependencies
+ * No longer build plexus-component-javadoc (never used)
+ * Removed the unused -doc package
+ * Depend on libqdox2-java instead of libqdox-java
+ * Updated Standards-Version to 3.9.7 (no changes)
+ * Updated the URL of the project homepage
+
+ -- Emmanuel Bourg Fri, 12 Feb 2016 18:38:36 +0100
-plexus-containers (1.0~beta3.0.7-5) unstable; urgency=low
+plexus-containers1.5 (1.6-1) unstable; urgency=medium
* Team upload.
- * Fix FTBFS with libgoogle-collections >= 1.0,
- closes: #625972, #628328, #628294
- * Bump to Standards-Version 3.9.2: no changes needed.
- * Bump Debhelper compat level to 7.
+ * New upstream release
+ - Removed 01-classworlds-compatibility.patch (fixed upstream)
+ - Depend on asm4 instead of asm3 (Closes: #800862)
+ - Build depend on junit4 instead of junit
+ - Reverted the update to qdox 2 (not yet in Debian)
+ * Improved the reproducibility:
+ - Set the locale and disable the timestamps when generating the javadoc
+ * debian/watch: Track the release tags on GitHub
+ * Updated Standards-Version to 3.9.6 (no changes)
- -- Damien Raude-Morvan Tue, 31 May 2011 02:41:40 +0200
+ -- Emmanuel Bourg Thu, 19 Nov 2015 19:27:19 +0100
-plexus-containers (1.0~beta3.0.7-4) unstable; urgency=low
+plexus-containers1.5 (1.5.5-6) unstable; urgency=low
- * Downgrade Build-Depends: default-jdk.
- * Update Standards-Version: 3.8.4.
- * Switch to source format 3.0.
+ * Team upload.
+ * Added a patch to fix the source incompatibility with plexus-classworlds 2.5
+ (Closes: #728171)
+ * Updated Standards-Version to 3.9.5 (no changes)
+ * Build depend on debhelper >= 9
- -- Torsten Werner Wed, 05 May 2010 07:28:43 +0200
+ -- Emmanuel Bourg Tue, 29 Oct 2013 11:10:33 +0100
-plexus-containers (1.0~beta3.0.7-3) unstable; urgency=low
+plexus-containers1.5 (1.5.5-5) unstable; urgency=low
- * Add versioned Conflicts: libplexus-container-default-java. (Closes:
- #542055)
+ * Team upload.
+ * Replaced the dependency on Google Collections by Guava
+ * Use canonical URLs for the Vcs-* fields
+ * debian/rules: Improved the clean target to allow rebuilds
+ * debian/copyright: Updated the Format URI to 1.0
- -- Torsten Werner Mon, 17 Aug 2009 20:14:42 +0200
+ -- Emmanuel Bourg Mon, 17 Jun 2013 13:38:11 +0200
-plexus-containers (1.0~beta3.0.7-2) unstable; urgency=low
+plexus-containers1.5 (1.5.5-4) unstable; urgency=low
+ * Team upload.
* Upload to unstable.
+ * Update gbp.conf to point to master branch.
- -- Torsten Werner Sun, 09 Aug 2009 23:38:52 +0200
+ -- tony mancill Sun, 02 Jun 2013 10:50:42 -0700
-plexus-containers (1.0~beta3.0.7-1) experimental; urgency=low
+plexus-containers1.5 (1.5.5-3) experimental; urgency=low
- * New upstream version, add myself to Uploaders.
- * Change section to java, bump Standards-Version to 3.8.1
- * Add the Maven POM to the package,
- * Add a Build-Depends-Indep dependency on maven-repo-helper
- * Use mh_installpom and mh_installjar to install the POM and the jar to the
- Maven repository
- * Fix Lintian warning: Add ${misc:Depend} to libplexus-containers-java-doc
- * Remove Depends on Java runtimes as it is a library
+ * Team upload.
+ * Drop dependency on libmaven-plugin-tools-java to break cycle
+ (Closes: #702363).
+ * Updated standards version to 3.9.4
- -- Ludovic Claude Tue, 24 Mar 2009 00:33:14 +0000
+ -- Thomas Koch Tue, 05 Mar 2013 19:18:57 +0100
-plexus-containers (1.0~beta2-2) unstable; urgency=low
+plexus-containers1.5 (1.5.5-2) unstable; urgency=low
- * Add missing Depends.
+ * d/maven.rules: Force version to 1.5.5.
+ * d/control: Remove Ludovic and Torsten from Uploaders: I've added them by
+ cut-paste from old package, without their approval
+ (feel free to re-add yourself if you want).
+ * d/orig-tar.sh: Remove svn tarball handling.
- -- Torsten Werner Fri, 26 Dec 2008 00:55:46 +0100
+ -- Damien Raude-Morvan Sun, 22 Jan 2012 14:50:45 +0100
-plexus-containers (1.0~beta2-1) unstable; urgency=low
+plexus-containers1.5 (1.5.5-1) unstable; urgency=low
- * Initial release. (Closes: #507272)
+ * New upstream release (needed for Maven 3) (Closes: #649783).
- -- Torsten Werner Fri, 05 Dec 2008 10:10:34 +0100
+ -- Damien Raude-Morvan Mon, 28 Nov 2011 22:55:21 +0100
diff -Nru plexus-containers-1.0~beta3.0.7/debian/clean plexus-containers-1.7.1/debian/clean
--- plexus-containers-1.0~beta3.0.7/debian/clean 2017-07-24 11:28:14.000000000 +0000
+++ plexus-containers-1.7.1/debian/clean 1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-plexus-component-metadata/pom.xml
diff -Nru plexus-containers-1.0~beta3.0.7/debian/control plexus-containers-1.7.1/debian/control
--- plexus-containers-1.0~beta3.0.7/debian/control 2017-07-24 12:23:12.000000000 +0000
+++ plexus-containers-1.7.1/debian/control 2017-11-07 12:13:51.000000000 +0000
@@ -2,73 +2,86 @@
Section: java
Priority: optional
Maintainer: Debian Java Maintainers
-Uploaders:
- Torsten Werner ,
- Ludovic Claude
+Uploaders: Damien Raude-Morvan
Build-Depends:
debhelper (>= 10),
default-jdk,
- junit,
+ junit4,
+ libasm-java (>= 5.0),
+ libcommons-cli-java,
libguava-java,
- libmaven-javadoc-plugin-java,
- libplexus-classworlds-java,
- libplexus-utils-java,
- libxbean-java,
- maven-debian-helper (>= 2.2)
-Standards-Version: 4.0.0
+ libjdom2-java,
+ libmaven3-core-java,
+ libplexus-classworlds-java (>= 2.5.2),
+ libplexus-cli-java,
+ libplexus-utils2-java,
+ libqdox2-java,
+ libxbean-reflect-java,
+ maven-debian-helper
+Standards-Version: 4.1.1
Vcs-Git: https://anonscm.debian.org/git/pkg-java/plexus-containers.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/plexus-containers.git
-Homepage: https://codehaus-plexus.github.io/plexus-containers/
+Homepage: https://github.com/codehaus-plexus/plexus-containers
-Package: libplexus-containers-java
+Package: libplexus-container-default-java
Architecture: all
-Depends: ${misc:Depends}, ${maven:Depends}
-Suggests: ${maven:OptionalDepends}
-Conflicts: libplexus-container-default-java (<= 1.0-alpha-9-stable-1-2)
-Description: utilities for the Plexus framework
+Depends:
+ libguava-java,
+ libplexus-classworlds-java (>= 2.5.2),
+ libplexus-utils2-java,
+ libxbean-reflect-java,
+ ${misc:Depends}
+Breaks: libplexus-containers1.5-java (<< 1.6-2~), libplexus-containers-java, libplexus-container-default1.5-java (<< 1.7.1-7~)
+Replaces: libplexus-containers1.5-java (<< 1.6-2~), libplexus-containers-java, libplexus-container-default1.5-java (<< 1.7.1-7~)
+Description: Plexus Inversion-of-control Container
The Plexus project provides a full software stack for creating and executing
software projects. Based on the Plexus container, the applications can
utilise component-oriented programming to build modular, reusable components
that can easily be assembled and reused.
.
- While Plexus is similar to other inversion-of-control (IoC) or dependency
- injection frameworks such as the Spring Framework, it is a full-fledged
- container that supports many more features such as:
- .
- * Component lifecycles
- * Component instantiation strategies
- * Nested containers
- * Component configuration
- * Auto-wiring
- * Component dependencies, and
- * Various dependency injection techniques including constructor injection,
- setter injection, and private field injection.
+ This package contains the plexus-container-default module.
+
+Package: libplexus-container-default1.5-java
+Architecture: all
+Section: oldlibs
+Depends: ${misc:Depends}, libplexus-container-default-java (>= 1.7.1-7~)
+Description: Plexus Inversion-of-control Container (transitional package)
+ The Plexus project provides a full software stack for creating and executing
+ software projects. Based on the Plexus container, the applications can
+ utilise component-oriented programming to build modular, reusable components
+ that can easily be assembled and reused.
.
- This package replaces the old packages libplexus-containers-default-java.
+ This is a transitional package, please use libplexus-container-default-java
+ instead.
-Package: libplexus-containers-java-doc
+Package: libplexus-component-annotations-java
Architecture: all
-Section: doc
Depends: ${misc:Depends}
-Suggests: libplexus-containers-java
-Description: API Documentation for plexus-container-default
+Breaks: libplexus-containers1.5-java (<< 1.6-2~), libplexus-containers-java
+Replaces: libplexus-containers1.5-java (<< 1.6-2~), libplexus-containers-java
+Description: Plexus Component Annotations
+ Plexus Component Java 5 annotations, to describe Plexus components
+ properties in java sources with standard annotations instead of javadoc
+ annotations.
+
+Package: libplexus-component-metadata-java
+Architecture: all
+Depends:
+ libasm-java (>= 5.0),
+ libcommons-cli-java,
+ libjdom2-java,
+ libmaven3-core-java,
+ libplexus-cli-java,
+ libplexus-component-annotations-java (= ${source:Version}),
+ libplexus-container-default-java (= ${source:Version}),
+ libqdox2-java,
+ ${misc:Depends}
+Breaks: libplexus-containers1.5-java (<< 1.6-2~)
+Replaces: libplexus-containers1.5-java (<< 1.6-2~)
+Description: Component Metadata Maven plugin for Plexus
The Plexus project provides a full software stack for creating and executing
software projects. Based on the Plexus container, the applications can
utilise component-oriented programming to build modular, reusable components
that can easily be assembled and reused.
.
- While Plexus is similar to other inversion-of-control (IoC) or dependency
- injection frameworks such as the Spring Framework, it is a full-fledged
- container that supports many more features such as:
- .
- * Component lifecycles
- * Component instantiation strategies
- * Nested containers
- * Component configuration
- * Auto-wiring
- * Component dependencies, and
- * Various dependency injection techniques including constructor injection,
- setter injection, and private field injection.
- .
- This package contains the API documentation for plexus-containers. It
- replaces the old packages libplexus-containers-default-java-doc.
+ This package provides the Maven plugin generating the component metadata.
diff -Nru plexus-containers-1.0~beta3.0.7/debian/copyright plexus-containers-1.7.1/debian/copyright
--- plexus-containers-1.0~beta3.0.7/debian/copyright 2017-07-24 12:54:10.000000000 +0000
+++ plexus-containers-1.7.1/debian/copyright 2017-11-07 08:41:28.000000000 +0000
@@ -6,8 +6,17 @@
Copyright: 2001-2008, Codehaus Foundation
License: Apache-2.0
-Files: plexus-container-default/src/main/java/org/codehaus/plexus/component/configurator/*
- plexus-container-default/src/test/java/org/codehaus/plexus/component/configurator/*
+Files:
+ plexus-container-default/src/test/java/org/codehaus/plexus/component/configurator/*
+ plexus-component-metadata/src/test/java/org/codehaus/plexus/metadata/merge/*
+ plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/merge/*
+ plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/gleaner/ComponentGleanerException.java
+ plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/gleaner/QDoxComponentGleaner.java
+ plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriter.java
+ plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/DefaultMetadataGenerator.java
+ plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorWriteException.java
+ plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorWriter.java
+ plexus-component-metadata/src/main/java/org/codehaus/plexus/maven/plugin/*
Copyright: 2001-2008, Codehaus Foundation
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy of
@@ -29,12 +38,10 @@
SOFTWARE.
Files: debian/*
-Copyright: 2008-2009, Torsten Werner
- 2009, Ludovic Claude
+Copyright: 2010, Torsten Werner
2011, Damien Raude-Morvan
- 2013-2017, Emmanuel Bourg
License: Apache-2.0
License: Apache-2.0
On Debian GNU/Linux system you can find the complete text of the
- Apache-2.0 license in '/usr/share/common-licenses/Apache-2.0'.
+ Apache-2.0 license in '/usr/share/common-licenses/Apache-2.0'
diff -Nru plexus-containers-1.0~beta3.0.7/debian/gbp.conf plexus-containers-1.7.1/debian/gbp.conf
--- plexus-containers-1.0~beta3.0.7/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/debian/gbp.conf 2017-11-07 08:41:28.000000000 +0000
@@ -0,0 +1,2 @@
+[DEFAULT]
+debian-branch = master
diff -Nru plexus-containers-1.0~beta3.0.7/debian/libplexus-component-annotations-java.links plexus-containers-1.7.1/debian/libplexus-component-annotations-java.links
--- plexus-containers-1.0~beta3.0.7/debian/libplexus-component-annotations-java.links 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/debian/libplexus-component-annotations-java.links 2017-11-07 09:59:59.000000000 +0000
@@ -0,0 +1 @@
+/usr/share/java/plexus-component-annotations.jar /usr/share/java/plexus-component-annotations-1.5.jar
diff -Nru plexus-containers-1.0~beta3.0.7/debian/libplexus-container-default-java.links plexus-containers-1.7.1/debian/libplexus-container-default-java.links
--- plexus-containers-1.0~beta3.0.7/debian/libplexus-container-default-java.links 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/debian/libplexus-container-default-java.links 2017-11-07 10:01:37.000000000 +0000
@@ -0,0 +1 @@
+/usr/share/java/plexus-container-default.jar /usr/share/java/plexus-container-default-1.5.jar
diff -Nru plexus-containers-1.0~beta3.0.7/debian/libplexus-container-default-java.poms plexus-containers-1.7.1/debian/libplexus-container-default-java.poms
--- plexus-containers-1.0~beta3.0.7/debian/libplexus-container-default-java.poms 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/debian/libplexus-container-default-java.poms 2017-11-07 12:19:11.000000000 +0000
@@ -0,0 +1,32 @@
+# List of POM files for the package
+# Format of this file is:
+# [option]*
+# where option can be:
+# --ignore: ignore this POM and its artifact if any
+# --ignore-pom: don't install the POM. To use on POM files that are created
+# temporarily for certain artifacts such as Javadoc jars. [mh_install, mh_installpoms]
+# --no-parent: remove the tag from the POM
+# --package=: an alternative package to use when installing this POM
+# and its artifact
+# --has-package-version: to indicate that the original version of the POM is the same as the upstream part
+# of the version for the package.
+# --keep-elements=: a list of XML elements to keep in the POM
+# during a clean operation with mh_cleanpom or mh_installpom
+# --artifact=: path to the build artifact associated with this POM,
+# it will be installed when using the command mh_install. [mh_install]
+# --java-lib: install the jar into /usr/share/java to comply with Debian
+# packaging guidelines
+# --usj-name=: name to use when installing the library in /usr/share/java
+# --usj-version=: version to use when installing the library in /usr/share/java
+# --no-usj-versionless: don't install the versionless link in /usr/share/java
+# --dest-jar=: the destination for the real jar.
+# It will be installed with mh_install. [mh_install]
+# --classifier=: Optional, the classifier for the jar. Empty by default.
+# --site-xml=: Optional, the location for site.xml if it needs to be installed.
+# Empty by default. [mh_install]
+#
+pom.xml --no-parent --has-package-version --package=libplexus-container-default-java
+plexus-component-annotations/pom.xml --no-parent --has-package-version --package=libplexus-component-annotations-java --relocate=org.codehaus.plexus:plexus-component-annotations:1.5.5
+plexus-component-metadata/pom.xml --has-package-version --package=libplexus-component-metadata-java --relocate=org.codehaus.plexus:plexus-component-metadata:1.5.5
+plexus-component-javadoc/pom.xml --ignore
+plexus-container-default/pom.xml --has-package-version --package=libplexus-container-default-java --relocate=org.codehaus.plexus:plexus-container-default:1.5.5
diff -Nru plexus-containers-1.0~beta3.0.7/debian/libplexus-containers-java-doc.doc-base plexus-containers-1.7.1/debian/libplexus-containers-java-doc.doc-base
--- plexus-containers-1.0~beta3.0.7/debian/libplexus-containers-java-doc.doc-base 2016-02-27 22:59:35.000000000 +0000
+++ plexus-containers-1.7.1/debian/libplexus-containers-java-doc.doc-base 1970-01-01 00:00:00.000000000 +0000
@@ -1,9 +0,0 @@
-Document: libplexus-containers-java
-Title: API Javadoc for plexus-containers
-Author: plexus-containers developers
-Abstract: This is the API Javadoc provided by the plexus-containers library.
-Section: Programming
-
-Format: HTML
-Index: /usr/share/doc/libplexus-containers-java/api/index.html
-Files: /usr/share/doc/libplexus-containers-java/api/*
diff -Nru plexus-containers-1.0~beta3.0.7/debian/libplexus-containers-java-doc.install plexus-containers-1.7.1/debian/libplexus-containers-java-doc.install
--- plexus-containers-1.0~beta3.0.7/debian/libplexus-containers-java-doc.install 2017-07-24 12:22:01.000000000 +0000
+++ plexus-containers-1.7.1/debian/libplexus-containers-java-doc.install 1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-target/site/apidocs/* /usr/share/doc/libplexus-containers-java/api/
diff -Nru plexus-containers-1.0~beta3.0.7/debian/libplexus-containers-java.poms plexus-containers-1.7.1/debian/libplexus-containers-java.poms
--- plexus-containers-1.0~beta3.0.7/debian/libplexus-containers-java.poms 2017-07-24 12:13:41.000000000 +0000
+++ plexus-containers-1.7.1/debian/libplexus-containers-java.poms 1970-01-01 00:00:00.000000000 +0000
@@ -1,5 +0,0 @@
-pom.xml --no-parent
-plexus-container-default/pom.xml
-plexus-component-javadoc/pom.xml --ignore
-plexus-component-annotations/pom.xml
-plexus-component-metadata/pom.xml --ignore
diff -Nru plexus-containers-1.0~beta3.0.7/debian/maven.ignoreRules plexus-containers-1.7.1/debian/maven.ignoreRules
--- plexus-containers-1.0~beta3.0.7/debian/maven.ignoreRules 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/debian/maven.ignoreRules 2017-11-07 08:41:28.000000000 +0000
@@ -0,0 +1,5 @@
+
+org.apache.maven.plugins maven-assembly-plugin * * * *
+org.apache.maven.plugins maven-deploy-plugin * * * *
+org.apache.maven.plugins maven-release-plugin * * * *
+org.apache.maven.plugins maven-site-plugin * * * *
diff -Nru plexus-containers-1.0~beta3.0.7/debian/maven.properties plexus-containers-1.7.1/debian/maven.properties
--- plexus-containers-1.0~beta3.0.7/debian/maven.properties 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/debian/maven.properties 2017-11-07 08:41:28.000000000 +0000
@@ -0,0 +1,5 @@
+# Include here properties to pass to Maven during the build.
+# For example:
+# maven.test.skip=true
+
+maven.test.skip=true
diff -Nru plexus-containers-1.0~beta3.0.7/debian/maven.rules plexus-containers-1.7.1/debian/maven.rules
--- plexus-containers-1.0~beta3.0.7/debian/maven.rules 2016-02-27 22:59:35.000000000 +0000
+++ plexus-containers-1.7.1/debian/maven.rules 2017-11-07 12:19:23.000000000 +0000
@@ -1,4 +1,27 @@
-s/com.google.code.google-collections/com.google.guava/ s/google-collect/guava/ jar s/.*/debian/
-s/jdom/org.jdom/ jdom jar s/1\..*/debian/
-junit junit jar s/3\..*/3.x/
+# Maven rules - transform Maven dependencies and plugins
+# Format of this file is:
+# [group] [artifact] [type] [version] [classifier] [scope]
+# where each element can be either
+# - the exact string, for example org.apache for the group, or 3.1
+# for the version. In this case, the element is simply matched
+# and left as it is
+# - * (the star character, alone). In this case, anything will
+# match and be left as it is. For example, using * on the
+# position of the artifact field will match any artifact id
+# - a regular expression of the form s/match/replace/
+# in this case, elements that match are transformed using
+# the regex rule.
+# All elements much match before a rule can be applied
+# Example rule: match jar with groupid= junit, artifactid= junit
+# and version starting with 3., replacing the version with 3.x
+# junit junit jar s/3\\..*/3.x/
+s/jdom/org.jdom/ jdom jar s/.*/debian/ * *
+junit junit jar s/.*/4.x/ * *
+com.thoughtworks.qdox qdox * s/.*/2.x/ * *
+s/com.google.collections/com.google.guava/ s/google-collections/guava/ * s/.*/debian/ * *
+
+org.codehaus.plexus plexus-utils jar s/.*/2.x/ * *
+
+org.apache.maven s/maven-project/maven-core/ * s/.*/3.x/ * *
+org.apache.maven maven-* * s/.*/3.x/ * *
diff -Nru plexus-containers-1.0~beta3.0.7/debian/patches/03-reproducible-metadata.patch plexus-containers-1.7.1/debian/patches/03-reproducible-metadata.patch
--- plexus-containers-1.0~beta3.0.7/debian/patches/03-reproducible-metadata.patch 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/debian/patches/03-reproducible-metadata.patch 2017-11-07 08:41:28.000000000 +0000
@@ -0,0 +1,18 @@
+Description: Sort the components to make the metadata reproducible
+Author: Emmanuel Bourg
+Bug: https://github.com/codehaus-plexus/plexus-containers/pull/7
+--- a/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/DefaultMetadataGenerator.java
++++ b/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/DefaultMetadataGenerator.java
+@@ -101,6 +101,12 @@
+ }
+ }
+
++ Collections.sort(descriptors, new java.util.Comparator() {
++ public int compare(ComponentDescriptor d1, ComponentDescriptor d2) {
++ return d1.getHumanReadableKey().compareTo(d2.getHumanReadableKey());
++ }
++ });
++
+ List componentDescriptors = new ArrayList();
+
+ //
diff -Nru plexus-containers-1.0~beta3.0.7/debian/patches/05-qdox-compatibility.patch plexus-containers-1.7.1/debian/patches/05-qdox-compatibility.patch
--- plexus-containers-1.0~beta3.0.7/debian/patches/05-qdox-compatibility.patch 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/debian/patches/05-qdox-compatibility.patch 2017-11-07 08:41:28.000000000 +0000
@@ -0,0 +1,14 @@
+Description: Fixes the compatibility with the version of Qdox in Debian
+Author: Emmanuel Bourg
+Forwarded: no
+--- a/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/gleaner/QDoxComponentGleaner.java
++++ b/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/gleaner/QDoxComponentGleaner.java
+@@ -244,7 +244,7 @@
+ // Remove any Plexus specific interfaces from the calculation
+ // ----------------------------------------------------------------------
+
+- List interfaces = new ArrayList( javaClass.getImplementedInterfaces() );
++ List interfaces = new ArrayList( javaClass.getInterfaces() );
+
+ for ( Iterator it = interfaces.iterator(); it.hasNext(); )
+ {
diff -Nru plexus-containers-1.0~beta3.0.7/debian/patches/google_collections_10.diff plexus-containers-1.7.1/debian/patches/google_collections_10.diff
--- plexus-containers-1.0~beta3.0.7/debian/patches/google_collections_10.diff 2016-02-27 22:59:35.000000000 +0000
+++ plexus-containers-1.7.1/debian/patches/google_collections_10.diff 1970-01-01 00:00:00.000000000 +0000
@@ -1,24 +0,0 @@
-Description: Fix FTBFS with libgoogle-collections >= 1.0
-Author: Damien Raude-Morvan
-Last-Update: 2011-05-31
-Forwarded: no
---- a/plexus-container-default/src/main/java/org/codehaus/plexus/component/repository/DefaultComponentRepository.java
-+++ b/plexus-container-default/src/main/java/org/codehaus/plexus/component/repository/DefaultComponentRepository.java
-@@ -82,7 +82,7 @@
- }
-
- // Get all valid component descriptors
-- Multimap> roleHintIndex = Multimaps.newLinkedHashMultimap();
-+ Multimap> roleHintIndex = com.google.common.collect.LinkedHashMultimap.create();
- for ( ClassRealm realm : realms )
- {
- SortedMap>> roleIndex = index.get( realm );
-@@ -189,7 +189,7 @@
- Multimap> roleHintIndex = roleIndex.get( role );
- if ( roleHintIndex == null )
- {
-- roleHintIndex = Multimaps.newLinkedHashMultimap();
-+ roleHintIndex = com.google.common.collect.LinkedHashMultimap.create();
- roleIndex.put( role, roleHintIndex );
- }
- roleHintIndex.put( componentDescriptor.getRoleHint(), componentDescriptor );
diff -Nru plexus-containers-1.0~beta3.0.7/debian/patches/series plexus-containers-1.7.1/debian/patches/series
--- plexus-containers-1.0~beta3.0.7/debian/patches/series 2017-07-24 12:19:31.000000000 +0000
+++ plexus-containers-1.7.1/debian/patches/series 2017-11-07 12:20:40.000000000 +0000
@@ -1 +1,2 @@
-google_collections_10.diff
+03-reproducible-metadata.patch
+05-qdox-compatibility.patch
diff -Nru plexus-containers-1.0~beta3.0.7/debian/rules plexus-containers-1.7.1/debian/rules
--- plexus-containers-1.0~beta3.0.7/debian/rules 2017-07-24 11:29:15.000000000 +0000
+++ plexus-containers-1.7.1/debian/rules 2017-11-07 08:41:28.000000000 +0000
@@ -3,13 +3,5 @@
%:
dh $@
-override_dh_auto_configure:
- mkdir -p plexus-component-metadata
- touch plexus-component-metadata/pom.xml
- dh_auto_configure
-
-override_dh_auto_build:
- dh_auto_build
-
get-orig-source:
- uscan --download-current-version --force-download --rename
+ uscan --download-curent-version --force-download --rename
diff -Nru plexus-containers-1.0~beta3.0.7/debian/watch plexus-containers-1.7.1/debian/watch
--- plexus-containers-1.0~beta3.0.7/debian/watch 2017-07-24 12:27:49.000000000 +0000
+++ plexus-containers-1.7.1/debian/watch 2017-11-07 08:41:28.000000000 +0000
@@ -1,3 +1,2 @@
version=3
-opts=mode=git,repack,compression=xz,uversionmangle=s/-(alpha|beta)-/~$1/ \
-https://github.com/codehaus-plexus/plexus-containers refs/tags/plexus-containers-(1\.0-.*) debian debian/orig-tar.sh
+https://github.com/codehaus-plexus/plexus-containers/tags .*/plexus-containers-([\d\.]+).tar.gz
diff -Nru plexus-containers-1.0~beta3.0.7/.gitignore plexus-containers-1.7.1/.gitignore
--- plexus-containers-1.0~beta3.0.7/.gitignore 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/.gitignore 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,7 @@
+target/
+.project
+.classpath
+.settings/
+bin
+*.iml
+.idea
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-annotations/pom.xml plexus-containers-1.7.1/plexus-component-annotations/pom.xml
--- plexus-containers-1.0~beta3.0.7/plexus-component-annotations/pom.xml 2009-05-13 15:28:46.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-annotations/pom.xml 2016-08-31 19:01:49.000000000 +0000
@@ -1,13 +1,20 @@
-
-
+
+4.0.0
+
org.codehaus.plexusplexus-containers
- 1.0-beta-3.0.7
+ 1.7.1
+
plexus-component-annotations
+
Plexus :: Component Annotations
+
+ Plexus Component "Java 5" Annotations, to describe plexus components properties in java sources with
+ standard annotations instead of javadoc annotations.
+
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-annotations/src/main/java/org/codehaus/plexus/component/annotations/Component.java plexus-containers-1.7.1/plexus-component-annotations/src/main/java/org/codehaus/plexus/component/annotations/Component.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-annotations/src/main/java/org/codehaus/plexus/component/annotations/Component.java 2007-10-01 04:15:36.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-annotations/src/main/java/org/codehaus/plexus/component/annotations/Component.java 2016-08-31 19:01:49.000000000 +0000
@@ -26,7 +26,8 @@
/**
* Marks a class as a Plexus component.
*
- * @version $Id: Component.java 6920 2007-10-01 04:15:36Z user57 $
+ * @since 1.0-alpha-33
+ * @version $Id$
*/
@Documented
@Retention(RUNTIME)
@@ -47,7 +48,7 @@
String lifecycleHandler() default "";
String instantiationStrategy() default "";
-
+
String factory() default "";
String type() default "";
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-annotations/src/main/java/org/codehaus/plexus/component/annotations/Configuration.java plexus-containers-1.7.1/plexus-component-annotations/src/main/java/org/codehaus/plexus/component/annotations/Configuration.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-annotations/src/main/java/org/codehaus/plexus/component/annotations/Configuration.java 2007-09-30 18:40:35.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-annotations/src/main/java/org/codehaus/plexus/component/annotations/Configuration.java 2016-08-31 19:01:49.000000000 +0000
@@ -24,9 +24,10 @@
import java.lang.annotation.Target;
/**
- * Marks a field as a configuration element with a default falue.
+ * Marks a field as a configuration element with a default value.
*
- * @version $Id: Configuration.java 6916 2007-09-30 18:40:35Z user57 $
+ * @since 1.0-alpha-33
+ * @version $Id$
*/
@Documented
@Retention(RUNTIME)
@@ -35,6 +36,6 @@
public @interface Configuration
{
String name() default "";
-
+
String value();
}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-annotations/src/main/java/org/codehaus/plexus/component/annotations/Requirement.java plexus-containers-1.7.1/plexus-component-annotations/src/main/java/org/codehaus/plexus/component/annotations/Requirement.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-annotations/src/main/java/org/codehaus/plexus/component/annotations/Requirement.java 2007-09-30 18:40:35.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-annotations/src/main/java/org/codehaus/plexus/component/annotations/Requirement.java 2016-08-31 19:01:49.000000000 +0000
@@ -27,7 +27,8 @@
/**
* Configures a requirement.
*
- * @version $Id: Requirement.java 6916 2007-09-30 18:40:35Z user57 $
+ * @since 1.0-alpha-33
+ * @version $Id$
*/
@Documented
@Retention(RUNTIME)
@@ -42,6 +43,9 @@
//
// HACK: This is here to support component requirement lists, which can take a list of hints
//
-
+
String[] hints() default {};
+
+ boolean optional() default false;
+
}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-annotations/src/site/apt/index.apt plexus-containers-1.7.1/plexus-component-annotations/src/site/apt/index.apt
--- plexus-containers-1.0~beta3.0.7/plexus-component-annotations/src/site/apt/index.apt 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-annotations/src/site/apt/index.apt 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,23 @@
+ -----
+ Overview
+ -----
+ Hervé Boutemy
+ -----
+ 2011-10-02
+ -----
+
+About Plexus :: Component Annotations
+
+ Plexus Component "Java 5" Annotations, to describe plexus components properties in java sources with standard annotations instead of javadoc annotations.
+
+ 3 "Java 5" annotations are provided to replace javadoc annotations:
+
+*-----------------------------+----------------------+
+| <> | <> |
+*-----------------------------+----------------------+
+| <<<@plexus.component>>> | {{{./apidocs/org/codehaus/plexus/component/annotations/Component.html}<<<@Component>>>}} |
+*-----------------------------+----------------------+
+| <<<@plexus.requirement>>> | {{{./apidocs/org/codehaus/plexus/component/annotations/Requirement.html}<<<@Requirement>>>}} |
+*-----------------------------+----------------------+
+| <<<@plexus.configuration>>> | {{{./apidocs/org/codehaus/plexus/component/annotations/Configuration.html}<<<@Configuration>>>}} |
+*-----------------------------+----------------------+
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-annotations/src/site/site.xml plexus-containers-1.7.1/plexus-component-annotations/src/site/site.xml
--- plexus-containers-1.0~beta3.0.7/plexus-component-annotations/src/site/site.xml 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-annotations/src/site/site.xml 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-javadoc/pom.xml plexus-containers-1.7.1/plexus-component-javadoc/pom.xml
--- plexus-containers-1.0~beta3.0.7/plexus-component-javadoc/pom.xml 2009-05-13 15:28:46.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-javadoc/pom.xml 2016-08-31 19:01:49.000000000 +0000
@@ -1,29 +1,27 @@
-
+4.0.0
+
org.codehaus.plexusplexus-containers
- 1.0-beta-3.0.7
+ 1.7.1
+
plexus-component-javadoc
+
Plexus :: Javadoc Taglets
+
+ Plexus Javadoc Taglets to generate additional documentation for plexus components' javadoc from plexus javadoc annotations.
+ 2007
-
-
-
- maven-javadoc-plugin
-
-
- maven-jxr-plugin
-
-
-
+
default-tools.jar
+ (,9)java.vendorSun Microsystems Inc.
@@ -40,7 +38,27 @@
- integration-tests
+ J7-default-tools.jar
+
+ (,9)
+
+ java.vendor
+ Oracle Corporation
+
+
+
+
+ com.sun
+ tools
+ 1.4.2
+ system
+ ${java.home}/../lib/tools.jar
+
+
+
+
+
+ run-itsmaven.test.skip
@@ -50,8 +68,9 @@
+ org.apache.maven.pluginsmaven-invoker-plugin
- 1.3
+ 2.0.0true${project.build.directory}/it
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-javadoc/src/it/basic/pom.xml plexus-containers-1.7.1/plexus-component-javadoc/src/it/basic/pom.xml
--- plexus-containers-1.0~beta3.0.7/plexus-component-javadoc/src/it/basic/pom.xml 2008-11-25 09:22:35.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-javadoc/src/it/basic/pom.xml 2016-08-31 19:01:49.000000000 +0000
@@ -16,7 +16,7 @@
org.apache.maven.pluginsmaven-javadoc-plugin
- 2.3
+ 2.10.4${basedir}/target/site/apidocstrue
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-javadoc/src/main/java/org/codehaus/plexus/javadoc/AbstractPlexusTaglet.java plexus-containers-1.7.1/plexus-component-javadoc/src/main/java/org/codehaus/plexus/javadoc/AbstractPlexusTaglet.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-javadoc/src/main/java/org/codehaus/plexus/javadoc/AbstractPlexusTaglet.java 2008-04-11 18:12:21.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-javadoc/src/main/java/org/codehaus/plexus/javadoc/AbstractPlexusTaglet.java 2016-08-31 19:01:49.000000000 +0000
@@ -36,7 +36,7 @@
* http://plexus.codehaus.org/guides/developer-guide/appendices/javadoc-tags-reference.html
*
* @author Vincent Siveton
- * @version $Id: AbstractPlexusTaglet.java 7277 2008-04-11 18:12:21Z bentmann $
+ * @version $Id$
*/
public abstract class AbstractPlexusTaglet
implements Taglet
@@ -79,12 +79,10 @@
}
boolean hasParameters = false;
- for ( int i = 0; i < tags.length; i++ )
- {
- String tagText = tags[i].text();
- MutableAttributeSet att = getAttributes( tagText );
- if ( att != null )
- {
+ for (Tag tag : tags) {
+ String tagText = tag.text();
+ MutableAttributeSet att = getAttributes(tagText);
+ if (att != null) {
hasParameters = att.getAttributeCount() > 0;
}
}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-javadoc/src/main/java/org/codehaus/plexus/javadoc/PlexusComponentTaglet.java plexus-containers-1.7.1/plexus-component-javadoc/src/main/java/org/codehaus/plexus/javadoc/PlexusComponentTaglet.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-javadoc/src/main/java/org/codehaus/plexus/javadoc/PlexusComponentTaglet.java 2008-04-11 18:12:21.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-javadoc/src/main/java/org/codehaus/plexus/javadoc/PlexusComponentTaglet.java 2016-08-31 19:01:49.000000000 +0000
@@ -58,7 +58,7 @@
* http://plexus.codehaus.org/guides/developer-guide/appendices/javadoc-tags-reference.html
*
* @author Vincent Siveton
- * @version $Id: PlexusComponentTaglet.java 7277 2008-04-11 18:12:21Z bentmann $
+ * @version $Id$
*/
public class PlexusComponentTaglet
extends AbstractPlexusTaglet
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-javadoc/src/main/java/org/codehaus/plexus/javadoc/PlexusConfigurationTaglet.java plexus-containers-1.7.1/plexus-component-javadoc/src/main/java/org/codehaus/plexus/javadoc/PlexusConfigurationTaglet.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-javadoc/src/main/java/org/codehaus/plexus/javadoc/PlexusConfigurationTaglet.java 2008-04-11 18:12:21.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-javadoc/src/main/java/org/codehaus/plexus/javadoc/PlexusConfigurationTaglet.java 2016-08-31 19:01:49.000000000 +0000
@@ -46,7 +46,7 @@
* http://plexus.codehaus.org/guides/developer-guide/appendices/javadoc-tags-reference.html
*
* @author Vincent Siveton
- * @version $Id: PlexusConfigurationTaglet.java 7277 2008-04-11 18:12:21Z bentmann $
+ * @version $Id$
*/
public class PlexusConfigurationTaglet
extends AbstractPlexusTaglet
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-javadoc/src/main/java/org/codehaus/plexus/javadoc/PlexusRequirementTaglet.java plexus-containers-1.7.1/plexus-component-javadoc/src/main/java/org/codehaus/plexus/javadoc/PlexusRequirementTaglet.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-javadoc/src/main/java/org/codehaus/plexus/javadoc/PlexusRequirementTaglet.java 2008-04-11 18:12:21.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-javadoc/src/main/java/org/codehaus/plexus/javadoc/PlexusRequirementTaglet.java 2016-08-31 19:01:49.000000000 +0000
@@ -58,7 +58,7 @@
* http://plexus.codehaus.org/guides/developer-guide/appendices/javadoc-tags-reference.html
*
* @author Vincent Siveton
- * @version $Id: PlexusRequirementTaglet.java 7277 2008-04-11 18:12:21Z bentmann $
+ * @version $Id$
*/
public class PlexusRequirementTaglet
extends AbstractPlexusTaglet
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-javadoc/src/site/site.xml plexus-containers-1.7.1/plexus-component-javadoc/src/site/site.xml
--- plexus-containers-1.0~beta3.0.7/plexus-component-javadoc/src/site/site.xml 2008-04-11 18:12:21.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-javadoc/src/site/site.xml 2016-08-31 19:01:49.000000000 +0000
@@ -1,26 +1,12 @@
-
-
- Plexus
- http://plexus.codehaus.org/
- /images/plexus-logo.png
-
-
-
-
- org.codehaus.plexus
- plexus-stylus-skin
- 1.0-SNAPSHOT
-
+
-
-
-
-
-
+
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/pom.xml plexus-containers-1.7.1/plexus-component-metadata/pom.xml
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/pom.xml 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/pom.xml 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,132 @@
+
+
+
+ 4.0.0
+
+
+ org.codehaus.plexus
+ plexus-containers
+ 1.7.1
+
+
+ plexus-component-metadata
+ maven-plugin
+
+ Plexus :: Component Metadata
+ A Maven plugin to generate Plexus descriptors from source tags and class annotations.
+
+
+
+ org.codehaus.plexus
+ plexus-container-default
+
+
+ org.codehaus.plexus
+ plexus-component-annotations
+
+
+ org.codehaus.plexus
+ plexus-utils
+
+
+ com.thoughtworks.qdox
+ qdox
+
+
+ org.jdom
+ jdom2
+
+
+ org.apache.maven
+ maven-plugin-api
+
+
+ org.apache.maven
+ maven-model
+
+
+ org.apache.maven
+ maven-project
+
+
+ org.codehaus.plexus
+ plexus-cli
+ 1.6
+
+
+ commons-cli
+ commons-cli
+ 1.2
+
+
+ org.ow2.asm
+ asm-all
+ 5.1
+
+
+
+ org.apache.maven.plugin-tools
+ maven-plugin-annotations
+ 3.4
+ provided
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-plugin-plugin
+ 3.5
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-plugin-plugin
+
+
+
+
+
+
+ run-its
+
+
+
+ org.apache.maven.plugins
+ maven-invoker-plugin
+ 2.0.0
+
+ true
+ src/it
+ ${project.build.directory}/it
+ setup
+ validate
+ ${project.build.directory}/local-repo
+ src/it/settings.xml
+
+ clean
+ process-classes
+
+
+
+
+ integration-test
+
+ install
+ run
+
+
+
+
+
+
+
+
+
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/README.txt plexus-containers-1.7.1/plexus-component-metadata/README.txt
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/README.txt 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/README.txt 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,4 @@
+The org.codehaus.plexus.component.repository.cdc package contains some classes copied from the container
+before it started using the "default" role hints.
+
+This can be removed once all supported maven versions are using a container newer than 1.0-alpha-19.
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/annotation-processing-test/pom.xml plexus-containers-1.7.1/plexus-component-metadata/src/it/annotation-processing-test/pom.xml
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/annotation-processing-test/pom.xml 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/it/annotation-processing-test/pom.xml 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,51 @@
+
+ 4.0.0
+ org.codehaus.plexus
+ annotation-processing-test
+ jar
+ 1.0-SNAPSHOT
+ annotation-processing-test
+ http://maven.apache.org
+
+ @project.version@
+
+
+
+ junit
+ junit
+ 3.8.1
+ test
+
+
+ org.codehaus.plexus
+ plexus-component-annotations
+ ${plexusVersion}
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+
+ 1.6
+
+
+
+ org.codehaus.plexus
+ plexus-component-metadata
+ ${plexusVersion}
+
+
+
+ generate-metadata
+
+
+
+
+
+
+
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/AbstractPlexusComponent.java plexus-containers-1.7.1/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/AbstractPlexusComponent.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/AbstractPlexusComponent.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/AbstractPlexusComponent.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,10 @@
+package org.codehaus.plexus;
+
+import org.codehaus.plexus.component.annotations.Requirement;
+
+public abstract class AbstractPlexusComponent
+ implements PlexusComponent
+{
+ @Requirement
+ protected Executor executor;
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/Executor.java plexus-containers-1.7.1/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/Executor.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/Executor.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/Executor.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,6 @@
+package org.codehaus.plexus;
+
+public interface Executor
+{
+ String execute();
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/FastExecutor.java plexus-containers-1.7.1/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/FastExecutor.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/FastExecutor.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/FastExecutor.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,13 @@
+package org.codehaus.plexus;
+
+import org.codehaus.plexus.component.annotations.Component;
+
+@Component(role = Executor.class, hint = "fast")
+public class FastExecutor
+ implements Executor
+{
+ public String execute()
+ {
+ return "fast";
+ }
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/PlexusComponent.java plexus-containers-1.7.1/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/PlexusComponent.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/PlexusComponent.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/PlexusComponent.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,6 @@
+package org.codehaus.plexus;
+
+public interface PlexusComponent
+{
+ String execute();
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/SlowExecutor.java plexus-containers-1.7.1/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/SlowExecutor.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/SlowExecutor.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/SlowExecutor.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,13 @@
+package org.codehaus.plexus;
+
+import org.codehaus.plexus.component.annotations.Component;
+
+@Component(role=Executor.class,hint="slow")
+public class SlowExecutor
+ implements Executor
+{
+ public String execute()
+ {
+ return "slow";
+ }
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/SubclassPlexusComponent.java plexus-containers-1.7.1/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/SubclassPlexusComponent.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/SubclassPlexusComponent.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/it/annotation-processing-test/src/main/java/org/codehaus/plexus/SubclassPlexusComponent.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,13 @@
+package org.codehaus.plexus;
+
+import org.codehaus.plexus.component.annotations.Component;
+
+@Component(role = Component.class)
+public class SubclassPlexusComponent
+ extends AbstractPlexusComponent
+{
+ public String execute()
+ {
+ return executor.execute();
+ }
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/annotation-processing-test/src/test/java/org/codehaus/plexus/AppTest.java plexus-containers-1.7.1/plexus-component-metadata/src/it/annotation-processing-test/src/test/java/org/codehaus/plexus/AppTest.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/annotation-processing-test/src/test/java/org/codehaus/plexus/AppTest.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/it/annotation-processing-test/src/test/java/org/codehaus/plexus/AppTest.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,38 @@
+package org.codehaus.plexus;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/descriptor-1/pom.xml plexus-containers-1.7.1/plexus-component-metadata/src/it/descriptor-1/pom.xml
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/descriptor-1/pom.xml 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/it/descriptor-1/pom.xml 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+ 4.0.0
+
+ org.codehaus.plexus.it.plexus-cdc-anno
+ descriptor-1
+ testing
+
+
+
+ org.codehaus.plexus
+ plexus-component-annotations
+ @project.version@
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+ 1.6
+
+
+
+
+ org.codehaus.plexus
+ plexus-component-metadata
+ @project.version@
+
+
+
+ generate-metadata
+
+
+
+
+
+
+
+
+
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/descriptor-1/src/main/java/testing/ChildComponent.java plexus-containers-1.7.1/plexus-component-metadata/src/it/descriptor-1/src/main/java/testing/ChildComponent.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/descriptor-1/src/main/java/testing/ChildComponent.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/it/descriptor-1/src/main/java/testing/ChildComponent.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2007 the original author or authors.
+ *
+ * Licensed 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.
+ */
+
+package testing;
+
+import org.codehaus.plexus.component.annotations.*;
+
+/**
+ * ???
+ *
+ * @version $Id$
+ */
+@Component(role=ChildComponent.class)
+public class ChildComponent
+{
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/descriptor-1/src/main/java/testing/MyComponent.java plexus-containers-1.7.1/plexus-component-metadata/src/it/descriptor-1/src/main/java/testing/MyComponent.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/descriptor-1/src/main/java/testing/MyComponent.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/it/descriptor-1/src/main/java/testing/MyComponent.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2007 the original author or authors.
+ *
+ * Licensed 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.
+ */
+
+package testing;
+
+import org.codehaus.plexus.component.annotations.*;
+
+/**
+ * ???
+ *
+ * @version $Id$
+ */
+@Component(role=MyComponent.class, hint="foo")
+public class MyComponent
+{
+ @Requirement
+ private ChildComponent child;
+
+
+ @Configuration("bar")
+ private String foo;
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/descriptor-1/validate.groovy plexus-containers-1.7.1/plexus-component-metadata/src/it/descriptor-1/validate.groovy
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/descriptor-1/validate.groovy 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/it/descriptor-1/validate.groovy 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2006-2007 the original author or authors.
+ *
+ * Licensed 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.
+ */
+
+//
+// $Id$
+//
+
+def file = new File(basedir, 'target/classes/META-INF/plexus/components.xml')
+assert file.exists()
+
+def componentSet = new XmlParser().parse(file)
+
+assert componentSet.components.component.size() == 2
+
+return true;
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/settings.xml plexus-containers-1.7.1/plexus-component-metadata/src/it/settings.xml
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/it/settings.xml 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/it/settings.xml 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,35 @@
+
+
+
+
+ it-repo
+
+ true
+
+
+
+ local.central
+ @localRepositoryUrl@
+
+ true
+
+
+ true
+
+
+
+
+
+ local.central
+ @localRepositoryUrl@
+
+ true
+
+
+ true
+
+
+
+
+
+
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/ComponentDescriptor.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/ComponentDescriptor.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/ComponentDescriptor.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/ComponentDescriptor.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,702 @@
+package org.codehaus.plexus.component.repository;
+
+/*
+ * Copyright 2001-2006 Codehaus Foundation.
+ *
+ * Licensed 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.codehaus.plexus.PlexusConstants;
+import org.codehaus.plexus.classworlds.realm.ClassRealm;
+import org.codehaus.plexus.configuration.PlexusConfiguration;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Arrays;
+import java.util.Collections;
+
+/**
+ * Component instantiation description.
+ *
+ * @author Jason van Zyl
+ * @author bob mcwhirter
+ * @author Michal Maczka
+ * @version $Id: ComponentDescriptor.java 8155 2009-04-26 01:22:53Z jvanzyl $
+ */
+public class ComponentDescriptor
+{
+ private String alias = null;
+
+ private String role = null;
+
+ private Class extends T> roleClass;
+
+ private String roleHint = PlexusConstants.PLEXUS_DEFAULT_HINT;
+
+ private String implementation;
+
+ private Class extends T> implementationClass;
+
+ private String version;
+
+ private String componentType;
+
+ private PlexusConfiguration configuration;
+
+ private String instantiationStrategy;
+
+ private String lifecycleHandler;
+
+ private String componentProfile;
+
+ private final List requirements = new ArrayList();
+
+ private String componentFactory;
+
+ private String componentComposer;
+
+ private String componentConfigurator;
+
+ private String description;
+
+ private ClassRealm realm;
+
+ // ----------------------------------------------------------------------
+ // These two fields allow for the specification of an isolated class realm
+ // and dependencies that might be specified in a component configuration
+ // setup by a user i.e. this is here to allow isolation for components
+ // that are not picked up by the discovery mechanism.
+ // ----------------------------------------------------------------------
+
+ private boolean isolatedRealm;
+
+ // ----------------------------------------------------------------------
+
+ private ComponentSetDescriptor componentSetDescriptor;
+
+ private String source;
+
+ // ----------------------------------------------------------------------
+ // Instance methods
+ // ----------------------------------------------------------------------
+
+ public ComponentDescriptor()
+ {
+ }
+
+ public ComponentDescriptor( Class implementationClass, ClassRealm realm )
+ {
+ this.implementationClass = implementationClass;
+ this.implementation = implementationClass.getName();
+ this.realm = realm;
+ }
+
+ /**
+ * The location this information came from (descriptor file URI).
+ */
+ public void setSource( String source )
+ {
+ this.source = source;
+ }
+
+ /**
+ * The location this information came from (descriptor file URI).
+ */
+ public String getSource()
+ {
+ return source;
+ }
+
+ /**
+ * Returns a human-friendly key, suitable for display.
+ *
+ * @return a human-friendly key
+ */
+ public String getHumanReadableKey()
+ {
+ StringBuilder key = new StringBuilder();
+
+ key.append( "role: '" ).append( role ).append( "'" );
+
+ key.append( ", implementation: '" ).append( implementation ).append( "'" );
+
+ if ( roleHint != null )
+ {
+ key.append( ", role hint: '" ).append( roleHint ).append( "'" );
+ }
+
+ if ( alias != null )
+ {
+ key.append( ", alias: '" ).append( alias ).append( "'" );
+ }
+
+ return key.toString();
+ }
+
+ /**
+ * Returns an alias for this component. An alias as an alternate name other than the normal key.
+ *
+ * @return an alias for this component
+ */
+ public String getAlias()
+ {
+ return alias;
+ }
+
+ /**
+ * Sets the alias for this component.
+ *
+ * @param alias alternate name to set
+ */
+ public void setAlias( String alias )
+ {
+ this.alias = alias;
+ }
+
+ /**
+ * Returns the role of this component.
+ *
+ * @return the role of this component
+ */
+ public String getRole()
+ {
+ return role;
+ }
+
+ public Class extends T> getRoleClass()
+ {
+ attemptRoleLoad();
+
+ if (roleClass == null) {
+ return (Class) Object.class;
+ }
+ return (Class)roleClass;
+ }
+
+ private void attemptRoleLoad()
+ {
+ if ( roleClass == null && role != null && realm != null )
+ {
+ try
+ {
+ roleClass = (Class extends T>) realm.loadClass( role );
+ Thread.currentThread();
+ }
+ catch ( Throwable ignored )
+ {
+ Thread.currentThread();
+ }
+ }
+ }
+
+
+ /**
+ * Sets the role of this component.
+ *
+ * @param role this component's role
+ */
+ public void setRole( String role )
+ {
+ this.role = role;
+
+ // reload role class
+ roleClass = null;
+ attemptRoleLoad();
+ }
+
+ public void setRoleClass( Class extends T> roleClass )
+ {
+ this.roleClass = roleClass;
+
+ if (roleClass == null) {
+ role = null;
+ } else {
+ role = roleClass.getName();
+ }
+ }
+
+ /**
+ * Returns the role-hint of this component.
+ *
+ * @return the role-hint of this component
+ */
+ public String getRoleHint()
+ {
+ return roleHint;
+ }
+
+ /**
+ * Sets the role-hint of this component. Pasing null will set the hint to the default value.
+ *
+ * @param roleHint this component's role-hint
+ */
+ public void setRoleHint( String roleHint )
+ {
+ if ( ( roleHint == null ) || roleHint.trim().equals( "" ) )
+ {
+ this.roleHint = PlexusConstants.PLEXUS_DEFAULT_HINT;
+ }
+ else
+ {
+ this.roleHint = roleHint;
+ }
+ }
+
+ /**
+ * Returns the implementation of this componet. Implementation is a string denoting a FQCN in normal Java
+ * components, or some other name or file for other component factory implementations.
+ *
+ * @return the implementation of this componet's role.
+ */
+ public String getImplementation()
+ {
+ return implementation;
+ }
+
+ /**
+ * Sets the implementation of this componet.
+ *
+ * @param implementation string denoting a FQCN in normal Java components, or some other name or file for other
+ * component factory implementations
+ */
+ public void setImplementation( String implementation )
+ {
+ this.implementation = implementation;
+
+ // reload implementation class
+ implementationClass = null;
+ attemptImplementationLoad();
+ }
+
+ /**
+ * Returns the implementation class of this componet, or null if the implementation class can not be loaded.
+ *
+ * @return the implementation of this componet's role.
+ */
+ public Class extends T> getImplementationClass()
+ {
+ attemptImplementationLoad();
+
+ if (implementationClass == null) {
+ return (Class) Object.class;
+ }
+ return implementationClass;
+ }
+
+ private void attemptImplementationLoad()
+ {
+ if ( implementationClass == null && implementation != null && realm != null )
+ {
+ try
+ {
+ implementationClass = (Class extends T>) realm.loadClass( implementation );
+ Thread.currentThread();
+ }
+ catch ( Throwable ignored )
+ {
+ Thread.currentThread();
+ }
+ }
+ }
+
+ public void setImplementationClass( Class extends T> implementationClass )
+ {
+ this.implementationClass = implementationClass;
+ if (implementationClass == null) {
+ implementation = null;
+ } else {
+ implementation = implementationClass.getName();
+ }
+ }
+
+ /**
+ * Returns a specific point in a components's project timeline. i.e. version 1, or 2.1.4
+ *
+ * @return a specific point in a components's project timeline
+ */
+ public String getVersion()
+ {
+ return version;
+ }
+
+ /**
+ * Sets the point in a components's project development timeline
+ *
+ * @param version the components's version
+ */
+ public void setVersion( String version )
+ {
+ this.version = version;
+ }
+
+ /**
+ * Returns the type of this component.
+ *
+ * @return the type of this component
+ */
+ public String getComponentType()
+ {
+ return componentType;
+ }
+
+ /**
+ * Sets this component's type.
+ *
+ * @param componentType the type to set
+ */
+ public void setComponentType( String componentType )
+ {
+ this.componentType = componentType;
+ }
+
+ /**
+ * Returns the type of instantiation strategy for this component.
+ *
+ * @return the type of instantiation strategy for this component
+ */
+ public String getInstantiationStrategy()
+ {
+ return instantiationStrategy;
+ }
+
+ /**
+ * Returns configuration values defined for this component.
+ *
+ * @return configuration values defined for this component
+ */
+ public PlexusConfiguration getConfiguration()
+ {
+ return configuration;
+ }
+
+ /**
+ * Sets the configuration hierarchy for this component.
+ *
+ * @param configuration the configuration hierarchy to set
+ */
+ public void setConfiguration( PlexusConfiguration configuration )
+ {
+ this.configuration = configuration;
+ }
+
+ /**
+ * Returns true if this component has a configuration.
+ *
+ * @return true if this component has a configuration
+ */
+ public boolean hasConfiguration()
+ {
+ return configuration != null;
+ }
+
+ /**
+ * Returns the lifecycle-handler for this component.
+ *
+ * @return the lifecycle-handler for this component
+ */
+ public String getLifecycleHandler()
+ {
+ return lifecycleHandler;
+ }
+
+ /**
+ * Sets the lifecycle-handler for this component. For example, "basic", "passive", "bootstrap".
+ *
+ * @param lifecycleHandler the lifecycle handler string to set
+ */
+ public void setLifecycleHandler( String lifecycleHandler )
+ {
+ this.lifecycleHandler = lifecycleHandler;
+ }
+
+ public String getComponentProfile()
+ {
+ return componentProfile;
+ }
+
+ public void setComponentProfile( String componentProfile )
+ {
+ this.componentProfile = componentProfile;
+ }
+
+ /**
+ * Add a project requirement to this component.
+ *
+ * @param requirement the requirement to add
+ */
+ public void addRequirement( ComponentRequirement requirement )
+ {
+ this.requirements.add( requirement );
+ }
+
+ /**
+ * Add a project requirement to this component.
+ *
+ * @param requirement the requirement to add
+ */
+ public void addRequirement( ComponentRequirement... requirement )
+ {
+ this.requirements.addAll( Arrays.asList( requirement ));
+ }
+
+ /**
+ * Adds a list of requirements to this component.
+ *
+ * @param requirements the requirements to add
+ */
+ public void addRequirements( List requirements )
+ {
+ this.requirements.addAll( requirements );
+ }
+
+ /**
+ * Remove a project requirement from this component.
+ *
+ * @param requirement the requirement to remove
+ */
+ public void removeRequirement( ComponentRequirement... requirement )
+ {
+ this.requirements.removeAll( Arrays.asList( requirement ));
+ }
+
+ /**
+ * Removes a list of requirements from this component.
+ *
+ * @param requirements the requirements to remove
+ */
+ public void removeRequirements( List requirements )
+ {
+ this.requirements.removeAll( requirements );
+ }
+
+ /**
+ * Returns all project requirements of this component.
+ *
+ * @return all project requirements of this component
+ */
+ public List getRequirements()
+ {
+ return Collections.unmodifiableList( requirements );
+ }
+
+ /**
+ * Returns an id of the factory used to create this component.
+ *
+ * @return an id of the factory used to create this component
+ */
+ public String getComponentFactory()
+ {
+ return componentFactory;
+ }
+
+ /**
+ * Sets the id of the factory to use to create this component. For example, "jruby" will use a JRuby factory.
+ *
+ * @param componentFactory
+ */
+ public void setComponentFactory( String componentFactory )
+ {
+ this.componentFactory = componentFactory;
+ }
+
+ /**
+ * Returns the ID of the type of composer this component will use. For example, "setter" or "field" for the
+ * different types of dependency injection.
+ *
+ * @return the ID of the type of composer this component will use
+ */
+ public String getComponentComposer()
+ {
+ return componentComposer;
+ }
+
+ /**
+ * Sets a representation of the composer this component uses.
+ *
+ * @param componentComposer string representation of the composer to use
+ */
+ public void setComponentComposer( String componentComposer )
+ {
+ this.componentComposer = componentComposer;
+ }
+
+ /**
+ * Return a human-readable description of this component.
+ *
+ * @return a human-readable description of this component
+ */
+ public String getDescription()
+ {
+ return description;
+ }
+
+ /**
+ * Sets a description of this component for users to read.
+ *
+ * @param description a human-readable description of this component
+ */
+ public void setDescription( String description )
+ {
+ this.description = description;
+ }
+
+ /**
+ * Sets the instantiation-strategy for this component. For example, "container".
+ *
+ * @param instantiationStrategy
+ */
+ public void setInstantiationStrategy( String instantiationStrategy )
+ {
+ this.instantiationStrategy = instantiationStrategy;
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ /**
+ * Returns true if this may be in an isolated classrealm.
+ *
+ * @return true if this may be in an isolated classrealm
+ */
+ public boolean isIsolatedRealm()
+ {
+ return isolatedRealm;
+ }
+
+ /**
+ * Sets the component set descriptor of components and dependencies for this component.
+ *
+ * @param componentSetDescriptor the component set descriptor of components and dependencies
+ */
+ public void setComponentSetDescriptor( ComponentSetDescriptor componentSetDescriptor )
+ {
+ this.componentSetDescriptor = componentSetDescriptor;
+ }
+
+ /**
+ * Returns the component set descriptor.
+ *
+ * @return the component set descriptor
+ */
+ public ComponentSetDescriptor getComponentSetDescriptor()
+ {
+ return componentSetDescriptor;
+ }
+
+ /**
+ * Sets that this component may be in an isolated classrealm.
+ *
+ * @param isolatedRealm true if this component may be in an isolated classrealm
+ */
+ public void setIsolatedRealm( boolean isolatedRealm )
+ {
+ this.isolatedRealm = isolatedRealm;
+ }
+
+ /**
+ * Returns the type of component configurator for this project. For example "basic" for normal, or "map-oriented"
+ * for map oriented components.
+ *
+ * @return the type of component configurator for this project
+ */
+ public String getComponentConfigurator()
+ {
+ return componentConfigurator;
+ }
+
+ /**
+ * Sets the type of component configurator for this project.
+ *
+ * @param componentConfigurator
+ */
+ public void setComponentConfigurator( String componentConfigurator )
+ {
+ this.componentConfigurator = componentConfigurator;
+ }
+
+ /**
+ * The ClassRealm that this component lives under.
+ *
+ * @return ClassRealm that this component lives under
+ */
+ public ClassRealm getRealm()
+ {
+ return realm;
+ }
+
+ /**
+ * Set the ClassRealm that this component lives under.
+ *
+ * @param realm the ClassRealm that this component lives under
+ */
+ public void setRealm( ClassRealm realm )
+ {
+ this.realm = realm;
+
+ // reload implementation class
+ implementationClass = null;
+ attemptImplementationLoad();
+
+ // reload role class
+ roleClass = null;
+ attemptRoleLoad();
+ }
+
+ // Component identity established here!
+ public boolean equals( Object other )
+ {
+ if ( !( other instanceof ComponentDescriptor ) )
+ {
+ return false;
+ }
+ else
+ {
+ ComponentDescriptor> otherDescriptor = (ComponentDescriptor>) other;
+
+ boolean isEqual = true;
+
+ String role = getRole();
+ String otherRole = otherDescriptor.getRole();
+
+ isEqual = isEqual && ( ( role.equals( otherRole ) ) || role.equals( otherRole ) );
+
+ String roleHint = getRoleHint();
+ String otherRoleHint = otherDescriptor.getRoleHint();
+
+ isEqual = isEqual && ( ( roleHint.equals( otherRoleHint ) ) || roleHint.equals( otherRoleHint ) );
+
+ return isEqual;
+ }
+ }
+
+ public String toString()
+ {
+ return getClass().getName() + " [role: '" + getRole() + "', hint: '" + getRoleHint() + "', realm: "
+ + ( realm == null ? "NULL" : "'" + realm + "'" ) + "]";
+ }
+
+ public int hashCode()
+ {
+ int result = getRole().hashCode() + 1;
+
+ String hint = getRoleHint();
+
+ if ( hint != null )
+ {
+ result += hint.hashCode();
+ }
+
+ return result;
+ }
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/ComponentRequirement.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/ComponentRequirement.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/ComponentRequirement.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/ComponentRequirement.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,187 @@
+package org.codehaus.plexus.component.repository;
+
+/*
+ * Copyright 2001-2006 Codehaus Foundation.
+ *
+ * Licensed 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.
+ */
+
+/**
+ * This represents a component this is required by another component.
+ *
+ * @author Michal Maczka
+ * @version $Id: ComponentRequirement.java 8525 2009-11-06 15:23:51Z bentmann $
+ */
+public class ComponentRequirement
+{
+ private String role;
+
+ private String roleHint = "";
+
+ private String fieldName;
+
+ private String fieldMappingType;
+
+ private boolean optional;
+
+ /**
+ * Returns the field name that this component requirement will inject.
+ * @return the field name that this component requirement will inject
+ */
+ public String getFieldName()
+ {
+ return fieldName;
+ }
+
+ /**
+ * Sets the name of the field that will be populated by the required
+ * component.
+ * @param fieldName the name of the field to be populated
+ */
+ public void setFieldName( String fieldName )
+ {
+ this.fieldName = fieldName;
+ }
+
+ /**
+ * Returns the role of the required component.
+ * @return the role of the required component
+ */
+ public String getRole()
+ {
+ return role;
+ }
+
+ /**
+ * Sets the role of the require component.
+ * @param role the required component's role
+ */
+ public void setRole( String role )
+ {
+ this.role = role;
+ }
+
+ /**
+ * Returns the role-hint of the required component.
+ * @return the role-hint of the required component
+ */
+ public String getRoleHint()
+ {
+ return roleHint;
+ }
+
+ /**
+ * Sets the role-hint of the require component.
+ * Passing null or an empty string will match any available implementation.
+ * @param roleHint the required component's role-hint
+ */
+ public void setRoleHint( String roleHint )
+ {
+ this.roleHint = ( roleHint != null ) ? roleHint : "";
+ }
+
+ /**
+ * Returns the type of the field this component requirement will inject.
+ * @return the type of the field this component requirement will inject
+ */
+ public String getFieldMappingType()
+ {
+ return fieldMappingType;
+ }
+
+ /**
+ * Sets the type of the field that will be populated by the required
+ * component.
+ * @param fieldType the type of the field to be populated
+ */
+ public void setFieldMappingType( String fieldType )
+ {
+ this.fieldMappingType = fieldType;
+ }
+
+ /**
+ * Whether this component requirement is optional and needs not be satisfied
+ *
+ * @return {@code true} if the requested component may be missing, {@code false} if the component is mandatory.
+ * @since 1.3.0
+ */
+ public boolean isOptional()
+ {
+ return optional;
+ }
+
+ /**
+ * Controls whether a failure to satisfy this requirement can be tolerated by host component or whether construction
+ * of the host component should also fail.
+ *
+ * @param optional {@code true} if the requested component may be missing, {@code false} if the component is
+ * mandatory.
+ * @since 1.3.0
+ */
+ public void setOptional( boolean optional )
+ {
+ this.optional = optional;
+ }
+
+ public String toString()
+ {
+ return "ComponentRequirement{" +
+ "role='" + getRole() + "'" + ", " +
+ "roleHint='" + getRoleHint() + "', " +
+ "fieldName='" + getFieldName() + "'" +
+ "}";
+ }
+
+ /**
+ * Returns a human-friendly key, suitable for display.
+ * @return a human-friendly key
+ */
+ public String getHumanReadableKey()
+ {
+ StringBuilder key = new StringBuilder();
+
+ key.append( "role: '").append( getRole() ).append( "'" );
+
+ if ( getRoleHint() != null )
+ {
+ key.append( ", role-hint: '" ).append( getRoleHint() ).append( "'. " );
+ }
+
+ if ( getFieldName() != null )
+ {
+ key.append( ", field name: '" ).append( getFieldName() ).append( "' " );
+ }
+
+ return key.toString();
+ }
+
+ public boolean equals( Object other )
+ {
+ if ( other instanceof ComponentRequirement )
+ {
+ String myId = role + ":" + roleHint;
+
+ ComponentRequirement req = (ComponentRequirement) other;
+ String otherId = req.role + ":" + req.roleHint;
+
+ return myId.equals( otherId );
+ }
+
+ return false;
+ }
+
+ public int hashCode()
+ {
+ return ( role + ":" + roleHint ).hashCode();
+ }
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/ComponentRequirementList.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/ComponentRequirementList.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/ComponentRequirementList.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/ComponentRequirementList.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,43 @@
+package org.codehaus.plexus.component.repository;
+
+import java.util.List;
+
+/**
+ * Created by IntelliJ IDEA.
+ *
+ * @author Andrew Williams
+ * @version $Id: ComponentRequirementList.java 7828 2008-11-14 22:07:56Z dain $
+ * @since 1.0
+ */
+public class ComponentRequirementList
+ extends ComponentRequirement
+{
+ private List roleHints;
+
+ public List getRoleHints()
+ {
+ return roleHints;
+ }
+
+ public void setRoleHints(List roleHints)
+ {
+ this.roleHints = roleHints;
+ }
+
+ public String getRoleHint()
+ {
+ StringBuilder buffer = new StringBuilder();
+ for ( String hint : roleHints )
+ {
+ if (buffer.length() > 0)
+ {
+ buffer.append(",");
+ }
+
+ buffer.append(hint);
+
+ }
+
+ return buffer.toString();
+ }
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/ComponentSetDescriptor.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/ComponentSetDescriptor.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/ComponentSetDescriptor.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/ComponentSetDescriptor.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,164 @@
+package org.codehaus.plexus.component.repository;
+
+/*
+ * Copyright 2001-2006 Codehaus Foundation.
+ *
+ * Licensed 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 java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Contains a set of ComponentDescriptors and the set's dependencies.
+ *
+ * @author Jason van Zyl
+ * @author Trygve Laugstøl
+ * @version $Id: ComponentSetDescriptor.java 7828 2008-11-14 22:07:56Z dain $
+ */
+public class ComponentSetDescriptor
+{
+ // This field is not currently used in Maven, or Plexus
+ private String id;
+
+ /** The source location of this component source descriptor */
+ private String source;
+
+ /** Flag to indicate whether this component should be loaded in a realm/classloader of its own. */
+ private boolean isolatedRealm;
+
+ /** The component descriptors that can be found within this component set descriptor. */
+ private final List> components = new ArrayList>();
+
+ /** The dependencies that are required by the set of components found in this component set descriptor. */
+ private final List dependencies = new ArrayList();
+
+ /**
+ * Returns a list of components in this set.
+ * @return a list of components
+ */
+ public List> getComponents()
+ {
+ return components;
+ }
+
+ /**
+ * Add a new ComponentDescriptor to this set.
+ * @param cd the ComponentDescriptor to add
+ */
+ public void addComponentDescriptor( ComponentDescriptor> cd )
+ {
+ components.add( cd );
+ }
+
+ /**
+ * Sets a List of components as this set's contents.
+ * @param components the List of components to set
+ */
+ public void setComponents( List> components )
+ {
+ this.components.clear();
+ this.components.addAll(components);
+ }
+
+ /**
+ * Returns a List of dependencies of this set of components.
+ * @return a List of dependencies of this set of components
+ */
+ public List getDependencies()
+ {
+ return dependencies;
+ }
+
+ /**
+ * Add a depenency to this set's contents.
+ * @param cd the ComponentDependency to add
+ */
+ public void addDependency( ComponentDependency cd )
+ {
+ dependencies.add( cd );
+ }
+
+ /**
+ * Sets a List of dependencies as this set's component dependencies.
+ * @param dependencies the List of components to set
+ */
+ public void setDependencies( List dependencies )
+ {
+ this.dependencies.clear();
+ this.dependencies.addAll(dependencies);
+ }
+
+ /**
+ * Sets that this set of components may be in an isolated classrealm.
+ * @param isolatedRealm true if this set of components may be in an
+ * isolated classrealm
+ */
+ public void setIsolatedRealm( boolean isolatedRealm )
+ {
+ this.isolatedRealm = isolatedRealm;
+ }
+
+ /**
+ * Returns true if this set may be in an isolated classrealm.
+ * @return true if this set may be in an isolated classrealm
+ */
+ public boolean isIsolatedRealm()
+ {
+ return isolatedRealm;
+ }
+
+ /**
+ * Returns the identifier of this set.
+ * @return the identifier of this set
+ */
+ public String getId()
+ {
+ return id;
+ }
+
+ /**
+ * Sets the identifier of this set.
+ * @param id the identifier to set
+ */
+ public void setId( String id )
+ {
+ this.id = id;
+ }
+
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder();
+
+ sb.append( "Component Descriptor: " );
+
+ for ( ComponentDescriptor> cd : components )
+ {
+ sb.append( cd.getHumanReadableKey() ).append( "\n" );
+ }
+
+ sb.append( "---" );
+
+ return sb.toString();
+ }
+
+ public String getSource()
+ {
+ return source;
+ }
+
+ public void setSource( String source )
+ {
+ this.source = source;
+ }
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/README.txt plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/README.txt
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/README.txt 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/component/repository/README.txt 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,3 @@
+This package contains some classes copied from the container before it started using the "default" role hints.
+
+This can be removed once all supported maven versions are using a container newer than 1.0-alpha-19.
\ No newline at end of file
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/maven/plugin/AbstractDescriptorMojo.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/maven/plugin/AbstractDescriptorMojo.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/maven/plugin/AbstractDescriptorMojo.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/maven/plugin/AbstractDescriptorMojo.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,74 @@
+package org.codehaus.plexus.maven.plugin;
+
+import java.util.List;
+
+/*
+ * The MIT License
+ *
+ * Copyright (c) 2004-2006, The Codehaus
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectHelper;
+import org.codehaus.plexus.metadata.MetadataGenerator;
+
+/**
+ * Base class for Plexus Metadata mojos.
+ *
+ * @author Jason van Zyl
+ */
+public abstract class AbstractDescriptorMojo
+ extends AbstractMojo
+{
+
+ /**
+ * Current project
+ */
+ @Parameter( defaultValue = "${project}", required = true, readonly = true )
+ protected MavenProject mavenProject;
+
+ /**
+ * The file encoding of the source files.
+ *
+ * @parameter default-value="${project.build.sourceEncoding}"
+ */
+ @Parameter( defaultValue = "${project.build.sourceEncoding}" )
+ protected String sourceEncoding;
+
+ /**
+ * The extractors to use. By default all available extractors will be used.
+ *
+ * Known extractors:
+ *
+ *
source
+ *
class
+ *
+ *
+ */
+ @Parameter
+ protected List extractors;
+
+ @Component
+ protected MavenProjectHelper mavenProjectHelper;
+
+ @Component
+ protected MetadataGenerator metadataGenerator;
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/maven/plugin/PlexusDescriptorMojo.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/maven/plugin/PlexusDescriptorMojo.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/maven/plugin/PlexusDescriptorMojo.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/maven/plugin/PlexusDescriptorMojo.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,86 @@
+package org.codehaus.plexus.maven.plugin;
+
+/*
+ * Copyright (c) 2004-2005, Codehaus.org
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+import java.io.File;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.codehaus.plexus.metadata.MetadataGenerationRequest;
+
+/**
+ * Generates a Plexus components.xml component descriptor file from source (javadoc) or
+ * class annotations.
+ *
+ * @author Jason van Zyl
+ * @author Trygve Laugstøl
+ * @version $Id$
+ */
+@Mojo( name = "generate-metadata", defaultPhase = LifecyclePhase.PROCESS_CLASSES, requiresDependencyResolution = ResolutionScope.COMPILE )
+public class PlexusDescriptorMojo
+ extends AbstractDescriptorMojo
+{
+ /**
+ * The output location for the generated descriptor.
+ */
+ @Parameter( defaultValue = "${project.build.outputDirectory}/META-INF/plexus/components.xml", required = true )
+ protected File generatedMetadata;
+
+ /**
+ * The location of manually crafted component descriptors. The contents of the descriptor files in this directory is
+ * merged with the information extracted from the project's sources/classes.
+ */
+ @Parameter( defaultValue = "${basedir}/src/main/resources/META-INF/plexus", required = true )
+ protected File staticMetadataDirectory;
+
+ /**
+ * The output location for the intermediary descriptor. This descriptors contains only the information extracted
+ * from the project's sources/classes.
+ */
+ @Parameter( defaultValue = "${project.build.directory}/components.xml", required = true )
+ protected File intermediaryMetadata;
+
+ public void execute()
+ throws MojoExecutionException
+ {
+ MetadataGenerationRequest request = new MetadataGenerationRequest();
+
+ try
+ {
+ request.classpath = mavenProject.getCompileClasspathElements();
+ request.classesDirectory = new File( mavenProject.getBuild().getOutputDirectory() );
+ request.sourceDirectories = mavenProject.getCompileSourceRoots();
+ request.sourceEncoding = sourceEncoding;
+ request.componentDescriptorDirectory = staticMetadataDirectory;
+ request.intermediaryFile = intermediaryMetadata;
+ request.outputFile = generatedMetadata;
+ request.extractors = extractors;
+
+ metadataGenerator.generateDescriptor( request );
+ }
+ catch ( Exception e )
+ {
+ throw new MojoExecutionException( "Error generating metadata: ", e );
+ }
+ }
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/maven/plugin/PlexusMergeMojo.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/maven/plugin/PlexusMergeMojo.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/maven/plugin/PlexusMergeMojo.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/maven/plugin/PlexusMergeMojo.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,86 @@
+package org.codehaus.plexus.maven.plugin;
+
+/*
+ * Copyright (c) 2004-2006, Codehaus.org
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.codehaus.plexus.metadata.merge.Merger;
+
+/**
+ * Merges a set of Plexus descriptors into one descriptor file.
+ *
+ * @author Jason van Zyl
+ * @author Trygve Laugstøl
+ * @version $Id$
+ */
+@Mojo( name = "merge-metadata", defaultPhase = LifecyclePhase.PROCESS_CLASSES )
+public class PlexusMergeMojo
+ extends AbstractMojo
+{
+ /**
+ * The destination for the merged descriptor.
+ */
+ @Parameter( defaultValue = "${project.build.outputDirectory}/META-INF/plexus/components.xml", required = true )
+ private File output;
+
+ /**
+ * The paths of the input descriptors to merge.
+ */
+ @Parameter
+ private File[] descriptors;
+
+ @Component( hint = "componentsXml" )
+ private Merger merger;
+
+ public void execute()
+ throws MojoExecutionException
+ {
+ List files = new ArrayList();
+
+ if ( descriptors != null )
+ {
+ files.addAll( Arrays.asList( descriptors ) );
+ }
+
+ if ( files.isEmpty() )
+ {
+ return;
+ }
+
+ try
+ {
+ merger.mergeDescriptors( output, files );
+ }
+ catch ( IOException e )
+ {
+ throw new MojoExecutionException( "Error while executing component descritor creator.", e );
+ }
+ }
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/maven/plugin/PlexusTestDescriptorMojo.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/maven/plugin/PlexusTestDescriptorMojo.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/maven/plugin/PlexusTestDescriptorMojo.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/maven/plugin/PlexusTestDescriptorMojo.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,86 @@
+package org.codehaus.plexus.maven.plugin;
+
+/*
+ * Copyright (c) 2004-2005, Codehaus.org
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+import java.io.File;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
+import org.codehaus.plexus.metadata.MetadataGenerationRequest;
+
+/**
+ * Generates a Plexus components.xml component descriptor file from test source (javadoc)
+ * or test class annotations.
+ *
+ * @author Jason van Zyl
+ * @author Trygve Laugstøl
+ * @version $Id$
+ */
+@Mojo( name = "generate-test-metadata", defaultPhase = LifecyclePhase.PROCESS_TEST_CLASSES, requiresDependencyResolution = ResolutionScope.TEST )
+public class PlexusTestDescriptorMojo
+ extends AbstractDescriptorMojo
+{
+ /**
+ * The output location for the generated descriptor.
+ */
+ @Parameter( defaultValue = "${project.build.testOutputDirectory}/META-INF/plexus/components.xml", required = true )
+ protected File testGeneratedMetadata;
+
+ /**
+ * The location of manually crafted component descriptors. The contents of the descriptor files in this directory is
+ * merged with the information extracted from the project's sources/classes.
+ */
+ @Parameter( defaultValue = "${basedir}/src/test/resources/META-INF/plexus", required = true )
+ protected File testStaticMetadataDirectory;
+
+ /**
+ * The output location for the intermediary descriptor. This descriptors contains only the information extracted
+ * from the project's sources/classes.
+ */
+ @Parameter( defaultValue = "${project.build.directory}/test-components.xml", required = true )
+ protected File testIntermediaryMetadata;
+
+ public void execute()
+ throws MojoExecutionException
+ {
+ MetadataGenerationRequest request = new MetadataGenerationRequest();
+
+ try
+ {
+ request.classpath = mavenProject.getTestClasspathElements();
+ request.classesDirectory = new File( mavenProject.getBuild().getTestOutputDirectory() );
+ request.sourceDirectories = mavenProject.getTestCompileSourceRoots();
+ request.sourceEncoding = sourceEncoding;
+ request.componentDescriptorDirectory = testStaticMetadataDirectory;
+ request.intermediaryFile = testIntermediaryMetadata;
+ request.outputFile = testGeneratedMetadata;
+ request.extractors = extractors;
+
+ metadataGenerator.generateDescriptor( request );
+ }
+ catch ( Exception e )
+ {
+ throw new MojoExecutionException( "Error generating test metadata: ", e );
+ }
+ }
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnClass.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnClass.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnClass.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnClass.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2008 the original author or authors.
+ *
+ * Licensed 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.
+ */
+
+package org.codehaus.plexus.metadata.ann;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.objectweb.asm.Type;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class AnnClass {
+
+ private int access;
+ private String name;
+ private String superName;
+ private String[] interfaces;
+
+ private Map anns = new LinkedHashMap();
+ private Map fields = new LinkedHashMap();
+ private Map methods = new LinkedHashMap();
+ private ClassLoader cl;
+
+ // setters
+
+ public AnnClass(ClassLoader cl) {
+ this.cl = cl;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setAccess(int access) {
+ this.access = access;
+ }
+
+ public void setSuperName(String superName) {
+ this.superName = superName;
+ }
+
+ public void setInterfaces(String[] interfaces) {
+ this.interfaces = interfaces;
+ }
+
+ public void addAnn(Ann ann) {
+ anns.put(ann.getDesc(), ann);
+ }
+
+ public void addField(AnnField field) {
+ fields.put(field.getName(), field);
+ }
+
+ public void addMethod(AnnMethod method) {
+ methods.put(method.getName() + method.getDesc(), method);
+ }
+
+ // getters
+
+ public ClassLoader getClassLoader() {
+ return cl;
+ }
+
+ public int getAccess() {
+ return access;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getSuperName() {
+ return superName;
+ }
+
+ public String[] getInterfaces() {
+ return interfaces;
+ }
+
+ public Map getAnns() {
+ return anns;
+ }
+
+ public Map getFields() {
+ return fields;
+ }
+
+ public Map getMethods() {
+ return methods;
+ }
+
+ public Set getFieldNames() {
+ return fields.keySet();
+ }
+
+ public Set getMethodKeys() {
+ return methods.keySet();
+ }
+
+ // conversion to java.lang.Annotation
+
+ public T getAnnotation(Class c) {
+ Ann ann = anns.get(Type.getDescriptor(c));
+ return ann == null ? null : ann.getAnnotation(c, cl);
+ }
+
+ public T getFieldAnnotation(String fieldName, Class c) {
+ AnnField field = fields.get(fieldName);
+ return field==null ? null : field.getAnnotation(c);
+ }
+
+ public T getMethodAnnotation(String methodKey, Class c) {
+ AnnMethod method = methods.get(methodKey);
+ return method==null ? null : method.getAnnotation(c);
+ }
+
+}
+
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnEnum.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnEnum.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnEnum.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnEnum.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2008 the original author or authors.
+ *
+ * Licensed 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.
+ */
+
+package org.codehaus.plexus.metadata.ann;
+
+import org.objectweb.asm.Type;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class AnnEnum {
+
+ private final String desc;
+ private final String value;
+
+ public AnnEnum(String desc, String value) {
+ this.desc = desc;
+ this.value = value;
+ }
+
+ public String getDesc() {
+ return desc;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public String getType() {
+ return Type.getType(desc).getClassName();
+ }
+
+ public int hashCode() {
+ return 31 * (31 + desc.hashCode()) + value.hashCode();
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ AnnEnum other = (AnnEnum) obj;
+ if (desc == null) {
+ if (other.desc != null) {
+ return false;
+ }
+ } else if (!desc.equals(other.desc)) {
+ return false;
+ }
+ if (value == null) {
+ if (other.value != null) {
+ return false;
+ }
+ } else if (!value.equals(other.value)) {
+ return false;
+ }
+ return true;
+ }
+
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnField.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnField.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnField.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnField.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2008 the original author or authors.
+ *
+ * Licensed 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.
+ */
+
+package org.codehaus.plexus.metadata.ann;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.objectweb.asm.Type;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class AnnField {
+
+ private final AnnClass owner;
+ private final int access;
+ private final String name;
+ private final String desc;
+ private Map anns = new LinkedHashMap();
+
+ public AnnField(AnnClass owner, int access, String name, String desc) {
+ this.owner = owner;
+ this.access = access;
+ this.desc = desc;
+ this.name = name;
+ }
+
+ public int getAccess() {
+ return access;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getDesc() {
+ return desc;
+ }
+
+ public Map getAnns() {
+ return anns;
+ }
+
+ public String getType() {
+ return Type.getType(desc).getClassName();
+ }
+
+ public void addAnn(Ann ann) {
+ anns.put(ann.getDesc(), ann);
+ }
+
+ public T getAnnotation(Class c) {
+ Ann ann = anns.get(Type.getDescriptor(c));
+ return ann == null ? null : ann.getAnnotation(c, owner.getClassLoader());
+ }
+
+}
+
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnInvocationHandler.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnInvocationHandler.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnInvocationHandler.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnInvocationHandler.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2008 the original author or authors.
+ *
+ * Licensed 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.
+ */
+
+package org.codehaus.plexus.metadata.ann;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Arrays;
+import java.util.Map;
+
+import org.objectweb.asm.Type;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class AnnInvocationHandler implements InvocationHandler {
+ private final Ann ann;
+ private final ClassLoader cl;
+ private final Class> c;
+
+ public AnnInvocationHandler(Ann ann, ClassLoader cl, Class> c) {
+ this.ann = ann;
+ this.cl = cl;
+ this.c = c;
+ }
+
+ public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
+ String name = m.getName();
+
+ if("toString".equals(name)) {
+ StringBuilder sb = new StringBuilder(ann.getType());
+ sb.append("[");
+ String sep = "";
+ for(Map.Entry e : ann.getParams().entrySet()) {
+ // TODO conversion for class, array, enum, and annotation types
+ sb.append(sep).append(e.getKey()).append("=").append(e.getValue());
+ sep = "; ";
+ }
+ sb.append("]");
+ return sb.toString();
+ }
+
+ Object value = ann.getParams().get(name);
+ if(value!=null) {
+ if(value instanceof Type) {
+ String className = ((Type) value).getClassName();
+ try {
+ return Class.forName(className, false, cl);
+ } catch(ClassNotFoundException ex) {
+ if(cl instanceof URLClassLoader) {
+ URL[] urls = ((URLClassLoader) cl).getURLs();
+ throw new RuntimeException("Unable to load class " + className + " from " + Arrays.toString(urls), ex);
+ }
+ throw new RuntimeException("Unable to load class " + className + " from " + cl, ex);
+ }
+ }
+ // TODO conversion for class, array, enum, and annotation types
+ return value;
+ } else {
+ Method am = c.getDeclaredMethod(m.getName(), m.getParameterTypes());
+ return am.getDefaultValue();
+ }
+ }
+
+}
+
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/Ann.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/Ann.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/Ann.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/Ann.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2008 the original author or authors.
+ *
+ * Licensed 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.
+ */
+
+package org.codehaus.plexus.metadata.ann;
+
+import java.lang.reflect.Proxy;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.objectweb.asm.Type;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class Ann {
+
+ private String desc;
+ private Map params = new LinkedHashMap();
+
+ public Ann(String desc) {
+ this.desc = desc;
+ }
+
+ public void addParam(String name, Object value) {
+ params.put(name, value);
+ }
+
+ public String getDesc() {
+ return desc;
+ }
+
+ public String getType() {
+ return Type.getType(desc).getClassName();
+ }
+
+ public Map getParams() {
+ return params;
+ }
+
+ @SuppressWarnings("unchecked")
+ public T getAnnotation(Class c, ClassLoader cl) {
+ return (T) Proxy.newProxyInstance(Ann.class.getClassLoader(), new Class[] { c }, //
+ new AnnInvocationHandler(this, cl, c));
+ }
+
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnMethod.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnMethod.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnMethod.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnMethod.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2008 the original author or authors.
+ *
+ * Licensed 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.
+ */
+
+package org.codehaus.plexus.metadata.ann;
+
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.objectweb.asm.Type;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class AnnMethod {
+
+ private final AnnClass owner;
+ private final int access;
+ private final String name;
+ private final String desc;
+ private Map anns = new LinkedHashMap();
+ private Map> paramAnns = new HashMap>();
+
+ public AnnMethod(AnnClass owner, int access, String name, String desc) {
+ this.owner = owner;
+ this.access = access;
+ this.name = name;
+ this.desc = desc;
+ }
+
+ public int getAccess() {
+ return access;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getDesc() {
+ return desc;
+ }
+
+ public Map getAnns() {
+ return anns;
+ }
+
+ public Map> getParamAnns() {
+ return paramAnns;
+ }
+
+ public void addAnn(Ann ann) {
+ anns.put(ann.getDesc(), ann);
+ }
+
+ public void addParamAnn(int parameter, Ann ann) {
+ Map anns = paramAnns.get(parameter);
+ if(anns==null) {
+ anns = new LinkedHashMap();
+ paramAnns.put(parameter, anns);
+ }
+ anns.put(ann.getDesc(), ann);
+ }
+
+ public T getAnnotation(Class c) {
+ Ann ann = anns.get(Type.getDescriptor(c));
+ return ann == null ? null : ann.getAnnotation(c, owner.getClassLoader());
+ }
+
+ public T getParameterAnnotation(int parameter, Class c) {
+ Map anns = paramAnns.get(parameter);
+ if (anns == null) {
+ return null;
+ }
+ Ann ann = anns.get(Type.getDescriptor(c));
+ return ann == null ? null : ann.getAnnotation(c, owner.getClassLoader());
+ }
+
+}
+
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnReader.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnReader.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnReader.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ann/AnnReader.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,150 @@
+/*
+ * Copyright (C) 2008 the original author or authors.
+ *
+ * Licensed 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.
+ */
+
+package org.codehaus.plexus.metadata.ann;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+
+/**
+ * @author Eugene Kuleshov
+ */
+public class AnnReader extends ClassVisitor {
+
+ private final AnnClass annClass;
+
+ private AnnReader(AnnClass annClass) {
+ super(Opcodes.ASM5);
+ this.annClass = annClass;
+ }
+
+ public static AnnClass read(InputStream is, ClassLoader cl) throws IOException {
+ AnnClass annClass = new AnnClass(cl);
+ AnnReader cv = new AnnReader(annClass);
+ ClassReader r = new ClassReader(is);
+ r.accept(cv, ClassReader.SKIP_FRAMES | ClassReader.SKIP_CODE);
+ return annClass;
+ }
+
+ public void visit(int version, int access, String name, String signature,
+ String superName, String[] interfaces) {
+ annClass.setName(name);
+ annClass.setAccess(access);
+ annClass.setSuperName(superName);
+ annClass.setInterfaces(interfaces);
+ }
+
+ public AnnotationVisitor visitAnnotation(final String desc, boolean visible) {
+ Ann ann = new Ann(desc);
+ annClass.addAnn(ann);
+ return new AnnAnnReader(ann);
+ }
+
+ public FieldVisitor visitField(int access, final String name, final String desc, String signature, Object value) {
+ final AnnField field = new AnnField(annClass, access, name, desc);
+ annClass.addField(field);
+ return new FieldVisitor(Opcodes.ASM5) {
+
+ public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+ Ann ann = new Ann(desc);
+ field.addAnn(ann);
+ return new AnnAnnReader(ann);
+ }
+ };
+ }
+
+ public MethodVisitor visitMethod(int access, final String mname, final String mdesc,
+ String signature, String[] exceptions) {
+ final AnnMethod method = new AnnMethod(annClass, access, mname, mdesc);
+ annClass.addMethod(method);
+
+ return new MethodVisitor(Opcodes.ASM5) {
+
+ public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+ Ann ann = new Ann(desc);
+ method.addAnn(ann);
+ return new AnnAnnReader(ann);
+ }
+
+ public AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean visible) {
+ Ann ann = new Ann(desc);
+ method.addParamAnn(parameter, ann);
+ return new AnnAnnReader(ann);
+ }
+ };
+ }
+
+ static class AnnAnnReader extends AnnotationVisitor {
+ private Ann ann;
+
+ public AnnAnnReader(Ann ann) {
+ super(Opcodes.ASM5);
+ this.ann = ann;
+ }
+
+ public void visit(String name, Object value) {
+ ann.addParam(name, value);
+ }
+
+ public void visitEnum(String name, String desc, String value) {
+ ann.addParam(name, new AnnEnum(desc, value));
+ }
+
+ public AnnotationVisitor visitAnnotation(String name, String desc) {
+ Ann ann = new Ann(desc);
+ this.ann.addParam(name, ann);
+ return new AnnAnnReader(ann);
+ }
+
+ public AnnotationVisitor visitArray(String name) {
+ return new AnnAnnArrayReader(ann, name);
+ }
+ }
+
+ static class AnnAnnArrayReader extends AnnotationVisitor {
+
+ private Ann ann;
+
+ private String name;
+
+ // TODO good enough for now, but does not cover general case
+ private ArrayList array = new ArrayList();
+
+ public AnnAnnArrayReader(Ann ann, String name) {
+ super(Opcodes.ASM5);
+ this.ann = ann;
+ this.name = name;
+ }
+
+ public void visit(String name, Object value) {
+ if(value instanceof String) {
+ array.add((String) value);
+ }
+ }
+
+ public void visitEnd() {
+ ann.addParam(name, array.toArray(new String[array.size()]));
+ }
+ }
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ClassComponentDescriptorExtractor.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ClassComponentDescriptorExtractor.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ClassComponentDescriptorExtractor.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ClassComponentDescriptorExtractor.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,165 @@
+/*
+ * Copyright (C) 2007 the original author or authors.
+ *
+ * Licensed 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.
+ */
+
+package org.codehaus.plexus.metadata;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.repository.ComponentDescriptor;
+import org.codehaus.plexus.metadata.gleaner.AnnotationComponentGleaner;
+import org.codehaus.plexus.metadata.gleaner.ClassComponentGleaner;
+import org.codehaus.plexus.util.DirectoryScanner;
+
+/**
+ * Extracts {@link ComponentDescriptor} from class files.
+ *
+ * @version $Id$
+ */
+@Component( role = ComponentDescriptorExtractor.class, hint = "class" )
+public class ClassComponentDescriptorExtractor
+ extends ComponentDescriptorExtractorSupport
+{
+ private ClassComponentGleaner gleaner;
+
+ public ClassComponentDescriptorExtractor( final ClassComponentGleaner gleaner )
+ {
+ this.gleaner = gleaner;
+ }
+
+ public ClassComponentDescriptorExtractor()
+ {
+ this.gleaner = new AnnotationComponentGleaner();
+ }
+
+ public List> extract( MetadataGenerationRequest configuration, final ComponentDescriptor>[] roleDefaults )
+ throws Exception
+ {
+ // We don't have a reasonable default to use, so just puke up
+ if ( gleaner == null )
+ {
+ throw new IllegalStateException( "Gleaner is not bound" );
+ }
+
+ if ( !configuration.classesDirectory.exists() )
+ {
+ return Collections.emptyList();
+ }
+
+ if ( configuration.useContextClassLoader )
+ {
+ return extract( configuration.classesDirectory, Thread.currentThread().getContextClassLoader(), getDefaultsByRole( roleDefaults ) );
+ }
+ else
+ {
+ ClassLoader prev = Thread.currentThread().getContextClassLoader();
+ ClassLoader cl = createClassLoader( configuration.classpath );
+
+ Thread.currentThread().setContextClassLoader( cl );
+
+ try
+ {
+ return extract( configuration.classesDirectory, cl, getDefaultsByRole( roleDefaults ) );
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader( prev );
+ }
+ }
+ }
+
+ private ClassLoader createClassLoader( final List elements )
+ throws Exception
+ {
+ List list = new ArrayList();
+
+ // Add the projects dependencies
+ for ( String filename : elements )
+ {
+ try
+ {
+ list.add( new File( filename ).toURI().toURL() );
+ }
+ catch ( MalformedURLException e )
+ {
+ throw new MojoExecutionException( "Invalid classpath entry: " + filename, e );
+ }
+ }
+
+ URL[] urls = list.toArray( new URL[list.size()] );
+
+ //getLogger().debug( "Classpath:" );
+ for (URL url : urls) {
+ //getLogger().debug( " " + urls[i] );
+ }
+
+ return new URLClassLoader( urls, null );
+ }
+
+ private List> extract( File classesDir, ClassLoader cl, Map> defaultsByRole )
+ throws Exception
+ {
+ assert classesDir != null;
+ assert cl != null;
+ assert defaultsByRole != null;
+
+ List> descriptors = new ArrayList>();
+
+ DirectoryScanner scanner = new DirectoryScanner();
+ scanner.setBasedir( classesDir );
+ scanner.addDefaultExcludes();
+ scanner.setIncludes( new String[] { "**/*.class" } );
+ // exclude special classes like module-info.class
+ scanner.setExcludes( new String[] { "**/*-*.class" } );
+
+ //getLogger().debug( "Scanning for classes in: " + classesDir );
+
+ scanner.scan();
+
+ String[] includes = scanner.getIncludedFiles();
+
+ for ( String include : includes )
+ {
+ String className = include.substring( 0, include.lastIndexOf( ".class" ) ).replace( '\\', '.' ).replace( '/', '.' );
+
+ try
+ {
+ // Class type = cl.loadClass( className );
+
+ ComponentDescriptor> descriptor = gleaner.glean( className, cl );
+
+ if ( descriptor != null )
+ {
+ applyDefaults( descriptor, defaultsByRole );
+
+ descriptors.add( descriptor );
+ }
+ }
+ catch ( VerifyError e )
+ {
+ // getLogger().error( "Failed to load class: " + className + "; cause: " + e );
+ }
+ }
+
+ return descriptors;
+ }
+}
\ No newline at end of file
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorExtractor.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorExtractor.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorExtractor.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorExtractor.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2007 the original author or authors.
+ *
+ * Licensed 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.
+ */
+
+package org.codehaus.plexus.metadata;
+
+import java.util.List;
+
+import org.codehaus.plexus.component.repository.ComponentDescriptor;
+
+/**
+ * An abstraction to allow pluggable {@link ComponentDescriptor} extraction to be dropped.
+ *
+ * @version $Id$
+ */
+public interface ComponentDescriptorExtractor
+{
+ String ROLE = ComponentDescriptorExtractor.class.getName();
+
+ List> extract( MetadataGenerationRequest configuration, ComponentDescriptor>[] roleDefaults )
+ throws Exception;
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorExtractorSupport.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorExtractorSupport.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorExtractorSupport.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorExtractorSupport.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2007 the original author or authors.
+ *
+ * Licensed 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.
+ */
+
+package org.codehaus.plexus.metadata;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.codehaus.plexus.component.repository.ComponentDescriptor;
+
+/**
+ * Support for {@link ComponentDescriptorExtractor} implementations.
+ *
+ * @version $Id$
+ */
+public abstract class ComponentDescriptorExtractorSupport
+ implements ComponentDescriptorExtractor
+{
+ protected Map> getDefaultsByRole( final ComponentDescriptor>[] roleDefaults )
+ {
+ Map> defaultsByRole = new HashMap>();
+
+ if ( roleDefaults != null )
+ {
+ for (ComponentDescriptor> roleDefault : roleDefaults) {
+ String role = roleDefault.getRole();
+
+ if (role == null) {
+ throw new IllegalArgumentException("Invalid role defaults; found null role in: " + roleDefault);
+ }
+
+ defaultsByRole.put(role, roleDefault);
+ }
+ }
+
+ return defaultsByRole;
+ }
+
+ protected void applyDefaults( ComponentDescriptor> descriptor, Map> defaultsByRole )
+ {
+ assert descriptor != null;
+ assert defaultsByRole != null;
+
+ if ( defaultsByRole.containsKey( descriptor.getRole() ) )
+ {
+ ComponentDescriptor> defaults = defaultsByRole.get( descriptor.getRole() );
+
+ if ( descriptor.getInstantiationStrategy() == null )
+ {
+ descriptor.setInstantiationStrategy( defaults.getInstantiationStrategy() );
+ }
+ }
+ }
+}
\ No newline at end of file
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorWriteException.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorWriteException.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorWriteException.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorWriteException.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,48 @@
+package org.codehaus.plexus.metadata;
+
+/*
+ * The MIT License
+ *
+ * Copyright (c) 2004, The Codehaus
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/**
+ * @author Trygve Laugstøl
+ * @version $Id$
+ */
+public class ComponentDescriptorWriteException
+ extends Exception
+{
+ public ComponentDescriptorWriteException( String message )
+ {
+ super( message );
+ }
+
+ public ComponentDescriptorWriteException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+
+ public ComponentDescriptorWriteException( Throwable cause )
+ {
+ super( cause );
+ }
+}
\ No newline at end of file
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorWriter.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorWriter.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorWriter.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/ComponentDescriptorWriter.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,39 @@
+/*
+ * The MIT License
+ *
+ * Copyright (c) 2007, The Codehaus
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package org.codehaus.plexus.metadata;
+
+import java.io.IOException;
+import java.io.Writer;
+
+import org.codehaus.plexus.component.repository.ComponentSetDescriptor;
+
+/**
+ * @author Kenney Westerhof
+ */
+public interface ComponentDescriptorWriter
+{
+ void writeDescriptorSet( Writer writer, ComponentSetDescriptor componentSetDescriptor, boolean containerDescriptor )
+ throws ComponentDescriptorWriteException, IOException;
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriter.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriter.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriter.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/DefaultComponentDescriptorWriter.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,303 @@
+/*
+ * The MIT License
+ *
+ * Copyright (c) 2007, The Codehaus
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package org.codehaus.plexus.metadata;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.List;
+
+import org.codehaus.plexus.component.repository.ComponentDependency;
+import org.codehaus.plexus.component.repository.ComponentDescriptor;
+import org.codehaus.plexus.component.repository.ComponentRequirement;
+import org.codehaus.plexus.component.repository.ComponentRequirementList;
+import org.codehaus.plexus.component.repository.ComponentSetDescriptor;
+import org.codehaus.plexus.configuration.PlexusConfiguration;
+import org.codehaus.plexus.configuration.PlexusConfigurationException;
+import org.codehaus.plexus.util.xml.PrettyPrintXMLWriter;
+import org.codehaus.plexus.util.xml.XMLWriter;
+
+/**
+ * Serializes a {@link ComponentSetDescriptor}.
+ *
+ * @author Kenney Westerhof
+ * @author Jason van Zyl
+ * @author Trygve Laugstøl
+ */
+public class DefaultComponentDescriptorWriter
+ implements ComponentDescriptorWriter
+{
+ private static final String LS = System.getProperty( "line.separator" );
+
+ public void writeDescriptorSet( Writer writer, ComponentSetDescriptor componentSetDescriptor, boolean containerDescriptor )
+ throws ComponentDescriptorWriteException, IOException
+ {
+ try
+ {
+ XMLWriter w = new PrettyPrintXMLWriter( writer );
+
+ w.startElement( containerDescriptor ? "plexus" : "component-set" );
+
+ writeComponents( w, componentSetDescriptor.getComponents() );
+
+ writeDependencies( w, componentSetDescriptor.getDependencies() );
+
+ w.endElement();
+
+ writer.write( LS );
+
+ // Flush, but don't close the writer... we are not its owner
+ writer.flush();
+ }
+ catch ( PlexusConfigurationException e )
+ {
+ throw new ComponentDescriptorWriteException( "Internal error while writing out the configuration", e );
+ }
+
+ }
+
+ private void writeComponents( XMLWriter w, List> componentDescriptors )
+ throws ComponentDescriptorWriteException, PlexusConfigurationException
+ {
+ if ( componentDescriptors == null )
+ {
+ return;
+ }
+
+ w.startElement( "components" );
+
+ for ( ComponentDescriptor> cd : componentDescriptors )
+ {
+ w.startElement( "component" );
+
+ element( w, "role", cd.getRole() );
+
+ element( w, "role-hint", cd.getRoleHint() );
+
+ element( w, "implementation", cd.getImplementation() );
+
+ element( w, "version", cd.getVersion() );
+
+ element( w, "component-type", cd.getComponentType() );
+
+ element( w, "instantiation-strategy", cd.getInstantiationStrategy() );
+
+ element( w, "lifecycle-handler", cd.getLifecycleHandler() );
+
+ element( w, "component-profile", cd.getComponentProfile() );
+
+ element( w, "component-composer", cd.getComponentComposer() );
+
+ element( w, "component-configurator", cd.getComponentConfigurator() );
+
+ element( w, "component-factory", cd.getComponentFactory() );
+
+ element( w, "description", cd.getDescription() );
+
+ element( w, "alias", cd.getAlias() );
+
+ element( w, "isolated-realm", Boolean.toString( cd.isIsolatedRealm() ) );
+
+ writeRequirements( w, cd.getRequirements() );
+
+ writeConfiguration( w, cd.getConfiguration() );
+
+ w.endElement();
+ }
+
+ w.endElement();
+ }
+
+ public void writeDependencies( XMLWriter w, List deps )
+ {
+ if ( deps == null || deps.size() == 0 )
+ {
+ return;
+ }
+
+ w.startElement( "dependencies" );
+
+ for ( ComponentDependency dep : deps )
+ {
+ writeDependencyElement( dep, w );
+ }
+
+ w.endElement();
+ }
+
+ private void writeDependencyElement( ComponentDependency dependency, XMLWriter w )
+ {
+ w.startElement( "dependency" );
+
+ String groupId = dependency.getGroupId();
+
+ element( w, "groupId", groupId );
+
+ String artifactId = dependency.getArtifactId();
+
+ element( w, "artifactId", artifactId );
+
+ String type = dependency.getType();
+
+ if ( type != null )
+ {
+ element( w, "type", type );
+ }
+
+ String version = dependency.getVersion();
+
+ element( w, "version", version );
+
+ w.endElement();
+ }
+
+ private void writeRequirements( XMLWriter w, List requirements )
+ {
+ if ( requirements == null || requirements.size() == 0 )
+ {
+ return;
+ }
+
+ w.startElement( "requirements" );
+
+ for ( ComponentRequirement cr : requirements )
+ {
+ w.startElement( "requirement" );
+
+ element( w, "role", cr.getRole() );
+
+ if ( cr instanceof ComponentRequirementList )
+ {
+ List hints = ( (ComponentRequirementList) cr ).getRoleHints();
+
+ if ( hints != null )
+ {
+ w.startElement( "role-hints" );
+
+ for ( String roleHint : hints )
+ {
+ w.startElement( "role-hint" );
+
+ w.writeText( roleHint );
+
+ w.endElement();
+ }
+
+ w.endElement();
+ }
+ }
+ else
+ {
+ // ensure there's no written, which causes ComponentLookupException
+ element( w, "role-hint", "".equals( cr.getRoleHint() ) ? null : cr.getRoleHint() );
+ }
+
+ element( w, "field-name", cr.getFieldName() );
+
+ element( w, "optional", cr.isOptional() ? Boolean.TRUE.toString() : null );
+
+ w.endElement();
+ }
+
+ w.endElement();
+ }
+
+ private void writeConfiguration( XMLWriter w, PlexusConfiguration configuration )
+ throws ComponentDescriptorWriteException, PlexusConfigurationException
+ {
+ if ( configuration == null || configuration.getChildCount() == 0 )
+ {
+ return;
+ }
+
+ if ( !configuration.getName().equals( "configuration" ) )
+ {
+ throw new ComponentDescriptorWriteException( "The root node of the configuration must be 'configuration'.");
+ }
+
+ writePlexusConfiguration( w, configuration );
+ }
+
+ private void writePlexusConfiguration( XMLWriter xmlWriter, PlexusConfiguration c )
+ throws PlexusConfigurationException
+ {
+ if ( c.getAttributeNames().length == 0 && c.getChildCount() == 0 && c.getValue() == null )
+ {
+ return;
+ }
+
+ xmlWriter.startElement( c.getName() );
+
+ // ----------------------------------------------------------------------
+ // Write the attributes
+ // ----------------------------------------------------------------------
+
+ String[] attributeNames = c.getAttributeNames();
+
+ for ( String attributeName : attributeNames )
+ {
+ xmlWriter.addAttribute( attributeName, c.getAttribute( attributeName ) );
+ }
+
+ // ----------------------------------------------------------------------
+ // Write the children
+ // ----------------------------------------------------------------------
+
+ PlexusConfiguration[] children = c.getChildren();
+
+ if ( children.length > 0 )
+ {
+ for ( PlexusConfiguration aChildren : children )
+ {
+ writePlexusConfiguration( xmlWriter, aChildren );
+ }
+ }
+ else
+ {
+ String value = c.getValue();
+
+ if ( value != null )
+ {
+ xmlWriter.writeText( value );
+ }
+ }
+
+ xmlWriter.endElement();
+ }
+
+ private void element( XMLWriter w, String name, String value )
+ {
+ if ( value == null )
+ {
+ return;
+ }
+
+ w.startElement( name );
+
+ w.writeText( value );
+
+ w.endElement();
+ }
+
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/DefaultMetadataGenerator.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/DefaultMetadataGenerator.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/DefaultMetadataGenerator.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/DefaultMetadataGenerator.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,178 @@
+package org.codehaus.plexus.metadata;
+
+/*
+ * The MIT License
+ *
+ * Copyright (c) 2004-2006, The Codehaus
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+ * associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
+ * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
+import org.codehaus.plexus.component.repository.ComponentDependency;
+import org.codehaus.plexus.component.repository.ComponentDescriptor;
+import org.codehaus.plexus.component.repository.ComponentSetDescriptor;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.metadata.gleaner.AnnotationComponentGleaner;
+import org.codehaus.plexus.metadata.merge.Merger;
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.IOUtil;
+
+/**
+ * @author Jason van Zyl
+ */
+@Component(role = MetadataGenerator.class)
+public class DefaultMetadataGenerator
+ extends AbstractLogEnabled
+ implements MetadataGenerator
+{
+ @Requirement
+ private Merger merger;
+
+ private ComponentDescriptor>[] roleDefaults;
+
+ @Requirement
+ private Map extractorMap;
+
+ // should be a component
+ private ComponentDescriptorWriter writer = new DefaultComponentDescriptorWriter();
+
+ public void generateDescriptor( MetadataGenerationRequest request )
+ throws Exception
+ {
+ assert request.outputFile != null;
+
+ List extractorHints = request.extractors;
+
+ final Collection extractors;
+ if ( extractorHints == null || extractorHints.size() == 0 )
+ {
+ extractors = extractorMap.values();
+ }
+ else
+ {
+ extractors = new ArrayList( extractorHints.size() );
+
+ for ( String hint : extractorHints )
+ {
+ extractors.add( extractorMap.get( hint ) );
+ }
+ }
+
+ List> descriptors = new ArrayList>();
+
+ for ( ComponentDescriptorExtractor extractor : extractors )
+ {
+ try
+ {
+ List> list = extractor.extract( request, roleDefaults );
+ if ( list != null && !list.isEmpty() )
+ {
+ descriptors.addAll( list );
+ }
+ }
+ catch ( Exception e )
+ {
+ throw new Exception( "Failed to extract descriptors", e );
+ }
+ }
+
+ List componentDescriptors = new ArrayList();
+
+ //
+ // If we found descriptors, write out the discovered descriptors
+ //
+ if ( descriptors.size() > 0 )
+ {
+ getLogger().info( "Discovered " + descriptors.size() + " component descriptors(s)" );
+
+ ComponentSetDescriptor set = new ComponentSetDescriptor();
+ set.setComponents( descriptors );
+ set.setDependencies( Collections. emptyList() );
+
+ if ( request.componentDescriptorDirectory == null )
+ {
+ writeDescriptor( set, request.outputFile );
+ }
+ else
+ {
+ if ( request.intermediaryFile == null )
+ {
+ request.intermediaryFile = File.createTempFile( "plexus-metadata", "xml" );
+ request.intermediaryFile.deleteOnExit();
+ }
+ writeDescriptor( set, request.intermediaryFile );
+ componentDescriptors.add( request.intermediaryFile );
+ }
+ }
+
+
+ //
+ // Deal with merging
+ //
+ if ( request.componentDescriptorDirectory != null && request.componentDescriptorDirectory.isDirectory() )
+ {
+ File[] files = request.componentDescriptorDirectory.listFiles();
+
+ for ( File file : files )
+ {
+ if ( file.getName().endsWith( ".xml" ) && !file.getName().equals( "plexus.xml" ) )
+ {
+ componentDescriptors.add( file );
+ }
+ }
+ }
+
+ if ( componentDescriptors.size() > 0 )
+ {
+ merger.mergeDescriptors( request.outputFile, componentDescriptors );
+ }
+ }
+
+ private void writeDescriptor( ComponentSetDescriptor desc, File outputFile )
+ throws Exception
+ {
+ assert desc != null;
+ assert outputFile != null;
+
+ FileUtils.forceMkdir( outputFile.getParentFile() );
+
+ BufferedWriter output = new BufferedWriter( new OutputStreamWriter( new FileOutputStream( outputFile ), "UTF-8" ) );
+
+ try
+ {
+ writer.writeDescriptorSet( output, desc, false );
+ output.flush();
+ }
+ finally
+ {
+ IOUtil.close( output );
+ }
+
+ getLogger().debug( "Wrote: " + outputFile );
+ }
+}
diff -Nru plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/gleaner/AnnotationComponentGleaner.java plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/gleaner/AnnotationComponentGleaner.java
--- plexus-containers-1.0~beta3.0.7/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/gleaner/AnnotationComponentGleaner.java 1970-01-01 00:00:00.000000000 +0000
+++ plexus-containers-1.7.1/plexus-component-metadata/src/main/java/org/codehaus/plexus/metadata/gleaner/AnnotationComponentGleaner.java 2016-08-31 19:01:49.000000000 +0000
@@ -0,0 +1,281 @@
+/*
+ * Copyright (C) 2007 the original author or authors.
+ *
+ * Licensed 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.
+ */
+
+package org.codehaus.plexus.metadata.gleaner;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Modifier;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.List;
+
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Configuration;
+import org.codehaus.plexus.component.annotations.Requirement;
+import org.codehaus.plexus.component.repository.ComponentDescriptor;
+import org.codehaus.plexus.component.repository.ComponentRequirement;
+import org.codehaus.plexus.component.repository.ComponentRequirementList;
+import org.codehaus.plexus.configuration.PlexusConfiguration;
+import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
+import org.codehaus.plexus.metadata.ann.AnnClass;
+import org.codehaus.plexus.metadata.ann.AnnField;
+import org.codehaus.plexus.metadata.ann.AnnReader;
+import org.codehaus.plexus.util.IOUtil;
+
+/**
+ * A class component gleaner which inspects each type for org.codehaus.plexus.component.annotations.* annotations
+ * and when found translates them into a {@link ComponentDescriptor}.
+ *
+ * @version $Id$
+ */
+public class AnnotationComponentGleaner
+ extends ComponentGleanerSupport
+ implements ClassComponentGleaner
+{
+ private static final String OBJECT_SLASHED_NAME = Object.class.getName().replace('.', '/');
+
+ public ComponentDescriptor> glean(String className, ClassLoader cl) throws ComponentGleanerException
+ {
+ assert className != null;
+ assert cl != null;
+
+ AnnClass annClass = readClass(className.replace('.', '/'), cl);
+
+ // Skip abstract classes
+ if (Modifier.isAbstract(annClass.getAccess())) {
+ return null;
+ }
+
+
+ Component anno = annClass.getAnnotation(Component.class);
+
+ if (anno == null) {
+ return null;
+ }
+
+ ComponentDescriptor> component = new ComponentDescriptor