Refactor fatjar (#6)

This commit is contained in:
James Agnew 2019-02-04 07:53:46 -05:00 committed by GitHub
parent cef1965346
commit bf8a7aa3d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 14 deletions

View File

@ -512,12 +512,12 @@ public class Element extends Base {
@SuppressWarnings("unchecked")
List<ElementDecoration> decorations = (List<ElementDecoration>) getUserData("fhir.decorations");
if (decorations == null) {
decorations = new ArrayList<ElementDecoration>();
decorations = new ArrayList<>();
setUserData("fhir.decorations", decorations);
}
decorations.add(new ElementDecoration(DecorationType.TYPE, profile.getUserString("path"), definition.getPath()));
if (tail(definition.getId()).contains(":")) {
String[] details = tail(definition.getId()).split("\\:");
if (definition.getId() != null && tail(definition.getId()).contains(":")) {
String[] details = tail(definition.getId()).split(":");
decorations.add(new ElementDecoration(DecorationType.SLICE, null, details[1]));
}
}

View File

@ -55,28 +55,63 @@
<build>
<plugins>
<!--
Build a fatjar containing all depenedncies
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<id>unpack-dependencies</id>
<phase>process-classes</phase>
<goals>
<goal>shade</goal>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<shadedClassifierName/>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.hl7.fhir.r4.validation.Validator</mainClass>
</transformer>
</transformers>
<shadedArtifactAttached>true</shadedArtifactAttached>
<excludes>**/module-info.class</excludes>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<excludeScope>test</excludeScope>
<includeScope>compile</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>org.hl7.fhir.r4.validation.Validator</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<!--
These two plugins provide quality checks that don't make sense to perform
on a fatjar.
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.basepom.maven</groupId>
<artifactId>duplicate-finder-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>