You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2010/08/30 19:50:43 UTC

svn commit: r990880 - in /tuscany/maven-plugins/trunk: ./ maven-dependency-plugin/ maven-dependency-plugin/.externalToolBuilders/ maven-dependency-plugin/.settings/ maven-dependency-plugin/src/ maven-dependency-plugin/src/main/ maven-dependency-plugin/...

Author: rfeng
Date: Mon Aug 30 17:50:42 2010
New Revision: 990880

URL: http://svn.apache.org/viewvc?rev=990880&view=rev
Log:
Add a maven plugin that checks the class conflicts for the dependencies or all jars from a directory

Added:
    tuscany/maven-plugins/trunk/maven-dependency-plugin/
    tuscany/maven-plugins/trunk/maven-dependency-plugin/.classpath
    tuscany/maven-plugins/trunk/maven-dependency-plugin/.externalToolBuilders/
    tuscany/maven-plugins/trunk/maven-dependency-plugin/.externalToolBuilders/Maven_Ant_Builder.launch
    tuscany/maven-plugins/trunk/maven-dependency-plugin/.project
    tuscany/maven-plugins/trunk/maven-dependency-plugin/.settings/
    tuscany/maven-plugins/trunk/maven-dependency-plugin/.settings/org.eclipse.jdt.core.prefs
    tuscany/maven-plugins/trunk/maven-dependency-plugin/LICENSE
    tuscany/maven-plugins/trunk/maven-dependency-plugin/NOTICE
    tuscany/maven-plugins/trunk/maven-dependency-plugin/README
    tuscany/maven-plugins/trunk/maven-dependency-plugin/RELEASE_NOTES
    tuscany/maven-plugins/trunk/maven-dependency-plugin/pom.xml   (with props)
    tuscany/maven-plugins/trunk/maven-dependency-plugin/src/
    tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/
    tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/
    tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/
    tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/
    tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/
    tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/
    tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/
    tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/
    tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ClassConflictsDetectorMojo.java   (with props)
    tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ClassPathHellDetector.java   (with props)
    tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ConsoleLogWrapper.java   (with props)
    tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/JDKLogWrapper.java   (with props)
    tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/LogWrapper.java   (with props)
Modified:
    tuscany/maven-plugins/trunk/pom.xml

Added: tuscany/maven-plugins/trunk/maven-dependency-plugin/.classpath
URL: http://svn.apache.org/viewvc/tuscany/maven-plugins/trunk/maven-dependency-plugin/.classpath?rev=990880&view=auto
==============================================================================
--- tuscany/maven-plugins/trunk/maven-dependency-plugin/.classpath (added)
+++ tuscany/maven-plugins/trunk/maven-dependency-plugin/.classpath Mon Aug 30 17:50:42 2010
@@ -0,0 +1,20 @@
+<classpath>
+  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+  <classpathentry kind="src" path="." including="LICENSE|NOTICE" excluding="**/*.java"/>
+  <classpathentry kind="src" path="target/maven-shared-archive-resources" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="var" path="M2_REPO/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-artifact/2.0.8/maven-artifact-2.0.8.jar" sourcepath="M2_REPO/org/apache/maven/maven-artifact/2.0.8/maven-artifact-2.0.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-artifact-manager/2.0.8/maven-artifact-manager-2.0.8.jar" sourcepath="M2_REPO/org/apache/maven/maven-artifact-manager/2.0.8/maven-artifact-manager-2.0.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-model/2.0.8/maven-model-2.0.8.jar" sourcepath="M2_REPO/org/apache/maven/maven-model/2.0.8/maven-model-2.0.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-api/2.0.8/maven-plugin-api-2.0.8.jar" sourcepath="M2_REPO/org/apache/maven/maven-plugin-api/2.0.8/maven-plugin-api-2.0.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-registry/2.0.8/maven-plugin-registry-2.0.8.jar" sourcepath="M2_REPO/org/apache/maven/maven-plugin-registry/2.0.8/maven-plugin-registry-2.0.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-profile/2.0.8/maven-profile-2.0.8.jar" sourcepath="M2_REPO/org/apache/maven/maven-profile/2.0.8/maven-profile-2.0.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-project/2.0.8/maven-project-2.0.8.jar" sourcepath="M2_REPO/org/apache/maven/maven-project/2.0.8/maven-project-2.0.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-repository-metadata/2.0.8/maven-repository-metadata-2.0.8.jar" sourcepath="M2_REPO/org/apache/maven/maven-repository-metadata/2.0.8/maven-repository-metadata-2.0.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-settings/2.0.8/maven-settings-2.0.8.jar" sourcepath="M2_REPO/org/apache/maven/maven-settings/2.0.8/maven-settings-2.0.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-utils/1.4.6/plexus-utils-1.4.6.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2-sources.jar"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
\ No newline at end of file

