[ 
http://jira.codehaus.org/browse/MSHADE-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=190011#action_190011
 ] 

Paul Hammant commented on MSHADE-62:
------------------------------------

I thought I could exclude classes that would never be used by PicoContainer 
like so :-
{noformat} 
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactId>picocontainer</shadedArtifactId>
              <artifactSet>
                <excludes>
                  <exclude>javax.annotation:jsr250-api</exclude>
                </excludes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>com.thoughtworks.paranamer</pattern>
                  <shadedPattern>org.picocontainer.paranamer</shadedPattern>
                  <excludes>
                    
<exclude>com.thoughtworks.paranamer.JavadocParanamer</exclude>
                  </excludes>
                </relocation>
              </relocations>
            </configuration>
          </execution>
        </executions>
      </plugin>
{noformat} 

Unfortunately, exclude does not mean exclude it means "don't re-package" .....

{noformat} 
ph-mbp:container paul$ jar -tvf target/picocontainer-2.9-SNAPSHOT.jar | grep 
paranamer
     0 Sun Sep 06 11:06:50 CDT 2009 org/picocontainer/paranamer/
  3150 Sun Sep 06 11:06:50 CDT 2009 
org/picocontainer/paranamer/AdaptiveParanamer.class
   809 Sun Sep 06 11:06:50 CDT 2009 
org/picocontainer/paranamer/BytecodeReadingParanamer$1.class
  7803 Sun Sep 06 11:06:50 CDT 2009 
org/picocontainer/paranamer/BytecodeReadingParanamer$ClassReader.class
  2977 Sun Sep 06 11:06:50 CDT 2009 
org/picocontainer/paranamer/BytecodeReadingParanamer$MethodCollector.class
  4662 Sun Sep 06 11:06:50 CDT 2009 
org/picocontainer/paranamer/BytecodeReadingParanamer$Type.class
  6262 Sun Sep 06 11:06:50 CDT 2009 
org/picocontainer/paranamer/BytecodeReadingParanamer$TypeCollector.class
  6198 Sun Sep 06 11:06:50 CDT 2009 
org/picocontainer/paranamer/BytecodeReadingParanamer.class
  2535 Sun Sep 06 11:06:50 CDT 2009 
org/picocontainer/paranamer/CachingParanamer.class
  5336 Sun Sep 06 11:06:50 CDT 2009 
org/picocontainer/paranamer/DefaultParanamer.class
     0 Sun Sep 06 11:06:50 CDT 2009 com/thoughtworks/paranamer/
 10630 Sun Sep 06 11:06:50 CDT 2009 
com/thoughtworks/paranamer/JavadocParanamer.class
  1432 Sun Sep 06 11:06:50 CDT 2009 
org/picocontainer/paranamer/NullParanamer.class
   964 Sun Sep 06 11:06:50 CDT 2009 
org/picocontainer/paranamer/ParameterNamesNotFoundException.class
   762 Sun Sep 06 11:06:50 CDT 2009 org/picocontainer/paranamer/Paranamer.class
   549 Sun Sep 06 11:06:50 CDT 2009 
org/picocontainer/paranamer/ParanamerConstants.class
     0 Sun Sep 06 11:06:50 CDT 2009 META-INF/maven/com.thoughtworks.paranamer/
     0 Sun Sep 06 11:06:50 CDT 2009 
META-INF/maven/com.thoughtworks.paranamer/paranamer/
  1290 Sun Sep 06 11:06:50 CDT 2009 
META-INF/maven/com.thoughtworks.paranamer/paranamer/pom.xml
   127 Sun Sep 06 11:06:50 CDT 2009 
META-INF/maven/com.thoughtworks.paranamer/paranamer/pom.properties
{noformat} 

Specifically, its these two lines that I'd rather were left out completely (not 
in the jar, not in the jar in re-packaged form) ..

{noformat} 
     0 Sun Sep 06 11:06:50 CDT 2009 com/thoughtworks/paranamer/
 10630 Sun Sep 06 11:06:50 CDT 2009 
com/thoughtworks/paranamer/JavadocParanamer.class
{noformat} 

Also, I'd rather do without the pom.xml stuff for paranamer too, but that's a 
different issue.

- Paul




> We need an <obliterate/> element - to TRULY exclude classes from resulting 
> jar 
> -------------------------------------------------------------------------------
>
>                 Key: MSHADE-62
>                 URL: http://jira.codehaus.org/browse/MSHADE-62
>             Project: Maven 2.x Shade Plugin
>          Issue Type: New Feature
>            Reporter: Paul Hammant
>
> 'exclusions' is misnamed - it should be 'leaveAsIs' or somesuch.
> I want to totally exclude some packages or classes from the resulting jar.  
> As in leave them out, or kill them, or don't have them at all in the 
> resulting jar.  Neither as their original class name nor their potential new 
> class name.
> Perforce has an 'obliterate' concept, given exclude is already used in shade, 
> maybe obliterate is the new element for this essential feature.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to