You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Edmondo Porcu <Ed...@gottexbrokers.com> on 2011/11/14 15:51:08 UTC

Assembly plugin and multiple dependency sets

Dear All,
I would need better help in understanding how the Maven Assembly plugin works. I am using a third-party application server which automatically generates an assembly.xml and I am having a problem:

I have a multi-module maven project and if I add one maven dependency in a specific module (called common) this is correctly bundled, if I put in the other module this is not bundled and produces a ClassNotFoundException when deploying on the app server. This is how my assembly.xml looks like.

<assembly>
  <id>assemble-pu</id>
  <formats>
    <format>jar</format>
    <format>dir</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>
  <fileSets>
    <fileSet>
      <directory>target/classes</directory>
      <lineEnding>keep</lineEnding>
      <outputDirectory>/</outputDirectory>
      <includes>
        <include>**/**</include>
      </includes>
    </fileSet>
  </fileSets>
  <dependencySets>
    <dependencySet>
      <useProjectArtifact>false</useProjectArtifact>
      <useTransitiveDependencies>false</useTransitiveDependencies>
      <outputDirectory>lib</outputDirectory>
      <excludes>
        <exclude>Gottware:common</exclude>
      </excludes>
    </dependencySet>
    <dependencySet>
      <useProjectArtifact>false</useProjectArtifact>
      <useTransitiveDependencies>true</useTransitiveDependencies>
      <useTransitiveFiltering>true</useTransitiveFiltering>
      <outputDirectory>lib</outputDirectory>
      <includes>
        <include>Gottware:common</include>
      </includes>
    </dependencySet>
  </dependencySets>
</assembly>


Why are there two dependencySet? Is because there are two format?

How can I make all the dependencies from all the module get included in the resulting jar?

Best Regards
Edmondo Porcu
Associate - Financial  software architect



Avenue de Rhodanie 48
1007 Lausanne
Switzerland.

Dir  +41 (0) 21  560 30 82
Fax +41 (0) 21  617 71 55
Email : edmondo.porcu@gottexbrokers.com

The information in this email is confidential and may be legally privileged. If you are not the intended recipient, you must not read, use or disseminate the information. Although this email and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by the Gottex Group of Companies for any loss or damage arising in any way from its use.



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