Added: tuscany/maven-plugins/trunk/maven-dependency-plugin/.externalToolBuilders/Maven_Ant_Builder.launch
URL: http://svn.apache.org/viewvc/tuscany/maven-plugins/trunk/maven-dependency-plugin/.externalToolBuilders/Maven_Ant_Builder.launch?rev=990880&view=auto
==============================================================================
--- tuscany/maven-plugins/trunk/maven-dependency-plugin/.externalToolBuilders/Maven_Ant_Builder.launch (added)
+++ tuscany/maven-plugins/trunk/maven-dependency-plugin/.externalToolBuilders/Maven_Ant_Builder.launch Mon Aug 30 17:50:42 2010
@@ -0,0 +1,24 @@
+<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
+  <booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
+  <stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,clean"/>
+  <booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+  <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+  <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="maven-dependency-plugin"/>
+  <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
+  <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${build_project}/maven-eclipse.xml"/>
+  <stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${build_project}"/>
+  <stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
+  <booleanAttribute key="org.eclipse.debug.core.capture_output" value="false"/>
+  <stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:&lt;?xml version=&apos;1.0&apos;?&gt;&lt;launchConfigurationWorkingSet editPageId=&apos;org.eclipse.ui.resourceWorkingSetPage&apos; factoryID=&apos;org.eclipse.ui.internal.WorkingSetFactory&apos; label=&apos;workingSet&apos; name=&apos;workingSet&apos;&gt;&lt;item factoryID=&apos;org.eclipse.ui.internal.model.ResourceFactory&apos; path=&apos;maven-dependency-plugin&apos; type=&apos;4&apos;/&gt;&lt;/launchConfigurationWorkingSet&gt;}"/>
+  <stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+  <booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
+  <booleanAttribute key="org.eclipse.debug.ui.ATTR_CONSOLE_OUTPUT_ON" value="false"/>
+  <booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
+  <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+  <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+    <listEntry value="1"/>
+  </listAttribute>
+  <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+    <listEntry value="/maven-dependency-plugin/maven-eclipse.xml"/>
+  </listAttribute>
+</launchConfiguration>
\ No newline at end of file

Added: tuscany/maven-plugins/trunk/maven-dependency-plugin/.project
URL: http://svn.apache.org/viewvc/tuscany/maven-plugins/trunk/maven-dependency-plugin/.project?rev=990880&view=auto
==============================================================================
--- tuscany/maven-plugins/trunk/maven-dependency-plugin/.project (added)
+++ tuscany/maven-plugins/trunk/maven-dependency-plugin/.project Mon Aug 30 17:50:42 2010
@@ -0,0 +1,26 @@
+<projectDescription>
+  <name>maven-dependency-plugin</name>
+  <comment>The Apache Software Foundation provides support for the Apache community of open-source software projects.
+    The Apache projects are characterized by a collaborative, consensus based development process, an open and
+    pragmatic software license, and a desire to create high quality software that leads the way in its field.
+    We consider ourselves not simply a group of projects sharing a server, but rather a community of developers
+    and users. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+    <buildCommand>
+      <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+      <arguments>
+        <dictionary>
+          <key>LaunchConfigHandle</key>
+          <value>&lt;project&gt;/.externalToolBuilders/Maven_Ant_Builder.launch</value>
+        </dictionary>
+      </arguments>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Added: tuscany/maven-plugins/trunk/maven-dependency-plugin/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/tuscany/maven-plugins/trunk/maven-dependency-plugin/.settings/org.eclipse.jdt.core.prefs?rev=990880&view=auto
==============================================================================
--- tuscany/maven-plugins/trunk/maven-dependency-plugin/.settings/org.eclipse.jdt.core.prefs (added)
+++ tuscany/maven-plugins/trunk/maven-dependency-plugin/.settings/org.eclipse.jdt.core.prefs Mon Aug 30 17:50:42 2010
@@ -0,0 +1,10 @@
+#Fri Aug 27 13:08:12 PDT 2010
+encoding//src/main/java=UTF-8
+org.eclipse.jdt.core.compiler.compliance=1.5
+encoding//src/main/resources=UTF-8
+encoding//src/test/resources=UTF-8
+encoding//src/test/java=UTF-8
+encoding/=UTF-8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5

