Added profiles

This commit is contained in:
jvi
2020-09-07 22:00:54 +02:00
parent 0fd6409bc3
commit 8894711d8e
6 changed files with 57 additions and 77 deletions

104
pom.xml
View File

@@ -3,7 +3,6 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- mvn clean package spring-boot:repackage && java -jar target/hapi-fhir-jpaserver.war -->
<!--
Note: HAPI projects use the "hapi-fhir" POM as their base to provide easy management.
You do not need to use this in your own projects, so the "parent" tag and it's
@@ -19,10 +18,8 @@
<artifactId>hapi-fhir-jpaserver-starter</artifactId>
<properties>
<java.version>11</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<jetty_version>9.4.31.v20200723</jetty_version>
<java.version>8</java.version>
<spring.boot>2.3.3.RELEASE</spring.boot>
</properties>
<prerequisites>
@@ -77,12 +74,6 @@
</exclusion>
</exclusions>
</dependency>
<!--
<dependency>
<groupId>javax.mail</groupId>
<artifactId>javax.mail-api</artifactId>
</dependency>
-->
<!-- This dependency includes the core HAPI-FHIR classes -->
<dependency>
@@ -248,18 +239,7 @@
<artifactId>jetty-webapp</artifactId>
<scope>test</scope>
</dependency>
<!--
<dependency>
<groupId>com.helger</groupId>
<artifactId>ph-schematron</artifactId>
<exclusions>
<exclusion>
<artifactId>Saxon-HE</artifactId>
<groupId>net.sf.saxon</groupId>
</exclusion>
</exclusions>
</dependency>
-->
<!--
For some reason JavaDoc crashed during site generation unless we have this dependency
@@ -284,35 +264,10 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.3.3.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
<version>2.3.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>2.3.3.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-logging -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
<version>2.3.3.RELEASE</version>
<scope>test</scope>
<version>${spring.boot}</version>
</dependency>
@@ -347,6 +302,7 @@
</executions>
</plugin>
<!-- The following is not required for the application to build, but allows you to test it by issuing "mvn package jetty:run -Dspring.batch.job.enabled=false" from the command line. -->
<!--
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
@@ -358,6 +314,7 @@
</webApp>
</configuration>
</plugin>
-->
<!-- Tell Maven which Java source version you want to use -->
<plugin>
@@ -365,7 +322,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>11</release>
<release>8</release>
</configuration>
</plugin>
@@ -385,10 +342,7 @@
<artifactId>hapi-fhir-testpage-overlay</artifactId>
</overlay>
</overlays>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
@@ -503,9 +457,49 @@
</ignoredResourcePatterns>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<!-- Package the war for your preference. Use the boot profile if you prefer a single jar/war
that can be started with and embedded application server. Default is jetty as it is assumed
that the main users of this project already have an app server.
Different profiles are needed as packing it for spring boot, makes the resulting war undeployable
due to a class shading issue between tomcat and jetty.
(the error is 'java.util.ServiceConfigurationError: org.apache.juli.logging.Log: org.eclipse.jetty.apache.jsp.JuliLog not a subtype')
-->
<!-- example of how to start the server using spring boot-->
<!-- mvn clean package spring-boot:repackage -Pboot && java -jar target/hapi-fhir-jpaserver.war -->
<profile>
<id>boot</id>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.3.3.RELEASE</version>
</dependency>
</dependencies>
</profile>
<!-- examples of how to start the server using the default profile-->
<!-- mvn clean package jetty:run -Dspring.batch.job.enabled=false -->
<!-- java -jar -Dspring.batch.job.enabled=false jetty-runner.jar target/hapi-fhir-jpaserver.war -->
<profile>
<id>jetty</id>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.3.3.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</profile>
</profiles>
</project>