You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Adam <pu...@gmail.com> on 2008/08/26 18:32:04 UTC

Maven Assembly Help

Greetings:

Earlier I had posted about getting duplicate .class files in a
Jar-with-dependencies.  The fix I found was to exclude the
${project.groupId}:${project.artifactId} from the current project.
However, I am getting duplicates it seems from transitively dependent
JARs and am finding it difficult (ie, not yet possible from what I've
done) to exclude them.  Can someone please help with not getting the
duplicate .class files in a jar-with dependencies?  The reasoning for
this is I need to obfuscate the JAR (I am using a the antrun plugin
with YGuard for this).

My setup:
Windows XP 32bit
Maven 2.0.8
Java 1.6.0_07

Here is my assembly descriptor
<assembly>
  <id>jar-with-dependencies</id>
  <formats>
    <format>jar</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>
  <dependencySets>
    <dependencySet>
	  <unpack>true</unpack>
      <scope>runtime</scope>
      <excludes>
        <exclude>com.mobilvox.endGroupId:${project.artifactId}</exclude>
      </excludes>
    </dependencySet>
  </dependencySets>
  <fileSets>
    <fileSet>
      <directory>target/classes</directory>
	  <outputDirectory>/</outputDirectory>
    </fileSet>
  </fileSets>
</assembly>

I have tried adding this to maybe remove a duplicate:
<exclude>nu.xom:javax</exclude>

It did not work, and my duplicates are still coming from javax.xml and
javax.transaction.

Thanks in advance,

-- 
Adam

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven Assembly Help

Posted by Brett Porter <br...@gmail.com>.
You should be able to remove entire artifacts, but not individual
classes. If the latter is what you are trying to do, a better solution
might be to use the dependency plugin to unpack them artifacts into a
temporary location in target, then use the assembly descriptor with
filesets to pick up the classes that you want to include.

Cheers,
Brett

2008/8/27 Adam <pu...@gmail.com>:
> Greetings:
>
> Earlier I had posted about getting duplicate .class files in a
> Jar-with-dependencies.  The fix I found was to exclude the
> ${project.groupId}:${project.artifactId} from the current project.
> However, I am getting duplicates it seems from transitively dependent
> JARs and am finding it difficult (ie, not yet possible from what I've
> done) to exclude them.  Can someone please help with not getting the
> duplicate .class files in a jar-with dependencies?  The reasoning for
> this is I need to obfuscate the JAR (I am using a the antrun plugin
> with YGuard for this).
>
> My setup:
> Windows XP 32bit
> Maven 2.0.8
> Java 1.6.0_07
>
> Here is my assembly descriptor
> <assembly>
>  <id>jar-with-dependencies</id>
>  <formats>
>    <format>jar</format>
>  </formats>
>  <includeBaseDirectory>false</includeBaseDirectory>
>  <dependencySets>
>    <dependencySet>
>          <unpack>true</unpack>
>      <scope>runtime</scope>
>      <excludes>
>        <exclude>com.mobilvox.endGroupId:${project.artifactId}</exclude>
>      </excludes>
>    </dependencySet>
>  </dependencySets>
>  <fileSets>
>    <fileSet>
>      <directory>target/classes</directory>
>          <outputDirectory>/</outputDirectory>
>    </fileSet>
>  </fileSets>
> </assembly>
>
> I have tried adding this to maybe remove a duplicate:
> <exclude>nu.xom:javax</exclude>
>
> It did not work, and my duplicates are still coming from javax.xml and
> javax.transaction.
>
> Thanks in advance,
>
> --
> Adam
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>



-- 
Brett Porter
Blog: http://blogs.exist.com/bporter/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org