maven-webapp项目pom.xml配置
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了maven-webapp项目pom.xml配置相关的知识,希望对你有一定的参考价值。
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.fz</groupId>
<artifactId>oa</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>oa Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<java-version>1.7</java-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies></dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<!--默认的主代码目录-->
<sourceDirectory>src/main/java</sourceDirectory>
<!--默认的测试代码目录-->
<testSourceDirectory>src/test/java</testSourceDirectory>
<!--处理无法加载资源配置文件-->
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<--编译插件compiler配置-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<!--tomcat插件-->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<!--tomcat管理路径-->
<url>http://localhost:80/manager/text</url>
<!--与settings.xml文件中Server的id相同-->
<server>tomcat7</server>
<uriEncoding>utf-8</uriEncoding>
<port>80</port><!--服务器端口号80可以省略-->
<path>/</path><!--应用的部署位置-->
<contextReloadable>true</contextReloadable>
<systemProperties>
<java.util.logging.SimpleFormatter.format>[%4$s] %1$tF %1$tT %3$s %5$s %n</java.util.logging.SimpleFormatter.format>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
</project>
以上是关于maven-webapp项目pom.xml配置的主要内容,如果未能解决你的问题,请参考以下文章