springboot打war包的pom.xml

tech2025-01-14  5

springboot打war包的pom.xml(打出war包使用的tomcat 9的,低版本可能不行)

<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.3.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.baizhi</groupId> <artifactId>tour-boot</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <name>tour-boot</name> <description>Demo project for Spring Boot</description> <properties> <java.version>1.8</java.version> <druid-version>1.0.16</druid-version> <!--声明使用框架的版本号,相当于一个常量--> <spring-version>5.2.5.RELEASE</spring-version> <mybatis-spring-version>1.3.0</mybatis-spring-version> <log4j.version>1.2.17</log4j.version> <slf4j.version>1.7.25</slf4j.version> <jackson-version>2.9.8</jackson-version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <!--排除springboot内部集成的tomcat--> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> <!-- &lt;!&ndash;打包时排除tomcat-不打包不能去掉否则不显示&ndash;&gt;--> <!-- <dependency>--> <!-- <groupId>org.springframework.boot</groupId>--> <!-- <artifactId>spring-boot-starter-tomcat</artifactId>--> <!-- <scope>provided</scope>--> <!-- </dependency>--> <!-- <dependency>--> <!-- <groupId>org.apache.tomcat.embed</groupId>--> <!-- <artifactId>tomcat-embed-jasper</artifactId>--> <!-- </dependency>--> <!--jstl--> <dependency> <groupId>jstl</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> <!--springboot测试--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <exclusions> <exclusion> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> </exclusion> </exclusions> </dependency> <!--引入servlet的依赖--> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> <scope>provided</scope> </dependency> <!--引入整合jsp--> <dependency> <groupId>jstl</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> <!--引入mybatis整合的依赖--> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.3.3</version> </dependency> <!--引入阿里的数据源 druid--> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>${druid-version}</version> <scope>compile</scope> </dependency> <!--oracle--> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>12.1.0.1-atlassian-hosted</version> </dependency> <!--lombok--> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.12</version> <scope>provided</scope> </dependency> <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> </dependency> <!--引入AOP开发依赖--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>7.3.0</version> <scope>test</scope> </dependency> </dependencies> <build> <finalName>Tour</finalName> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>1.4.2.RELEASE</version> <!--设置启动类(假如有多个情况)--> <configuration> <mainClass>com.baizhi.TourBootApplication</mainClass> </configuration> </plugin> <!-- <plugin>--> <!-- <groupId>org.apache.maven.plugins</groupId>--> <!-- <artifactId>maven-compiler-plugin</artifactId>--> <!-- <configuration>--> <!-- <fork>true</fork>--> <!-- <source>1.6</source>--> <!-- <target>1.6</target>--> <!-- </configuration>--> <!-- </plugin>--> </plugins> <!--扫描资源--> <!-- <resources>--> <!-- <resource>--> <!-- <directory>src/main/webapp</directory>--> <!-- <targetPath>META-INF/resources</targetPath>--> <!-- <includes>--> <!-- <include>**/**</include>--> <!-- </includes>--> <!-- </resource>--> <!-- <resource>--> <!-- <directory>src/main/java</directory>--> <!-- <includes>--> <!-- <include>**/*.yml</include>--> <!-- <include>**/*.properties</include>--> <!-- <include>**/*.xml</include>--> <!-- </includes>--> <!-- <filtering>false</filtering>--> <!-- </resource>--> <!-- <resource>--> <!-- <directory>src/main/resources</directory>--> <!-- <includes>--> <!-- <include>**/*.yml</include>--> <!-- <include>**/*.properties</include>--> <!-- <include>**/*.xml</include>--> <!-- </includes>--> <!-- <filtering>false</filtering>--> <!-- </resource>--> <!-- </resources>--> </build> </project>
最新回复(0)