Added: tuscany/maven-plugins/trunk/maven-dependency-plugin/LICENSE
URL: http://svn.apache.org/viewvc/tuscany/maven-plugins/trunk/maven-dependency-plugin/LICENSE?rev=990880&view=auto
==============================================================================
--- tuscany/maven-plugins/trunk/maven-dependency-plugin/LICENSE (added)
+++ tuscany/maven-plugins/trunk/maven-dependency-plugin/LICENSE Mon Aug 30 17:50:42 2010
@@ -0,0 +1,205 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+
+
+

Added: tuscany/maven-plugins/trunk/maven-dependency-plugin/NOTICE
URL: http://svn.apache.org/viewvc/tuscany/maven-plugins/trunk/maven-dependency-plugin/NOTICE?rev=990880&view=auto
==============================================================================
--- tuscany/maven-plugins/trunk/maven-dependency-plugin/NOTICE (added)
+++ tuscany/maven-plugins/trunk/maven-dependency-plugin/NOTICE Mon Aug 30 17:50:42 2010
@@ -0,0 +1,6 @@
+Apache Tuscany Maven Bundle Plugin
+Copyright (c) 2005 - 2009 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+

Added: tuscany/maven-plugins/trunk/maven-dependency-plugin/README
URL: http://svn.apache.org/viewvc/tuscany/maven-plugins/trunk/maven-dependency-plugin/README?rev=990880&view=auto
==============================================================================
--- tuscany/maven-plugins/trunk/maven-dependency-plugin/README (added)
+++ tuscany/maven-plugins/trunk/maven-dependency-plugin/README Mon Aug 30 17:50:42 2010
@@ -0,0 +1,34 @@
+The Tuscany maven-dependency-plugin checks and reports duplicate classes among the list of jars within the maven dependency graph or under a directory on the file system. 
+
+The maven conflict resolution only handles different versions of the same artifact (same groupId and same artifactId). In reality, there are artifacts with different groupId and/or artifactId containing duplicate classes which can be the same or different. These classes can lead to the classpath hell issue where conflicting classes are on the same classpath.
+
+There is a similar effort in the official maven dependency plugin project to add such function into the analyze goal.
+ 
+http://jira.codehaus.org/browse/MDEP-275
+
+The Tuscany version has a few advantages over the prototype above:
+* It groups duplicate classes under the list of artifacts
+* It goes one step further to check the size and CRC of the class file and marks the different cases in the report (potentially we can use BCEL to further compare the two classes):
+  * X: the duplicate classes have different size (most likely different versions)
+  * ?: the duplicate classes have the same size but different CRC (probably the same version but were built separately)
+  *  : the duplicate classes have the same size and CRC (most likely the same version).
+
+To use the plugin, you can add the following section to the pom.xml:
+
+            <plugin>
+                <groupId>org.apache.tuscany.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <version>1.0.0-SNAPSHOT</version>
+                <configuration>
+                    <verbose>true</verbose>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>check-class-conflicts</id>
+                        <phase>validate</phase>
+                        <goals>
+                            <goal>check-class-conflicts</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>

Added: tuscany/maven-plugins/trunk/maven-dependency-plugin/RELEASE_NOTES
URL: http://svn.apache.org/viewvc/tuscany/maven-plugins/trunk/maven-dependency-plugin/RELEASE_NOTES?rev=990880&view=auto
==============================================================================
    (empty)

