On 2015-12-01T17:56:15 +0000
<[email protected]> wrote:
>
> On 2015-12-01T10:45:16 -0600
> Curtis Rueden <[email protected]> wrote:
> > Why not just make your single-module library artifact an "uber-JAR"
> > consisting
> > only of its own sources plus the relocated+minimized fastutil classes,
> > using
> > <minimizeJar>true</minimizeJar>?
>
> The project is actually a multi-module project, with several modules
> requiring access to the fastutil classes. My main concern is how well
> IDEs will be able to cope with this...
The answer turend out to be "very poorly", so I've gone with your
original suggestion:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>true</minimizeJar>
<artifactSet>
<includes>
<include>it.unimi.dsi:fastutil</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>it.unimi.dsi</pattern>
<shadedPattern>com.io7m.jcanephora.jogl.fastutil</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
This replaces the default jar produced by the project with one that
contains only the required classes, and moves them into their own
package to prevent later conflicts. The it.unimi.dsi:fastutil artifact
is made 'optional' - I tried to use a 'provided' scope, but for some
reason this prevented the shade plugin from seeing the dependency
at all, even with the 'keepDependenciesWithProvidedScope' flag enabled.
M
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]