diff options
author | Francis Gagné <fragag1@gmail.com> | 2015-02-17 22:47:01 -0500 |
---|---|---|
committer | Francis Gagné <fragag1@gmail.com> | 2015-02-17 22:47:01 -0500 |
commit | 0fc13dcea43312ef47fe63c4d4213269d8aeafcd (patch) | |
tree | eed974183f5ac0f2d09f3355f864d0bf5f58e0d8 | |
parent | 26c2d480e3f4f03fe5b04f47688273f20d8c6c00 (diff) |
Use the Maven Shade plugin
Use the Maven Shade plugin to build an uber-jar instead of the Maven
Assembly plugin's jar-with-dependencies. The main reason for switching
is that we must merge the services resource files (specifically,
META-INF/resources/org.reasm.ArchitectureProvider, which is now provided
by both reasm-m68k and reasm-z80).
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | pom.xml | 45 |
2 files changed, 31 insertions, 15 deletions
@@ -1 +1,2 @@ /target/ +/dependency-reduced-pom.xml @@ -38,27 +38,42 @@ </plugin> <plugin> - <artifactId>maven-assembly-plugin</artifactId> - <version>2.4.1</version> + <artifactId>maven-shade-plugin</artifactId> + <version>2.3</version> <configuration> - <archive> - <manifest> - <mainClass>org.reasm.batch.Assembler</mainClass> - </manifest> - </archive> - <descriptorRefs> - <descriptorRef>jar-with-dependencies</descriptorRef> - </descriptorRefs> - </configuration> + <artifactSet> + <excludes> + <exclude>junit:*</exclude> + <exclude>org.hamcrest:*</exclude> + </excludes> + </artifactSet> + + <!-- minimizeJar doesn't work too well for us, --> + <!-- because the language-specific assemblers are not referenced statically --> + <!-- (they're loaded with ServiceLoader). --> + <!-- We can specify classes to include explicitly, --> + <!-- but then the classes that they reference will be discarded --> + <!-- if they're not used statically by reasm-batch. --> + <!-- <minimizeJar>true</minimizeJar> --> + + <transformers> + <!-- Prevent duplication of licenses in META-INF --> + <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" /> - <!-- Generate an assembly during the package phase --> - <!-- http://stackoverflow.com/a/14276860/234590 --> + <!-- Merge META-INF/NOTICE* files --> + <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer"> + <addHeader>false</addHeader> + </transformer> + + <!-- Merge services resources (META-INF/services/*). --> + <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> + </transformers> + </configuration> <executions> <execution> - <id>assembly</id> <phase>package</phase> <goals> - <goal>single</goal> + <goal>shade</goal> </goals> </execution> </executions> |