Added: tuscany/maven-plugins/trunk/maven-dependency-plugin/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/maven-plugins/trunk/maven-dependency-plugin/pom.xml?rev=990880&view=auto
==============================================================================
--- tuscany/maven-plugins/trunk/maven-dependency-plugin/pom.xml (added)
+++ tuscany/maven-plugins/trunk/maven-dependency-plugin/pom.xml Mon Aug 30 17:50:42 2010
@@ -0,0 +1,283 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache</groupId>
+        <artifactId>apache</artifactId>
+        <version>7</version>
+    </parent>
+
+    <groupId>org.apache.tuscany.maven.plugins</groupId>
+    <artifactId>maven-dependency-plugin</artifactId>
+    <packaging>maven-plugin</packaging>
+    <name>Apache Tuscany Maven Dependency Plugin</name>
+    <version>1.0.0-SNAPSHOT</version>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/tuscany/maven-plugins/trunk/maven-bundle-plugin</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/tuscany/maven-plugins/trunk/maven-bundle-plugin</developerConnection>
+        <url>http://svn.apache.org/repos/asf/tuscany/</url>
+    </scm>
+
+    <distributionManagement>
+       <repository>
+          <id>apache.releases.https</id>
+          <name>Apache Release Distribution Repository</name>
+          <url>https://repository.apache.org/service/local/staging/deploy/maven2</url>
+       </repository>
+       <snapshotRepository>
+          <id>apache.snapshots.https</id>
+          <name>Apache Development Snapshot Repository</name>
+          <url>https://repository.apache.org/content/repositories/snapshots</url>
+       </snapshotRepository>
+    </distributionManagement>
+
+    <repositories>
+       <!-- Apache SNAPSHOT repository for unreleased artifacts -->
+       <repository>
+            <id>apache.snapshots</id>
+            <name>Apache SNAPSHOT Repository</name>
+            <url>http://repository.apache.org/snapshots</url>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </repository>
+
+        <!-- Tuscany repository to hold artifacts that are not published in the public maven repos -->
+        <repository>
+            <id>tuscany.repo</id>
+            <name>Tuscany Maven 2.x Repository</name>
+            <url>http://svn.apache.org/repos/asf/tuscany/maven</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </repository>
+    </repositories>
+
+    <pluginRepositories>
+        <!-- Apache repository for artifacts released by Apache TLP projects -->
+        <pluginRepository>
+            <id>apache</id>
+            <name>Apache Repository</name>
+            <url>http://people.apache.org/repo/m2-ibiblio-rsync-repository</url>
+            <releases>
+                <enabled>true</enabled>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </pluginRepository>
+
+        <!-- Apache SNAPSHOT repository for unreleased artifacts -->
+        <pluginRepository>
+            <id>apache.snapshots</id>
+            <name>Apache SNAPSHOT Repository</name>
+            <url>http://repository.apache.org/snapshots</url>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+
+        </pluginRepository>
+
+    </pluginRepositories>
+
+    <profiles>
+        <profile>
+            <id>release</id>
+            <build>
+                <plugins>
+
+                    <plugin>
+                        <inherited>true</inherited>
+                        <artifactId>maven-deploy-plugin</artifactId>
+                        <version>2.4</version>
+                        <configuration>
+                            <altDeploymentRepository>${deploy.altRepository}</altDeploymentRepository>
+                            <updateReleaseInfo>true</updateReleaseInfo>
+                        </configuration>
+                    </plugin>
+
+                    <plugin>
+                        <artifactId>maven-gpg-plugin</artifactId>
+                        <version>1.0-alpha-4</version>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>sign</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <id>deploy</id>
+            <build>
+                <defaultGoal>deploy</defaultGoal>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-source-plugin</artifactId>
+                        <version>2.0.4</version>
+                        <executions>
+                            <execution>
+                                <id>attach-sources</id>
+                                <goals>
+                                    <goal>jar</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-plugin-api</artifactId>
+            <version>2.0.8</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-project</artifactId>
+            <version>2.0.8</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>junit</groupId>
+                    <artifactId>junit</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-artifact</artifactId>
+            <version>2.0.8</version>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <defaultGoal>install</defaultGoal>
+
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+            </resource>
+            <resource>
+                <directory>.</directory>
+                <targetPath>META-INF</targetPath>
+                <filtering>true</filtering>
+                <includes>
+                    <include>LICENSE</include>
+                    <include>NOTICE</include>
+                </includes>
+            </resource>
+        </resources>
+
+        <pluginManagement>
+
+            <plugins>
+                <!-- compiler plugin configuration -->
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <version>2.0.2</version>
+                    <configuration>
+                        <source>1.5</source>
+                        <target>1.5</target>
+                    </configuration>
+                </plugin>
+
+                <!-- jar plugin configuration -->
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-jar-plugin</artifactId>
+                    <version>2.1</version>
+                    <configuration>
+                        <archive>
+                            <manifestEntries>
+                                <Extension-Name>${project.artifactId}</Extension-Name>
+                                <Specification-Title>${name}</Specification-Title>
+                                <Specification-Vendor>The Apache Software Foundation</Specification-Vendor>
+                                <Specification-Version>${version}</Specification-Version>
+                                <Implementation-Title>${name}</Implementation-Title>
+                                <Implementation-Vendor-Id>org.apache</Implementation-Vendor-Id>
+                                <Implementation-Vendor>The Apache Software Foundation</Implementation-Vendor>
+                                <Implementation-Version>${version}</Implementation-Version>
+                                <Main-Class>org.apache.tuscany.maven.dependency.plugin.ClassPathHellDetector</Main-Class>
+                            </manifestEntries>
+                         </archive>
+                    </configuration>
+                </plugin>
+
+                <!-- surefire plugin configuration -->
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-surefire-plugin</artifactId>
+                    <version>2.4.3</version>
+                    <configuration>
+                        <includes>
+                            <include>**/*TestCase.java</include>
+                        </includes>
+                        <reportFormat>brief</reportFormat>
+                        <useFile>false</useFile>
+                        <forkMode>once</forkMode>
+                        <argLine>-ea -Xmx256m</argLine>
+                    </configuration>
+                </plugin>
+
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-release-plugin</artifactId>
+                    <version>2.0-beta-8</version>
+                    <configuration>
+                        <tagBase>https://svn.apache.org/repos/asf/tuscany/maven-plugins/tags</tagBase>
+                        <useReleaseProfile>false</useReleaseProfile>
+                        <preparationGoals>clean install</preparationGoals>
+                        <goals>deploy</goals>
+                        <arguments>-Prelease,deploy</arguments>
+                        <autoVersionSubmodules>true</autoVersionSubmodules>
+                    </configuration>
+                </plugin>
+
+            </plugins>
+
+        </pluginManagement>
+
+    </build>
+
+</project>

Propchange: tuscany/maven-plugins/trunk/maven-dependency-plugin/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ClassConflictsDetectorMojo.java
URL: http://svn.apache.org/viewvc/tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ClassConflictsDetectorMojo.java?rev=990880&view=auto
==============================================================================
--- tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ClassConflictsDetectorMojo.java (added)
+++ tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ClassConflictsDetectorMojo.java Mon Aug 30 17:50:42 2010
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package org.apache.tuscany.maven.dependency.plugin;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.MavenProject;
+
+/**
+ * A Maven plugin that check for class conflicts for the dependency jars
+ * 
+ * @goal check-class-conflicts
+ * @phase validate
+ * @requiresDependencyResolution test
+ * @description check for class conflicts for the dependency jars
+ */
+public class ClassConflictsDetectorMojo extends AbstractMojo {
+
+    /**
+     * The project to build the bundle for.
+     *
+     * @parameter expression="${project}"
+     * @required
+     * @readonly
+     */
+    private MavenProject project;
+
+    /**
+     * The root directory to scan the jar files. If not set, we'll check the project dependencies
+     *
+     * @parameter 
+     */
+    private File root;
+
+    /**
+     * @parameter default-value="false"
+     */
+    private boolean ignoreTestScope;
+
+    /**
+     * @parameter default-value="true"
+     */
+    private boolean verbose;
+
+    /**
+     * @parameter default-value="false"
+     */
+    private boolean skip;
+
+    /**
+     * @parameter default-value="false"
+     */
+    private boolean failOnConflicts;
+
+    public void execute() throws MojoExecutionException {
+        if (skip) {
+            return;
+        }
+
+        Log log = getLog();
+        LogWrapper wrapper = new MavenLogWrapper(log);
+
+        try {
+            int conflicts = 0;
+            if (root != null) {
+                conflicts = ClassPathHellDetector.check(root, wrapper, verbose || wrapper.isDebugEnabled());
+            } else {
+                conflicts = ClassPathHellDetector.check(getJarFiles(log), wrapper, verbose || wrapper.isDebugEnabled());
+            }
+            if (conflicts >= 1 && failOnConflicts) {
+                throw new MojoExecutionException("Conflicting/overlapping classes are found");
+            }
+        } catch (IOException e) {
+            throw new MojoExecutionException(e.getMessage(), e);
+        }
+
+    }
+
+    private Set<File> getJarFiles(Log log) {
+        Set<File> files = new HashSet<File>();
+        for (Object a : project.getArtifacts()) {
+            Artifact artifact = (Artifact)a;
+            if (ignoreTestScope && Artifact.SCOPE_TEST.equals(artifact.getScope())) {
+                continue;
+            }
+            if (artifact.isResolved()) {
+                if ("jar".equals(artifact.getType())) {
+                    files.add(artifact.getFile());
+                }
+            }
+        }
+        return files;
+    }
+
+    private static class MavenLogWrapper implements LogWrapper {
+        private Log log;
+
+        public MavenLogWrapper(Log log) {
+            super();
+            this.log = log;
+        }
+
+        public boolean isDebugEnabled() {
+            return log.isDebugEnabled();
+        }
+
+        public void debug(String msg) {
+            log.debug(msg);
+
+        }
+
+        public void info(String msg) {
+            log.info(msg);
+        }
+
+        public void warn(String msg) {
+            log.warn(msg);
+        }
+
+        public void error(String msg) {
+            log.error(msg);
+        }
+
+        public boolean isInfoEnabled() {
+            return log.isInfoEnabled();
+        }
+
+        public boolean isWarnEnabled() {
+            return log.isWarnEnabled();
+        }
+
+        public boolean isErrorEnabled() {
+            return log.isErrorEnabled();
+        }
+
+    }
+
+}

