|
5 | 5 |
|
6 | 6 | <groupId>org.ohdsi</groupId> |
7 | 7 | <artifactId>WebAPI</artifactId> |
8 | | - <packaging>war</packaging> |
| 8 | + <packaging>${packaging.type}</packaging> |
9 | 9 | <version>3.0.0-SNAPSHOT</version> |
10 | 10 | <name>WebAPI</name> |
11 | 11 | <properties> |
| 12 | + <packaging.type>war</packaging.type> |
12 | 13 | <build.number>${BUILD_NUMBER}</build.number> |
13 | 14 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
14 | 15 | <!-- Spring Boot manages spring.version as well --> |
|
416 | 417 | <groupId>org.springframework.boot</groupId> |
417 | 418 | <artifactId>spring-boot-maven-plugin</artifactId> |
418 | 419 | <version>${spring.boot.version}</version> |
419 | | - <!-- executable-war via 'java -jar WebAPI-exec.war' currently fails with Jersey FileNotFound exception. TODO --> |
420 | 420 | <configuration> |
421 | 421 | <!-- Since we filter properties files via Maven, do not add resources. --> |
422 | 422 | <addResources>false</addResources> |
|
476 | 476 | </compilerArgs> |
477 | 477 | </configuration> |
478 | 478 | </plugin> |
479 | | - <plugin> |
480 | | - <groupId>org.apache.maven.plugins</groupId> |
481 | | - <artifactId>maven-war-plugin</artifactId> |
482 | | - <version>3.4.0</version> |
483 | | - <configuration> |
484 | | - <failOnMissingWebXml>false</failOnMissingWebXml> |
485 | | - <attachClasses>true</attachClasses> |
486 | | - </configuration> |
487 | | - </plugin> |
488 | 479 | <plugin> |
489 | 480 | <groupId>org.apache.maven.plugins</groupId> |
490 | 481 | <artifactId>maven-failsafe-plugin</artifactId> |
|
689 | 680 | <dependency> |
690 | 681 | <groupId>org.springframework.boot</groupId> |
691 | 682 | <artifactId>spring-boot-starter-tomcat</artifactId> |
692 | | - <scope>provided</scope> |
693 | 683 | </dependency> |
694 | 684 | <dependency> |
695 | 685 | <groupId>org.springframework.boot</groupId> |
696 | 686 | <artifactId>spring-boot-starter-batch</artifactId> |
697 | 687 | </dependency> |
698 | 688 |
|
699 | | - <!-- We are intentionally overriding the Tomcat version from Spring Boot 1.5.22.RELEASE --> |
700 | | - <!-- and assuming tomcat-jdbc.jar will be in the Tomcat installation folder (\apache-tomcat-8.5.xxx\lib). --> |
701 | | - <!-- WebAPI.war.original should not contain overridden libraries --> |
| 689 | + <!-- Embedded Tomcat dependencies for executable JAR --> |
| 690 | + <!-- Note: WAR packaging is available via 'mvn package -Pwar' profile --> |
702 | 691 | <dependency> |
703 | 692 | <groupId>org.apache.tomcat.embed</groupId> |
704 | 693 | <artifactId>tomcat-embed-el</artifactId> |
|
711 | 700 | <dependency> |
712 | 701 | <groupId>org.apache.tomcat</groupId> |
713 | 702 | <artifactId>tomcat-jdbc</artifactId> |
714 | | - <scope>provided</scope> |
715 | 703 | </dependency> |
716 | 704 | <dependency> |
717 | 705 | <groupId>org.apache.tomcat</groupId> |
|
779 | 767 | </exclusion> |
780 | 768 | </exclusions> |
781 | 769 | </dependency> --> |
| 770 | + <!-- javax.servlet-api is now provided by spring-boot-starter-tomcat (Jakarta Servlet API) --> |
| 771 | + <!-- This old javax.servlet dependency can be removed for JAR packaging --> |
| 772 | + <!-- |
782 | 773 | <dependency> |
783 | 774 | <groupId>javax.servlet</groupId> |
784 | 775 | <artifactId>javax.servlet-api</artifactId> |
785 | 776 | <version>3.1.0</version> |
786 | | - <scope>provided</scope> |
787 | 777 | </dependency> |
| 778 | + --> |
788 | 779 | <dependency> |
789 | 780 | <groupId>javax.cache</groupId> |
790 | 781 | <artifactId>cache-api</artifactId> |
|
1902 | 1893 | </dependency> |
1903 | 1894 | </dependencies> |
1904 | 1895 | </profile> |
| 1896 | + |
| 1897 | + <!-- WAR packaging profile - use with: mvn package -Pwar --> |
| 1898 | + <profile> |
| 1899 | + <id>war</id> |
| 1900 | + <properties> |
| 1901 | + <packaging.type>war</packaging.type> |
| 1902 | + </properties> |
| 1903 | + <dependencies> |
| 1904 | + <!-- Mark embedded Tomcat as provided for external servlet container deployment --> |
| 1905 | + <dependency> |
| 1906 | + <groupId>org.springframework.boot</groupId> |
| 1907 | + <artifactId>spring-boot-starter-tomcat</artifactId> |
| 1908 | + <scope>provided</scope> |
| 1909 | + </dependency> |
| 1910 | + <dependency> |
| 1911 | + <groupId>org.apache.tomcat</groupId> |
| 1912 | + <artifactId>tomcat-jdbc</artifactId> |
| 1913 | + <scope>provided</scope> |
| 1914 | + </dependency> |
| 1915 | + </dependencies> |
| 1916 | + <build> |
| 1917 | + <plugins> |
| 1918 | + <plugin> |
| 1919 | + <groupId>org.apache.maven.plugins</groupId> |
| 1920 | + <artifactId>maven-war-plugin</artifactId> |
| 1921 | + <version>3.4.0</version> |
| 1922 | + <executions> |
| 1923 | + <execution> |
| 1924 | + <id>build-war</id> |
| 1925 | + <phase>package</phase> |
| 1926 | + <goals> |
| 1927 | + <goal>war</goal> |
| 1928 | + </goals> |
| 1929 | + <configuration> |
| 1930 | + <failOnMissingWebXml>false</failOnMissingWebXml> |
| 1931 | + <attachClasses>true</attachClasses> |
| 1932 | + <warName>WebAPI</warName> |
| 1933 | + </configuration> |
| 1934 | + </execution> |
| 1935 | + </executions> |
| 1936 | + </plugin> |
| 1937 | + </plugins> |
| 1938 | + </build> |
| 1939 | + </profile> |
1905 | 1940 | </profiles> |
1906 | 1941 | </project> |
0 commit comments