Hello,
Just tried the shade plugin and it works like charm ! Here's what you do...
1. Remove the assembly plugin section from your pom.xml
2. Add the following section for the shade plugin (edit main class for
your app) to the plugins section of your pom:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<!-- This bit sets the main class for the
executable jar as you otherwise -->
<!-- would with the assembly plugin
-->
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<!-- EDIT for your app -->
<Main-Class>org.geotools.demo.Quickstart</Main-Class>
</manifestEntries>
</transformer>
<!-- This bit merges the various GeoTools
META-INF/services files -->
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
3. Do mvn clean install (ie. no need to do a separate step like
'assembly:assembly')
I'll add this as a note to the Quickstart page:
http://geotools.org/quickstart.html
(have to get round to doing an FAQ page too).
Please let the list know if this works for you.
Michael
PS. Here is the full pom that I used to build the Quickstart as an
executable jar...
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.geotools.demo</groupId>
<artifactId>example-standalone</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<name>example-standalone</name>
<url>http://maven.apache.org</url>
<properties>
<geotools.version>2.6.2</geotools.version>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<encoding>UTF-8</encoding>
<target>1.5</target>
<source>1.5</source>
</configuration>
</plugin>
<!-- plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>org.geotools.demo.Quickstart</mainClass>
</manifest>
</archive>
</configuration>
</plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<!-- This bit sets the main class for
the executable jar as you otherwise -->
<!-- would with the assembly plugin
-->
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>org.geotools.demo.Quickstart</Main-Class>
</manifestEntries>
</transformer>
<!-- This bit merges the various
GeoTools META-INF/services files -->
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-shapefile</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-epsg-hsql</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-swing</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users