2009/7/21 Thomas Scheffler <[email protected]>

> Hi,
>
> I am using the maven-dependency-plugin to build a big jar file out of
> direct
> dependencies (code below). If that big jar file is a dependency of another
> project all direct dependencies are also copied over. I just want to copy
> the
> transitive dependencies of the big jar file.
>
> I tried to mark the dependencies of the big jar file with scope "provided"
> but
> then also the transitive dependency got marked as "provided".
>
> I am at wits' end now. Can the big jar file mark direct dependencies as
> "provided" but copy the dependencies of it as its own dependencies somehow?
>
> regards
>
> Thomas
>
> <plugin>
>  <artifactId>maven-dependency-plugin</artifactId>
>  <executions>
>    <execution>
>      <id>unpack-dependencies</id>
>      <phase>process-resources</phase>
>      <goals>
>        <goal>unpack-dependencies</goal>
>      </goals>
>      <configuration>
>
>  <outputDirectory>${project.build.directory}/classes</outputDirectory>
>        <excludeTransitive>true</excludeTransitive>
>        <excludes>
>          LICENSE*, NOTICE*, META-INF/LICENSE*, META-INF/NOTICE*,
>          license, license/**/*, test, test/**/*,
>          WEB-INF/web.xml,
>          WEB-INF/log4j.*,
>          WEB-INF/lib, WEB-INF/lib/**/*,
>          WEB-INF/classes, WEB-INF/classes/**/*
>        </excludes>
>      </configuration>
>    </execution>
>  </executions>
> </plugin>
>
>
So you have, e.g.,
M --> (A, B)
A --> { D }
B --> { E }

and you want
jar(A, B) --> { D, E }

How do jar files express dependencies? Are you trying to create a project
which then doesn't need to download any more subprojects?

You could also use the assembly plugin to generate the jar file; you can
then specify which modules to include. Maybe you could also manually copy
dependencies from A and B to M?

regards,
Nicholas
https://ntung.com

Reply via email to