Update pom to build package with minimal dependencies

This commit is contained in:
Joel Therrien 2019-06-27 15:34:09 -07:00
parent 22accdb263
commit 78ca8bad73
2 changed files with 39 additions and 37 deletions

1
.gitignore vendored
View file

@ -5,3 +5,4 @@ target/
*.iml *.iml
.idea .idea
template.yaml template.yaml
dependency-reduced-pom.xml

75
pom.xml
View file

@ -70,49 +70,50 @@
<build> <build>
<plugins> <plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>ca.joeltherrien.randomforest.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>3.11.0</version>
<executions> <executions>
<execution> <execution>
<phase>package</phase> <!-- bind to the packaging phase --> <phase>package</phase>
<goals> <goals>
<goal>check</goal> <goal>shade</goal>
</goals> </goals>
</execution> <configuration>
</executions> <transformers>
<configuration> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<rulesets> <mainClass>
<!-- Custom local file system rule set --> ca.joeltherrien.randomforest.Main
<ruleset>${project.basedir}/pmd-rules.xml</ruleset> </mainClass>
</rulesets> </transformer>
</configuration> </transformers>
</plugin> <minimizeJar>true</minimizeJar>
</plugins> </configuration>
</build> </execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.11.0</version>
<executions>
<execution>
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<rulesets>
<!-- Custom local file system rule set -->
<ruleset>${project.basedir}/pmd-rules.xml</ruleset>
</rulesets>
</configuration>
</plugin>
</plugins>
</build>
</project> </project>