geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r411421 [1/2] - in /geronimo/sandbox/gshell/trunk: gshell-assemblies/ gshell-assemblies/gshell-squeezed-assembly/ gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/ gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plug...
Date Sat, 03 Jun 2006 11:04:56 GMT
Author: jdillon
Date: Sat Jun  3 04:04:54 2006
New Revision: 411421

URL: http://svn.apache.org/viewvc?rev=411421&view=rev
Log:
Adding experimental squeezed assembly using hacked minijar plugin (included)
Still needs some more work, may need to squeeze jars explicitly...
    but should be able to get the core under 1mb, maybe smaller

NOTE: Minijar will be removed from here once it works as expected, then patch will be submitted to mojo project


Added:
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/LICENSE.txt   (with props)
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/pom.xml   (with props)
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/changes/
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/changes/changes.xml   (with props)
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Clazz.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Clazzpath.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/ClazzpathUnit.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Console.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Include.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Matcher.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/MiniJarMojo.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/MiniJarProcessor.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/DelegatingAdapter.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/DependencyVisitor.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/RenamingAdapter.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/site/
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/site/apt/
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/site/apt/howto.apt
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/site/apt/introduction.apt
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/site/site.xml   (with props)
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/mojo-sandbox/
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/mojo-sandbox/pom.xml   (with props)
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/pom.xml   (with props)
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/src/
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/src/main/
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/src/main/assembly/
    geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/src/main/assembly/bin.xml   (with props)
Modified:
    geronimo/sandbox/gshell/trunk/gshell-assemblies/pom.xml
    geronimo/sandbox/gshell/trunk/gshell-cli/pom.xml
    geronimo/sandbox/gshell/trunk/gshell-core/pom.xml