Propchange: tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ClassConflictsDetectorMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ClassConflictsDetectorMojo.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ClassPathHellDetector.java
URL: http://svn.apache.org/viewvc/tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ClassPathHellDetector.java?rev=990880&view=auto
==============================================================================
--- tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ClassPathHellDetector.java (added)
+++ tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ClassPathHellDetector.java Mon Aug 30 17:50:42 2010
@@ -0,0 +1,270 @@
+package org.apache.tuscany.maven.dependency.plugin;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+/**
+ * Scanning the folder to find jar files and detect class conflicts
+ */
+public class ClassPathHellDetector {
+
+    /**
+     * arg[0]: The root directory
+     * @param args
+     */
+    public static void main(String[] args) throws Exception {
+        boolean verbose = Boolean.parseBoolean(System.getProperty("verbose", "true"));
+        File root = new File(".");
+        if (args.length >= 1) {
+            root = new File(args[0]);
+        }
+        LogWrapper log = new ConsoleLogWrapper();
+        check(root, log, verbose);
+    }
+
+    /**
+     * Recursively check the jar files under the given root directory
+     * @param root The root directory
+     * @param log The log
+     * @param verbose Indicate if the list of classes will be reported
+     * @return The number of conflicts at jar level
+     * @throws IOException
+     */
+    public static int check(File root, LogWrapper log, boolean verbose) throws IOException {
+        Set<File> jarFiles = findJarFiles(root);
+        return check(jarFiles, log, verbose);
+    }
+
+    /**
+     * Check the given list of jars to find out conflicting classes
+     * @param jarFiles The list of jar files
+     * @param log The log
+     * @param verbose Indicate if the list of classes will be reported
+     * @return The number of conflicts at jar level
+     * @throws IOException
+     */
+    public static int check(Set<File> jarFiles, LogWrapper log, boolean verbose) throws IOException {
+        Map<String, Collection<ClassFile>> classToFileMapping = new HashMap<String, Collection<ClassFile>>();
+        for (File f : jarFiles) {
+            if (log.isDebugEnabled()) {
+                log.debug("Scanning " + f);
+            }
+            for (ClassFile classFile : listClasses(f)) {
+                Collection<ClassFile> files = classToFileMapping.get(classFile.name);
+                if (files == null) {
+                    files = new ArrayList<ClassFile>();
+                    classToFileMapping.put(classFile.name, files);
+                }
+                files.add(classFile);
+            }
+        }
+
+        Map<String, Set<String>> conflicts = new HashMap<String, Set<String>>();
+        for (Map.Entry<String, Collection<ClassFile>> entry : classToFileMapping.entrySet()) {
+            Collection<ClassFile> files = entry.getValue();
+            if (files.size() > 1) {
+                Set<File> jars = new HashSet<File>();
+                for (ClassFile cf : files) {
+                    jars.add(cf.jarFile);
+                }
+                List<File> sorted = new ArrayList<File>(jars);
+                Collections.sort(sorted);
+                String conflict = sorted.toString();
+                Set<String> classes = conflicts.get(conflict);
+                if (classes == null) {
+                    classes = new HashSet<String>();
+                    conflicts.put(conflict, classes);
+                }
+                classes.add(entry.getKey());
+            }
+        }
+
+        int size = conflicts.size();
+        if (size >= 1) {
+            log.warn("Number of conflicts: " + conflicts.size());
+        } else {
+            log.info("No class conflicts are found.");
+        }
+
+        for (Map.Entry<String, Set<String>> c : conflicts.entrySet()) {
+            log.warn("");
+            log.warn("Conflicting jars: " + c.getKey());
+
+            if (verbose) {
+                log.warn("Conflicting or overlapping classes [X: size, ?: crc]: ");
+                List<String> list = new ArrayList<String>(c.getValue());
+                Collections.sort(list);
+                for (String cls : list) {
+                    Collection<ClassFile> classFiles = classToFileMapping.get(cls);
+                    String flag = compare(classFiles);
+                    if (!" ".equals(flag)) {
+                        // Class files with different size or crc
+                        log.warn("  " + flag + " " + cls);
+                    } else {
+                        // Class files with same size and crc
+                        log.warn("  " + flag + " " + cls);
+                    }
+                }
+            }
+        }
+
+        return conflicts.size();
+    }
+
+    private static String compare(Collection<ClassFile> files) {
+        long size = 0;
+        long crc = 0;
+        String name = null;
+        for (ClassFile f : files) {
+            if (name != null && !f.name.equals(name)) {
+                // Different name
+                return "X";
+            }
+            if (size != 0 && f.size != size) {
+                // Different size
+                return "X";
+            }
+            if (crc != 0 && f.crc != crc) {
+                // Different crc
+                return "?";
+            }
+            size = f.size;
+            crc = f.crc;
+            name = f.name;
+        }
+        return " ";
+    }
+
+    /**
+     * List all class files within a jar
+     * @param file
+     * @return
+     * @throws IOException
+     */
+    private static Collection<ClassFile> listClasses(File file) throws IOException {
+        Collection<ClassFile> classFiles = new ArrayList<ClassPathHellDetector.ClassFile>();
+        JarFile jarFile = new JarFile(file);
+        Enumeration<JarEntry> entries = jarFile.entries();
+        while (entries.hasMoreElements()) {
+            JarEntry entry = entries.nextElement();
+            String name = entry.getName();
+            if (name.endsWith(".class")) {
+                ClassFile cls = new ClassFile(file, entry.getName(), entry.getSize(), entry.getCrc());
+                classFiles.add(cls);
+            }
+        }
+        jarFile.close();
+        return classFiles;
+
+    }
+
+    private static Set<File> findJarFiles(File root) throws IOException {
+        Set<File> jarFiles = new HashSet<File>();
+        traverse(jarFiles, root, new HashSet<File>());
+        return jarFiles;
+    }
+
+    /**
+     * Recursively traverse a root directory
+     *
+     * @param fileList
+     * @param file
+     * @param root
+     * @param visited The visited directories
+     * @throws IOException
+     */
+    private static void traverse(Set<File> fileList, File file, Set<File> visited) throws IOException {
+        if (file.isFile()) {
+            fileList.add(file);
+        } else if (file.isDirectory()) {
+            File dir = file.getCanonicalFile();
+            if (!visited.contains(dir)) {
+                // [rfeng] Add the canonical file into the visited set to avoid duplicate navigation of directories
+                // following the symbolic links
+                visited.add(dir);
+
+                File[] files = file.listFiles(new FileFilter() {
+
+                    public boolean accept(File f) {
+                        return f.isDirectory() || f.getName().endsWith(".jar");
+                    }
+                });
+                for (File f : files) {
+                    if (!f.getName().startsWith(".")) {
+                        traverse(fileList, f, visited);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Description of a class file within the jar
+     */
+    private static class ClassFile {
+        private File jarFile;
+        private String name;
+        private long size;
+        private long crc;
+
+        public ClassFile(File jarFile, String name, long size, long crc) {
+            super();
+            this.jarFile = jarFile;
+            this.name = name;
+            this.size = size;
+            this.crc = crc;
+        }
+
+        @Override
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + (int)(crc ^ (crc >>> 32));
+            result = prime * result + ((name == null) ? 0 : name.hashCode());
+            result = prime * result + (int)(size ^ (size >>> 32));
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj)
+                return true;
+            if (obj == null)
+                return false;
+            if (getClass() != obj.getClass())
+                return false;
+            ClassFile other = (ClassFile)obj;
+            if (crc != other.crc)
+                return false;
+            if (name == null) {
+                if (other.name != null)
+                    return false;
+            } else if (!name.equals(other.name))
+                return false;
+            if (size != other.size)
+                return false;
+            return true;
+        }
+
+        @Override
+        public String toString() {
+            StringBuilder builder = new StringBuilder();
+            builder.append("ClassFile [jarFile=").append(jarFile).append(", name=").append(name).append(", size=")
+                .append(size).append(", crc=").append(crc).append("]");
+            return builder.toString();
+        }
+    }
+
+}

Propchange: tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ClassPathHellDetector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ClassPathHellDetector.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ConsoleLogWrapper.java
URL: http://svn.apache.org/viewvc/tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ConsoleLogWrapper.java?rev=990880&view=auto
==============================================================================
--- tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ConsoleLogWrapper.java (added)
+++ tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ConsoleLogWrapper.java Mon Aug 30 17:50:42 2010
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.maven.dependency.plugin;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+public class ConsoleLogWrapper implements LogWrapper {
+    private final static Logger log = Logger.getLogger(ConsoleLogWrapper.class.getName());
+
+    public ConsoleLogWrapper() {
+        super();
+    }
+
+    public boolean isDebugEnabled() {
+        return log.isLoggable(Level.FINE);
+    }
+
+    public boolean isInfoEnabled() {
+        return log.isLoggable(Level.INFO);
+    }
+
+    public boolean isWarnEnabled() {
+        return log.isLoggable(Level.WARNING);
+    }
+
+    public boolean isErrorEnabled() {
+        return log.isLoggable(Level.SEVERE);
+    }
+
+    public void debug(String msg) {
+        if (isDebugEnabled()) {
+            System.out.println(msg);
+        }
+    }
+
+    public void info(String msg) {
+        if (isInfoEnabled()) {
+            System.out.println(msg);
+        }
+    }
+
+    public void warn(String msg) {
+        if (isWarnEnabled()) {
+            System.err.println(msg);
+        }
+    }
+
+    public void error(String msg) {
+        if (isErrorEnabled()) {
+            System.err.println(msg);
+        }
+    }
+
+}

Propchange: tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ConsoleLogWrapper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/ConsoleLogWrapper.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/JDKLogWrapper.java
URL: http://svn.apache.org/viewvc/tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/JDKLogWrapper.java?rev=990880&view=auto
==============================================================================
--- tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/JDKLogWrapper.java (added)
+++ tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/JDKLogWrapper.java Mon Aug 30 17:50:42 2010
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.maven.dependency.plugin;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+public class JDKLogWrapper implements LogWrapper {
+    private Logger log;
+
+    public JDKLogWrapper(Logger log) {
+        super();
+        this.log = log;
+    }
+
+    public boolean isDebugEnabled() {
+        return log.isLoggable(Level.FINE);
+    }
+
+    public boolean isInfoEnabled() {
+        return log.isLoggable(Level.INFO);
+    }
+
+    public boolean isWarnEnabled() {
+        return log.isLoggable(Level.WARNING);
+    }
+
+    public boolean isErrorEnabled() {
+        return log.isLoggable(Level.SEVERE);
+    }
+
+    public void debug(String msg) {
+        log.fine(msg);
+    }
+
+    public void info(String msg) {
+        log.info(msg);
+    }
+
+    public void warn(String msg) {
+        log.warning(msg);
+    }
+
+    public void error(String msg) {
+        log.severe(msg);
+    }
+
+}
\ No newline at end of file

Propchange: tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/JDKLogWrapper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/JDKLogWrapper.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/LogWrapper.java
URL: http://svn.apache.org/viewvc/tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/LogWrapper.java?rev=990880&view=auto
==============================================================================
--- tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/LogWrapper.java (added)
+++ tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/LogWrapper.java Mon Aug 30 17:50:42 2010
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.maven.dependency.plugin;
+
+public interface LogWrapper {
+    boolean isDebugEnabled();
+
+    boolean isInfoEnabled();
+
+    boolean isWarnEnabled();
+
+    boolean isErrorEnabled();
+
+    void debug(String msg);
+
+    void info(String msg);
+
+    void warn(String msg);
+
+    void error(String msg);
+}
\ No newline at end of file

Propchange: tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/LogWrapper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/maven-plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/tuscany/maven/dependency/plugin/LogWrapper.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/maven-plugins/trunk/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/maven-plugins/trunk/pom.xml?rev=990880&r1=990879&r2=990880&view=diff
==============================================================================
--- tuscany/maven-plugins/trunk/pom.xml (original)
+++ tuscany/maven-plugins/trunk/pom.xml Mon Aug 30 17:50:42 2010
@@ -98,6 +98,7 @@
 
     <modules>
         <module>maven-bundle-plugin</module>
+        <module>maven-dependency-plugin</module>
         <module>maven-eclipse-compiler</module>
         <!--module>maven-java2wsdl-plugin</module-->
         <module>maven-osgi-junit</module>