Added: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/LICENSE.txt
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/LICENSE.txt?rev=411421&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/LICENSE.txt (added)
+++ geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/LICENSE.txt Sat Jun  3 04:04:54 2006
@@ -0,0 +1,201 @@
+                                 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.

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/LICENSE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/LICENSE.txt
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/LICENSE.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/pom.xml?rev=411421&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/pom.xml (added)
+++ geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/pom.xml Sat Jun  3 04:04:54 2006
@@ -0,0 +1,73 @@
+<project>
+  <parent>
+    <artifactId>mojo-sandbox</artifactId>
+    <groupId>org.codehaus.mojo</groupId>
+    <version>2-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>minijar-maven-plugin</artifactId>
+  <packaging>maven-plugin</packaging>
+  <name>Maven MiniJar Plugin</name>
+  <version>1.0-SNAPSHOT</version>
+  <scm>
+    <connection>scm:svn:https://svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox/minijar-maven-plugin</connection>
+    <developerConnection>scm:svn:https://svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox/minijar-maven-plugin</developerConnection>
+    <url>https://svn.mojo.codehaus.org/mojo/trunk/mojo/mojo-sandbox/minijar-maven-plugin</url>
+  </scm>
+  <developers>
+    <developer>
+      <id>tcurdt</id>
+      <name>Torsten Curdt</name>
+      <email>tcurdt at apache.org</email>
+      <roles>
+        <role>Java Developer</role>
+      </roles>
+      <timezone>+10</timezone>
+    </developer>
+  </developers>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-project</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact</artifactId>
+      <version>2.0</version>
+    </dependency>
+
+    <dependency>
+      <groupId>asm</groupId>
+      <artifactId>asm</artifactId>
+      <version>2.2</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <version>1.1</version>
+    </dependency>
+  </dependencies>
+
+  <licenses>
+    <license>
+      <name>Apache License 2.0</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+      <distribution>repo</distribution>
+    </license>
+  </licenses>
+
+
+<!--
+  <reporting>
+       <plugins>
+         <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>changes-maven-plugin</artifactId>
+            <version>2.0-beta-1</version>
+         </plugin>
+       </plugins>
+  </reporting>
+-->
+
+</project>

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/changes/changes.xml?rev=411421&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/changes/changes.xml (added)
+++ geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/changes/changes.xml Sat Jun  3 04:04:54 2006
@@ -0,0 +1,7 @@
+<document>
+  <properties>
+    <title>Maven MiniJar Plugin</title>
+    <author email="tcurdt at apache.org">Torsten Curdt</author>
+  </properties>
+
+</document>

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/changes/changes.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/changes/changes.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/changes/changes.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Clazz.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Clazz.java?rev=411421&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Clazz.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Clazz.java Sat Jun  3 04:04:54 2006
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2005 The Apache Software 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.
+ */
+package org.codehaus.mojo.minijar;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+public class Clazz
+    implements Comparable
+{
+
+    private final Set dependencies = new HashSet();
+
+    private final Set references = new HashSet();
+
+    private final String name;
+
+    public Clazz( final String pName )
+    {
+        name = pName;
+    }
+
+    public void addDependency( final Clazz pClazz )
+    {
+        //System.out.println(name + " -> " + pClazz);
+        pClazz.references.add( this );
+        dependencies.add( pClazz );
+    }
+
+    public Set getReferences()
+    {
+        return references;
+    }
+
+    public Set getDependencies()
+    {
+        return dependencies;
+    }
+
+    public Set getTransitiveDependencies()
+    {
+        final Set all = new HashSet();
+        findTransitiveDependencies( all );
+        return all;
+    }
+
+    void findTransitiveDependencies( final Set pAll )
+    {
+
+        for ( final Iterator it = dependencies.iterator(); it.hasNext(); )
+        {
+            final Clazz clazz = (Clazz) it.next();
+
+            if ( !pAll.contains( clazz ) )
+            {
+                pAll.add( clazz );
+                clazz.findTransitiveDependencies( pAll );
+            }
+        }
+    }
+
+    public boolean equals( Object pO )
+    {
+        if ( pO.getClass() != Clazz.class )
+        {
+            return false;
+        }
+        final Clazz c = (Clazz) pO;
+        return name.equals( c.name );
+    }
+
+    public int hashCode()
+    {
+        return name.hashCode();
+    }
+
+    public int compareTo( Object pO )
+    {
+        return name.compareTo( ( (Clazz) pO ).name );
+    }
+
+    public String toString()
+    {
+        return name;
+    }
+
+}

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Clazz.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Clazz.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Clazz.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Clazzpath.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Clazzpath.java?rev=411421&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Clazzpath.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Clazzpath.java Sat Jun  3 04:04:54 2006
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2005 The Apache Software 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.
+ */
+package org.codehaus.mojo.minijar;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+public final class Clazzpath
+{
+
+    final Collection units = new ArrayList();
+
+    final Map missing = new HashMap();
+
+    final Map clazzes = new HashMap();
+
+    public Clazzpath()
+    {
+    }
+
+    public Collection getClazzes()
+    {
+        return clazzes.values();
+    }
+
+    public Collection getMissingClazzes()
+    {
+        return missing.values();
+    }
+
+    public Clazz getClazz( final String pClazzName )
+    {
+        return (Clazz) clazzes.get( pClazzName );
+    }
+
+    public ClazzpathUnit[] getUnits()
+    {
+        return (ClazzpathUnit[]) units.toArray( new ClazzpathUnit[units.size()] );
+    }
+
+}

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Clazzpath.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Clazzpath.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Clazzpath.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/ClazzpathUnit.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/ClazzpathUnit.java?rev=411421&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/ClazzpathUnit.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/ClazzpathUnit.java Sat Jun  3 04:04:54 2006
@@ -0,0 +1,250 @@
+/*
+ * Copyright 2005 The Apache Software 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.
+ */
+package org.codehaus.mojo.minijar;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.text.DecimalFormat;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+import java.util.jar.JarOutputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.io.output.NullOutputStream;
+import org.codehaus.mojo.minijar.asm.DependencyVisitor;
+import org.objectweb.asm.ClassReader;
+
+public final class ClazzpathUnit
+{
+
+    private final File location;
+
+    private final Clazzpath clazzpath;
+
+    private final Map clazzes = new HashMap();
+
+    private final Map dependencies = new HashMap();
+
+    public ClazzpathUnit( final Clazzpath pClazzpath, final String pLocation )
+        throws IOException
+    {
+        clazzpath = pClazzpath;
+        clazzpath.units.add( this );
+        location = new File(pLocation);
+
+        ZipFile f = new ZipFile( pLocation );
+
+        Enumeration en = f.entries();
+        while ( en.hasMoreElements() )
+        {
+            ZipEntry entry = (ZipEntry) en.nextElement();
+            String entryName = entry.getName();
+            if ( entryName.endsWith( ".class" ) )
+            {
+
+                final String clazzName = entryName.substring( 0, entryName.length() - 6 ).replace( '/', '.' );
+
+                Clazz clazz = clazzpath.getClazz( clazzName );
+
+                if ( clazz == null )
+                {
+                    clazz = (Clazz) clazzpath.missing.get( clazzName );
+
+                    if ( clazz != null )
+                    {
+                        // already marked missing
+                        clazz = (Clazz) clazzpath.missing.remove( clazzName );
+                    }
+                    else
+                    {
+                        clazz = new Clazz( clazzName );
+                    }
+                }
+                else
+                {
+                    // classpath clash                     
+                }
+
+                clazzes.put( clazzName, clazz );
+                clazzpath.clazzes.put( clazzName, clazz );
+
+                final DependencyVisitor v = new DependencyVisitor();
+                new ClassReader( f.getInputStream( entry ) ).accept( v, false );
+                final Set depNames = v.getDependencies();
+
+                for ( final Iterator it = depNames.iterator(); it.hasNext(); )
+                {
+                    String depName = (String) it.next();
+
+                    Clazz dep = clazzpath.getClazz( depName );
+
+                    if ( dep == null )
+                    {
+                        // there is no such clazz yet
+                        dep = (Clazz) clazzpath.missing.get( depName );
+                    }
+
+                    if ( dep == null )
+                    {
+                        // it is also not recorded to be missing
+                        dep = new Clazz( depName );
+                        clazzpath.missing.put( depName, dep );
+                    }
+
+                    if ( dep != clazz )
+                    {
+                        dependencies.put( depName, dep );
+                        clazz.addDependency( dep );
+                    }
+                }
+            }
+        }
+
+        f.close();
+    }
+
+    public Collection getClazzes()
+    {
+        return clazzes.values();
+    }
+
+    public Clazz getClazz( final String pClazzName )
+    {
+        return (Clazz) clazzes.get( pClazzName );
+    }
+
+    public Collection getDependencies()
+    {
+        return dependencies.values();
+    }
+
+    public Collection getTransitiveDependencies()
+    {
+        final Set all = new HashSet();
+        for ( final Iterator it = clazzes.values().iterator(); it.hasNext(); )
+        {
+            final Clazz clazz = (Clazz) it.next();
+            clazz.findTransitiveDependencies( all );
+        }
+        return all;
+    }
+
+    public void write( final File pDir, final Matcher pMatcher, final Console pConsole )
+        throws IOException
+    {
+
+        final String name = location.getName();
+        final String nameJar = name.substring( 0, name.lastIndexOf( '.' ) ) + "-minimal.jar";
+
+        final File in = location;
+        final File out = new File( pDir, nameJar );
+        out.delete();
+
+        rewriteJar( new JarInputStream( new FileInputStream( in ) ), pMatcher,
+                    new JarOutputStream( new FileOutputStream( out ) ) );
+
+        final long inLength = in.length();
+        final long outLength = out.length();
+
+        if ( outLength == 0 )
+        {
+            if ( pConsole != null )
+            {
+                pConsole.println( name + " is empty! Dependency can be removed!" );
+            }
+            return;
+        }
+
+        if ( pConsole != null )
+        {
+            final DecimalFormat format = new DecimalFormat( "##0.0" );
+            pConsole.println( name + " classes:" + clazzes.size() + " dependencies:" + dependencies.size() + " => "
+                + format.format( 100 * outLength / inLength ) + "% (" + inLength + "->" + outLength + " bytes)" );
+        }
+    }
+
+    private static boolean rewriteJar( final JarInputStream pInput, final Matcher pMatcher,
+                                       final JarOutputStream pOutput )
+        throws IOException
+    {
+
+        boolean changed = false;
+
+        while ( true )
+        {
+            final JarEntry entry = pInput.getNextJarEntry();
+
+            if ( entry == null )
+            {
+                break;
+            }
+
+            if ( entry.isDirectory() )
+            {
+                pOutput.putNextEntry( new JarEntry( entry ) );
+                continue;
+            }
+
+            final String name = entry.getName();
+
+            if ( name.endsWith( ".class" ) )
+            {
+                if ( pMatcher.isMatching( name ) )
+                {
+
+                    pOutput.putNextEntry( new JarEntry( name ) );
+                    IOUtils.copy( pInput, pOutput );
+
+                    continue;
+                }
+
+                IOUtils.copy( pInput, new NullOutputStream() );
+
+                changed = true;
+
+            }
+            else if ( name.endsWith( ".jar" ) || name.endsWith( ".ear" ) || name.endsWith( ".zip" )
+                || name.endsWith( ".war" ) )
+            {
+
+                pOutput.putNextEntry( new JarEntry( name ) );
+                IOUtils.copy( pInput, pOutput );
+
+            }
+            else
+            {
+                pOutput.putNextEntry( new JarEntry( name ) );
+                IOUtils.copy( pInput, pOutput );
+            }
+        }
+
+        pInput.close();
+        pOutput.close();
+
+        return changed;
+    }
+
+}

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/ClazzpathUnit.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/ClazzpathUnit.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/ClazzpathUnit.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Console.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Console.java?rev=411421&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Console.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Console.java Sat Jun  3 04:04:54 2006
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2005 The Apache Software 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.
+ */
+package org.codehaus.mojo.minijar;
+
+public interface Console
+{
+    void println( final String pString );
+}

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Console.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Console.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Console.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Include.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Include.java?rev=411421&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Include.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Include.java Sat Jun  3 04:04:54 2006
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2006 The Apache Software 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.
+ */
+
+package org.codehaus.mojo.minijar;
+
+import java.io.File;
+
+/**
+ * Helper to configure src includes.
+ *
+ * @version $Id$
+ */
+public class Include
+{
+    private File directory;
+
+    public File getDirectory() {
+        return directory;
+    }
+
+    private String pattern;
+
+    public String getPattern() {
+        return pattern;
+    }
+
+    public String toString() {
+        return "directory=" + directory + ", pattern=" + pattern;
+    }
+}

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Include.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Include.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Include.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Matcher.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Matcher.java?rev=411421&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Matcher.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Matcher.java Sat Jun  3 04:04:54 2006
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2005 The Apache Software 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.
+ */
+package org.codehaus.mojo.minijar;
+
+public interface Matcher
+{
+    boolean isMatching( final String pClazzName );
+}

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Matcher.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Matcher.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/Matcher.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/MiniJarMojo.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/MiniJarMojo.java?rev=411421&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/MiniJarMojo.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/MiniJarMojo.java Sat Jun  3 04:04:54 2006
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2005 The Apache Software 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.
+ */
+package org.codehaus.mojo.minijar;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.DirectoryScanner;
+
+/**
+ * @goal minijar
+ * @description strips unused classes from the dependencies
+ * @requiresDependencyResolution compile
+ * @execute phase="package"
+ * */
+public final class MiniJarMojo
+    extends AbstractMojo
+{
+   /**
+     * @parameter expression="${executedProject}"
+     * @required
+     * @readonly
+     */
+    private MavenProject project;
+
+    /**
+     * @parameter
+     */
+    private List includes;
+
+    protected List getIncludes()
+    {
+        if ( includes != null && !includes.isEmpty() )
+        {
+            return includes;
+        }
+        else
+        {
+            return Collections.EMPTY_LIST;
+        }
+    }
+
+    //
+    // TODO: Add support to include specific classes, or class patterns as roots
+    //
+    
+    /**
+     * @parameter expression="${project.build.directory}/minijar"
+     * @required
+     */
+    private File outputDirectory;
+
+    public void execute()
+        throws MojoExecutionException
+    {
+        final Set artifacts = project.getArtifacts();
+
+        final Console console = new Console()
+        {
+            public void println( final String pString )
+            {
+                getLog().info( pString );
+            }
+        };
+
+        try
+        {
+            final MiniJarProcessor processor = new MiniJarProcessor();
+
+            List includes = getIncludes();
+            getLog().info("Includes: " + includes);
+
+            Iterator iter = includes.iterator();
+
+            while (iter.hasNext()) {
+                Include inc = (Include)iter.next();
+
+                File dir = inc.getDirectory();
+                String pattern = inc.getPattern();
+                DirectoryScanner scanner = new DirectoryScanner();
+                scanner.setBasedir( dir );
+                scanner.setIncludes( new String[] { pattern } );
+                scanner.scan();
+
+                List includedFiles = Arrays.asList( scanner.getIncludedFiles() );
+                for ( Iterator j = includedFiles.iterator(); j.hasNext(); )
+                {
+                    String name = (String) j.next();
+                    File file = new File( dir, name );
+
+                    getLog().info("Adding root unit: " + file);
+                    processor.addRootUnit( file.getAbsolutePath() );
+                }
+            }
+
+            for ( final Iterator it = artifacts.iterator(); it.hasNext(); )
+            {
+                final Artifact dependencyArtifact = (Artifact) it.next();
+                final File file = dependencyArtifact.getFile();
+
+                if ("jar".equals(dependencyArtifact.getType())) {
+                    getLog().info("Adding unit: " + file);
+
+                    processor.addUnit( file.getAbsolutePath() );
+                }
+                else {
+                    getLog().info("Skipping non-jar artifact: " + dependencyArtifact);
+                }
+            }
+
+            if (!outputDirectory.exists()) {
+                outputDirectory.mkdirs();
+            }
+            processor.setOutputPath( outputDirectory.getAbsolutePath() );
+
+            processor.generate( console );
+
+        }
+        catch ( final IOException e )
+        {
+            throw new MojoExecutionException( "failed to process jar", e );
+        }
+    }
+}

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/MiniJarMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/MiniJarMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/MiniJarMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/MiniJarProcessor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/MiniJarProcessor.java?rev=411421&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/MiniJarProcessor.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/MiniJarProcessor.java Sat Jun  3 04:04:54 2006
@@ -0,0 +1,197 @@
+/*
+ * Copyright 2005 The Apache Software 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.
+ */
+package org.codehaus.mojo.minijar;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.Iterator;
+import java.util.List;
+
+public final class MiniJarProcessor
+{
+
+    private final Clazzpath clazzpath = new Clazzpath();
+
+    private List roots = new ArrayList();
+
+    private File dir;
+
+    public MiniJarProcessor()
+    {
+    }
+
+    public void addRootUnit( final String pLocation )
+        throws IOException
+    {
+        roots.add( new ClazzpathUnit( clazzpath, pLocation ) );
+    }
+
+    public void addUnit( final String pLocation )
+        throws IOException
+    {
+        new ClazzpathUnit( clazzpath, pLocation );
+    }
+
+    public void setOutputPath( final String pPath )
+    {
+        dir = new File( pPath );
+    }
+
+    private Collection getAllClazzes() {
+        return clazzpath.getClazzes();
+    }
+
+    private Collection getMissingClazzes() {
+        return clazzpath.getMissingClazzes();
+    }
+
+    private Collection getJarClazzes() {
+        Collection c = new HashSet();
+        Iterator iter = roots.iterator();
+        while (iter.hasNext()) {
+            ClazzpathUnit clazzpath = (ClazzpathUnit)iter.next();
+            c.addAll(clazzpath.getClazzes());
+        }
+
+        return c;
+    }
+
+    private Collection getJarDependencies() {
+        Collection c = new HashSet();
+        Iterator iter = roots.iterator();
+        while (iter.hasNext()) {
+            ClazzpathUnit clazzpath = (ClazzpathUnit)iter.next();
+            c.addAll(clazzpath.getDependencies());
+        }
+
+        return c;
+    }
+
+    private Collection getJarTransitiveDependencies() {
+        Collection c = new HashSet();
+        Iterator iter = roots.iterator();
+        while (iter.hasNext()) {
+            ClazzpathUnit clazzpath = (ClazzpathUnit)iter.next();
+            c.addAll(clazzpath.getTransitiveDependencies());
+        }
+
+        return c;
+    }
+
+    public void generate( final Console pConsole )
+        throws IOException
+    {
+        final Collection allClazzes = getAllClazzes();
+        final Collection missing = getMissingClazzes();
+        final Collection jarClazzes = getJarClazzes();
+        final Collection jarDependencies = getJarDependencies();
+        final Collection jarTransitiveDependencies = getJarTransitiveDependencies();
+
+        final Collection remove = new ArrayList();
+        remove.addAll( allClazzes );
+        remove.removeAll( jarClazzes );
+        remove.removeAll( jarTransitiveDependencies );
+
+        final Matcher matcher = new Matcher()
+        {
+            final Set removeSet = new HashSet( remove );
+
+            public boolean isMatching( final String pName )
+            {
+                final String clazzName = pName.substring( 0, pName.length() - 6 ).replace( '/', '.' );
+                final Clazz clazz = new Clazz( clazzName );
+                final boolean removeIt = remove.contains( clazz );
+
+                /*
+                 if (removeIt) {
+                 System.out.println(" removing " + clazz);
+                 } else {
+                 final Clazz c = classpath.getClazz(clazzName);
+                 if (c == null) {
+                 System.out.println(" hmm... don't know anything about " + clazzName);
+                 } else {
+                 System.out.println(" keeping " + c + " because of " + c.getReferences());
+                 }
+                 }
+                 */
+
+                return !removeIt;
+            }
+        };
+
+        final ClazzpathUnit[] units = clazzpath.getUnits();
+        for ( int i = 0; i < units.length; i++ )
+        {
+            final ClazzpathUnit unit = units[i];
+            unit.write( dir, matcher, pConsole );
+        }
+    }
+
+    //        System.out.println("jar classes " + jarClazzes.size());
+    //        System.out.println("jar dependencies " + jarDependencies.size());
+    //        System.out.println("jar transitive dependencies " + jarTransitiveDependencies.size());
+    //
+    //        final Collection remove = new ArrayList();
+    //        remove.addAll(allClazzes);
+    //        remove.removeAll(jarClazzes);
+    //        remove.removeAll(jarTransitiveDependencies);
+    //        
+    //        System.out.println("we can remove " + remove.size() + " of the total " + allClazzes.size());
+    //        
+    //        System.out.println("--seed deps");
+    //
+    //        final List seedList = new ArrayList(jarDependencies);
+    //        Collections.sort(seedList);
+    //
+    //        for (final Iterator it = seedList.iterator(); it.hasNext();) {
+    //            final Clazz clazz = (Clazz) it.next();
+    //            System.out.println("seed: " + clazz);            
+    //        }
+    //
+    //        System.out.println("--removing");
+    //
+    //        final List removeList = new ArrayList(remove);
+    //        Collections.sort(removeList);
+    //
+    //        for (final Iterator it = removeList.iterator(); it.hasNext();) {
+    //            final Clazz clazz = (Clazz) it.next();
+    //            if (clazz.getReferences().size() != 0) {
+    //                System.out.print("!!");
+    //            }
+    //            System.out.println("remove: " + clazz + " referenced by " + clazz.getReferences());            
+    //        }
+    //        
+    //        System.out.println("--missing");
+    //
+    //        final List missingList = new ArrayList(missing);
+    //        Collections.sort(missingList);
+    //        
+    //        for (final Iterator it = missingList.iterator(); it.hasNext();) {
+    //            final Clazz clazz = (Clazz) it.next();
+    //            System.out.println("missing: " + clazz);
+    //            /*
+    //            final Set references = clazz.getReferences();
+    //            for (final Iterator j = references.iterator(); j.hasNext();) {
+    //                final Clazz ref = (Clazz) j.next();
+    //                System.out.println(" ref: " + ref);                
+    //            }
+    //         */
+    //        }
+}

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/MiniJarProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/MiniJarProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/MiniJarProcessor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/DelegatingAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/DelegatingAdapter.java?rev=411421&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/DelegatingAdapter.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/DelegatingAdapter.java Sat Jun  3 04:04:54 2006
@@ -0,0 +1,263 @@
+/*
+ * Copyright 2005 The Apache Software 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.
+ */
+package org.codehaus.mojo.minijar.asm;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+
+public abstract class DelegatingAdapter implements ClassVisitor, FieldVisitor, MethodVisitor {
+
+    private ClassVisitor cv;
+    private MethodVisitor mv;
+    private FieldVisitor fv;
+
+
+    protected DelegatingAdapter(final ClassVisitor pClassVisitor) {
+        cv = pClassVisitor;
+    }
+
+
+    public final AnnotationVisitor visitAnnotation( String desc, boolean visible ) {
+        if (fv != null) {
+            return doVisitFieldAnnotation(desc, visible);
+        }
+        if (mv != null) {
+            return doVisitMethodAnnotation(desc, visible);
+        }
+        return doVisitClassAnnotation(desc, visible);
+    }
+
+
+    protected AnnotationVisitor doVisitClassAnnotation( String desc, boolean visible ) {
+        return cv.visitAnnotation(desc, visible);
+    }
+
+
+    protected AnnotationVisitor doVisitMethodAnnotation( String desc, boolean visible ) {
+        return mv.visitAnnotation(desc, visible);
+    }
+
+
+    protected AnnotationVisitor doVisitFieldAnnotation( String desc, boolean visible ) {
+        return fv.visitAnnotation(desc, visible);
+    }
+
+
+    public final void visitAttribute( Attribute attr ) {
+        if (fv != null) {
+            doVisitFieldAttribute(attr);
+        } else if (mv != null) {
+            doVisitMethodAttribute(attr);
+        } else {
+            doVisitClassAttribute(attr);
+        }
+    }
+
+
+    protected void doVisitClassAttribute( Attribute attr ) {
+        cv.visitAttribute(attr);
+    }
+
+
+    protected void doVisitMethodAttribute( Attribute attr ) {
+        mv.visitAttribute(attr);
+    }
+
+
+    protected void doVisitFieldAttribute( Attribute attr ) {
+        fv.visitAttribute(attr);
+    }
+
+
+    public final void visitEnd() {
+        if (fv != null) {
+            doVisitFieldEnd();
+            fv = null;
+        } else if (mv != null) {
+            doVisitMethodEnd();
+            mv = null;
+        } else {
+            doVisitClassEnd();
+        }
+    }
+
+
+    protected void doVisitClassEnd() {
+        cv.visitEnd();
+    }
+
+
+    protected void doVisitMethodEnd() {
+        mv.visitEnd();
+    }
+
+
+    protected void doVisitFieldEnd() {
+        fv.visitEnd();
+    }
+
+
+    public void visit( int version, int access, String name, String signature, String superName,
+            String[] interfaces ) {
+        cv.visit(version, access, name, signature, superName, interfaces);
+    }
+
+
+    public final FieldVisitor visitField( int access, String name, String desc, String signature,
+            Object value ) {
+        fv = doVisitField(access, name, desc, signature, value);
+        return this;
+    }
+
+
+    protected FieldVisitor doVisitField( int access, String name, String desc, String signature,
+            Object value ) {
+        return cv.visitField(access, name, desc, signature, value);
+    }
+
+
+    public void visitInnerClass( String name, String outerName, String innerName, int access ) {
+        cv.visitInnerClass(name, outerName, innerName, access);
+    }
+
+
+    public final MethodVisitor visitMethod( int access, String name, String desc, String signature,
+            String[] exceptions ) {
+        mv = doVisitMethod(access, name, desc, signature, exceptions);
+        return this;
+    }
+
+
+    protected MethodVisitor doVisitMethod( int access, String name, String desc, String signature,
+            String[] exceptions ) {
+        return cv.visitMethod(access, name, desc, signature, exceptions);
+    }
+
+
+    public void visitOuterClass( String owner, String name, String desc ) {
+        cv.visitOuterClass(owner, name, desc);
+    }
+
+
+    public void visitSource( String source, String debug ) {
+        cv.visitSource(source, debug);
+    }
+
+
+    public AnnotationVisitor visitAnnotationDefault() {
+        return mv.visitAnnotationDefault();
+    }
+
+
+    public void visitCode() {
+        mv.visitCode();
+    }
+
+
+    public void visitFieldInsn( int opcode, String owner, String name, String desc ) {
+        mv.visitFieldInsn(opcode, owner, name, desc);
+    }
+
+
+    public void visitIincInsn( int var, int increment ) {
+        mv.visitIincInsn(var, increment);
+    }
+
+
+    public void visitInsn( int opcode ) {
+        mv.visitInsn(opcode);
+    }
+
+
+    public void visitIntInsn( int opcode, int operand ) {
+        mv.visitIntInsn(opcode, operand);
+    }
+
+
+    public void visitJumpInsn( int opcode, Label label ) {
+        mv.visitJumpInsn(opcode, label);
+    }
+
+
+    public void visitLabel( Label label ) {
+        mv.visitLabel(label);
+    }
+
+
+    public void visitLdcInsn( Object cst ) {
+        mv.visitLdcInsn(cst);
+    }
+
+
+    public void visitLineNumber( int line, Label start ) {
+        mv.visitLineNumber(line, start);
+    }
+
+
+    public void visitLocalVariable( String name, String desc, String signature, Label start,
+            Label end, int index ) {
+        mv.visitLocalVariable(name, desc, signature, start, end, index);
+    }
+
+
+    public void visitLookupSwitchInsn( Label dflt, int[] keys, Label[] labels ) {
+        mv.visitLookupSwitchInsn(dflt, keys, labels);
+    }
+
+
+    public void visitMaxs( int maxStack, int maxLocals ) {
+        mv.visitMaxs(maxStack, maxLocals);
+    }
+
+
+    public void visitMethodInsn( int opcode, String owner, String name, String desc ) {
+        mv.visitMethodInsn(opcode, owner, name, desc);
+    }
+
+
+    public void visitMultiANewArrayInsn( String desc, int dims ) {
+        mv.visitMultiANewArrayInsn(desc, dims);
+    }
+
+
+    public AnnotationVisitor visitParameterAnnotation( int parameter, String desc, boolean visible ) {
+        return mv.visitParameterAnnotation(parameter, desc, visible);
+    }
+
+
+    public void visitTableSwitchInsn( int min, int max, Label dflt, Label[] labels ) {
+        mv.visitTableSwitchInsn(min, max, dflt, labels);
+    }
+
+
+    public void visitTryCatchBlock( Label start, Label end, Label handler, String type ) {
+        mv.visitTryCatchBlock(start, end, handler, type);
+    }
+
+
+    public void visitTypeInsn( int opcode, String desc ) {
+        mv.visitTypeInsn(opcode, desc);
+    }
+
+
+    public void visitVarInsn( int opcode, int var ) {
+        mv.visitVarInsn(opcode, var);
+    }
+}

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/DelegatingAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/DelegatingAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/DelegatingAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/DependencyVisitor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/DependencyVisitor.java?rev=411421&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/DependencyVisitor.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/DependencyVisitor.java Sat Jun  3 04:04:54 2006
@@ -0,0 +1,395 @@
+/*
+ * Copyright 2005 The Apache Software 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.
+ */
+package org.codehaus.mojo.minijar.asm;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Type;
+import org.objectweb.asm.signature.SignatureReader;
+import org.objectweb.asm.signature.SignatureVisitor;
+
+public final class DependencyVisitor implements
+        AnnotationVisitor,
+        SignatureVisitor,
+        ClassVisitor,
+        FieldVisitor,
+        MethodVisitor
+{
+    
+    final Set classes = new HashSet();
+    
+    public Set getDependencies() {
+        return classes;
+    }
+    
+    public void visit(
+        int version,
+        int access,
+        String name,
+        String signature,
+        String superName,
+        String[] interfaces)
+    {
+        if (signature == null) {
+            addName(superName);
+            addNames(interfaces);
+        } else {
+            addSignature(signature);
+        }
+    }
+
+    public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+        addDesc(desc);
+        return this;
+    }
+
+    public void visitAttribute(Attribute attr) {
+    }
+
+    public FieldVisitor visitField(
+        int access,
+        String name,
+        String desc,
+        String signature,
+        Object value
+        )
+    {
+        if (signature == null) {
+            //addDesc(desc);
+        } else {
+            addTypeSignature(signature);
+        }
+        if (value instanceof Type) {
+            addType((Type) value);
+        }
+        return this;
+    }
+
+    public MethodVisitor visitMethod(
+        int access,
+        String name,
+        String desc,
+        String signature,
+        String[] exceptions
+        )
+    {
+        if (signature == null) {
+            addMethodDesc(desc);
+        } else {
+            addSignature(signature);
+        }
+        addNames(exceptions);
+        return this;
+    }
+
+    public void visitSource(String source, String debug) {
+    }
+
+    public void visitInnerClass(
+        String name,
+        String outerName,
+        String innerName,
+        int access
+        )
+    {
+        //addName(innerName);
+        addName(outerName);
+    }
+
+    public void visitOuterClass(String owner, String name, String desc) {
+        addName(owner);
+        if (desc != null) {
+            addMethodDesc(desc);
+        }
+    }
+
+    
+    final static String[] search = {
+        "I", "Ljava/io/File;" 
+    };
+    
+    private void bark( final String s ) {
+        if (s == null) {
+            return;
+        }
+        
+        for (int i = 0; i < search.length; i++) {
+            if (s.equals(search[i])) {
+                throw new RuntimeException(s);
+            }            
+        }
+    }
+
+    // MethodVisitor
+
+    public AnnotationVisitor visitParameterAnnotation(
+        int parameter,
+        String desc,
+        boolean visible
+        )
+    {
+        addDesc(desc);
+        return this;
+    }
+
+    public void visitTypeInsn(int opcode, String desc) {
+        addDesc(desc);
+    }
+
+    public void visitFieldInsn(
+        int opcode,
+        String owner,
+        String name,
+        String desc
+        )
+    {
+        addName(owner);
+        //addName(name);
+        //addDesc(desc);
+    }
+
+    public void visitMethodInsn(
+        int opcode,
+        String owner,
+        String name,
+        String desc
+        )
+    {
+        addName(owner);
+        //addName(name);
+        addMethodDesc(desc);
+    }
+
+    public void visitLdcInsn(Object cst) {
+        if (cst instanceof Type) {
+            addType((Type) cst);
+        }
+    }
+
+    public void visitMultiANewArrayInsn(String desc, int dims) {
+        addDesc(desc);
+    }
+
+    public void visitLocalVariable(
+        String name,
+        String desc,
+        String signature,
+        Label start,
+        Label end,
+        int index
+        )
+    {
+        //addName(name);
+        //addDesc(desc);
+        addTypeSignature(signature);
+    }
+
+    public AnnotationVisitor visitAnnotationDefault() {
+        return this;
+    }
+
+    public void visitCode() {
+    }
+
+    public void visitInsn(int opcode) {
+    }
+
+    public void visitIntInsn(int opcode, int operand) {
+    }
+
+    public void visitVarInsn(int opcode, int var) {
+    }
+
+    public void visitJumpInsn(int opcode, Label label) {
+    }
+
+    public void visitLabel(Label label) {
+    }
+
+    public void visitIincInsn(int var, int increment) {
+    }
+
+    public void visitTableSwitchInsn(
+        int min,
+        int max,
+        Label dflt,
+        Label[] labels
+        )
+    {
+    }
+
+    public void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels) {
+    }
+
+    public void visitTryCatchBlock(
+        Label start,
+        Label end,
+        Label handler,
+        String type
+        )
+    {
+        addName(type);
+    }
+
+    public void visitLineNumber(int line, Label start) {
+    }
+
+    public void visitMaxs(int maxStack, int maxLocals) {
+    }
+
+    public void visit(String name, Object value) {
+        addName(name);
+        if (value instanceof Type) {
+            addType((Type) value);
+        }
+    }
+
+    public void visitEnum(String name, String desc, String value) {
+        addName(name);        
+        addDesc(desc);
+    }
+
+    public AnnotationVisitor visitAnnotation(String name, String desc) {
+        addName(name);
+        addDesc(desc);
+        return this;
+    }
+
+    public AnnotationVisitor visitArray(String name) {
+        addName(name);
+        return this;
+    }
+
+    public void visitFormalTypeParameter(String name) {
+        addName(name);
+    }
+
+    public SignatureVisitor visitClassBound() {
+        return this;
+    }
+
+    public SignatureVisitor visitInterfaceBound() {
+        return this;
+    }
+
+    public SignatureVisitor visitSuperclass() {
+        return this;
+    }
+
+    public SignatureVisitor visitInterface() {
+        return this;
+    }
+
+    public SignatureVisitor visitParameterType() {
+        return this;
+    }
+
+    public SignatureVisitor visitReturnType() {
+        return this;
+    }
+
+    public SignatureVisitor visitExceptionType() {
+        return this;
+    }
+
+    public void visitBaseType(char descriptor) {
+    }
+
+    public void visitTypeVariable(String name) {
+        addName(name);
+    }
+
+    public SignatureVisitor visitArrayType() {
+        return this;
+    }
+
+    public void visitClassType(String name) {
+        addName(name);
+    }
+
+    public void visitInnerClassType(String name) {
+        addName(name);
+    }
+
+    public void visitTypeArgument() {
+    }
+
+    public SignatureVisitor visitTypeArgument(char wildcard) {
+        return this;
+    }
+
+    public void visitEnd() {
+    }
+
+    // ---------------------------------------------
+
+    private void addName(String name) {
+        if (name == null) {
+            return;
+        }
+
+        bark(name);
+        
+        classes.add(name.replace('/', '.'));
+    }
+
+    private void addNames(String[] names) {
+        for (int i = 0; names != null && i < names.length; i++)
+            addName(names[i]);
+    }
+
+    private void addDesc(String desc) {
+        if (desc.charAt(0) == '[') {
+            addType(Type.getType(desc));
+        } else {
+            addName(desc);
+        }
+    }
+
+    private void addMethodDesc(String desc) {
+        addType(Type.getReturnType(desc));
+        Type[] types = Type.getArgumentTypes(desc);
+        for (int i = 0; i < types.length; i++)
+            addType(types[i]);
+    }
+
+    private void addType(Type t) {
+        switch (t.getSort()) {
+            case Type.ARRAY:
+                addType(t.getElementType());
+                break;
+            case Type.OBJECT:
+                addName(t.getClassName().replace('.', '/'));
+                break;
+        }
+    }
+
+    private void addSignature(String signature) {
+        if (signature != null)
+            new SignatureReader(signature).accept(this);
+    }
+
+    private void addTypeSignature(String signature) {
+        if (signature != null)
+            new SignatureReader(signature).acceptType(this);
+    }
+}

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/DependencyVisitor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/DependencyVisitor.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/DependencyVisitor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/RenamingAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/RenamingAdapter.java?rev=411421&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/RenamingAdapter.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/RenamingAdapter.java Sat Jun  3 04:04:54 2006
@@ -0,0 +1,134 @@
+/*
+ * Copyright 2005 The Apache Software 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.
+ */
+package org.codehaus.mojo.minijar.asm;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+
+
+public final class RenamingAdapter extends DelegatingAdapter {
+
+    private String oldName;
+    private String newName;
+
+    public RenamingAdapter( final ClassVisitor pClassVisitor, final String pNewName, final String pOldName ) {
+        super(pClassVisitor);
+        newName = toInternalName(pNewName);
+        oldName = toInternalName(pOldName);
+    }
+
+    private String toInternalName( final String pName ) {
+        if (pName.indexOf('.') >= 0) {
+            return "L" + pName.replace('.', '/');
+        }
+        int lastCharIndex = pName.length() - 1;
+        if (pName.charAt(lastCharIndex) == ';') {
+            return pName.substring(0, lastCharIndex);
+        }
+        return pName;
+    }
+
+    private String transplant( final String pString ) {
+        if (pString == null) {
+            return null;
+        }
+        int index = pString.indexOf(oldName);
+        if (index < 0) {
+            return pString;
+        }
+        int lengthOld = oldName.length();
+        StringBuffer result = new StringBuffer();
+        String remaining = pString;
+        while (remaining.length() > 0) {
+            result.append(remaining.substring(0, index));
+            char nextChar = remaining.charAt(index + lengthOld);
+            if (nextChar == ';' || nextChar == '<' || nextChar == '>') {
+                result.append(newName);
+            } else {
+                result.append(oldName);
+            }
+            remaining = remaining.substring(index + lengthOld);
+            index = remaining.indexOf(oldName);
+            if (index < 0) {
+                result.append(remaining);
+                break;
+            }
+        }
+        return result.toString();
+    }
+
+    private String[] transplant( final String[] pStrings) {
+        if (pStrings == null) {
+            return null;
+        }
+        String[] result = new String[pStrings.length];
+        for (int i = 0; i < pStrings.length; i++) {
+            result[i] = transplant(pStrings[i]);
+        }
+        return result;
+    }
+
+    protected AnnotationVisitor doVisitClassAnnotation(String desc, boolean visible) {
+        return super.doVisitClassAnnotation(transplant(desc), visible);
+    }
+
+    protected FieldVisitor doVisitField(int access, String name, String desc, String signature, Object value) {
+        return super.doVisitField(access, name, transplant(desc), transplant(signature), value);
+    }
+
+    protected MethodVisitor doVisitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+        return super.doVisitMethod(access, transplant(name), transplant(desc), transplant(signature), transplant(exceptions));
+    }
+
+    public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
+        super.visit(version, access, transplant(name), transplant(signature), transplant(superName), transplant(interfaces));
+    }
+
+    public void visitFieldInsn(int opcode, String owner, String name, String desc) {
+        super.visitFieldInsn(opcode, transplant(owner), transplant(name), transplant(desc));
+    }
+
+    public void visitInnerClass(String name, String outerName, String innerName, int access) {
+        super.visitInnerClass(transplant(name), transplant(outerName), transplant(innerName), access);
+    }
+
+    public void visitLocalVariable(String name, String desc, String signature, Label start, Label end, int index) {
+        super.visitLocalVariable(transplant(name), transplant(desc), transplant(signature), start, end, index);
+    }
+
+    public void visitMethodInsn(int opcode, String owner, String name, String desc) {
+        super.visitMethodInsn(opcode, transplant(owner), transplant(name), transplant(desc));
+    }
+
+    public void visitMultiANewArrayInsn(String desc, int dims) {
+        super.visitMultiANewArrayInsn(transplant(desc), dims);
+    }
+
+    public void visitOuterClass(String owner, String name, String desc) {
+        super.visitOuterClass(transplant(owner), transplant(name), transplant(desc));
+    }
+
+    public void visitTryCatchBlock(Label start, Label end, Label handler, String type) {
+        super.visitTryCatchBlock(start, end, handler, transplant(type));
+    }
+
+    public void visitTypeInsn(int opcode, String desc) {
+        super.visitTypeInsn(opcode, transplant(desc));
+    }    
+}

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/RenamingAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/RenamingAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/main/java/org/codehaus/mojo/minijar/asm/RenamingAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/site/apt/howto.apt
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/site/apt/howto.apt?rev=411421&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/site/apt/howto.apt (added)
+++ geronimo/sandbox/gshell/trunk/gshell-assemblies/gshell-squeezed-assembly/minijar-maven-plugin/src/site/apt/howto.apt Sat Jun  3 04:04:54 2006
@@ -0,0 +1,4 @@
+How to Use
+
+  Just call the 'minijar:minijar' goal and it will generate a set of *-minimal.jar
+  files in the target directory.



Mime
View raw message