Atitit maven配置pom文件 配置法v2 t33
目录
1.1. 在target目录生成war包ori目录。。。里面就是所有的资源 1
1.2. 去掉全部jar,使用eclipse本地库,因为maven库update prj有问题 2
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ttadmingroupId</groupId>
<artifactId>tt-admin</artifactId>
<name>tt-admin</name>
<version>1.1</version>
<packaging>war</packaging>
<!-- <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version> </parent> -->
<!--</profile></profiles> -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<shiro.version>1.4.0</shiro.version>
<kaptcha.version>2.3.2</kaptcha.version>
<ehcache.version>3.3.1</ehcache.version>
<beetl.version>2.9.3</beetl.version>
<swagger.version>2.9.1</swagger.version>
<ehcache.core.version>2.6.11</ehcache.core.version>
<mysql-connector-java.version>8.0.11</mysql-connector-java.version>
<jwt.version>0.9.0</jwt.version>
</properties>
<dependencies>
</dependencies>
<build>
<!-- war filename -->
<finalName>admin</finalName>
<!-- war position def positon is : <directory>0warout\adminWarOut</directory> -->
<!-- eclipse out class dir is tt-admin/target/classes -->
<sourceDirectory>srcnone</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<delimiters>
<delimiter>@</delimiter>
</delimiters>
<useDefaultDelimiters>false</useDefaultDelimiters>
</configuration>
<!-- copy res -->
<executions>
<execution>
<id>copy-resources3_copy_generated-sources_annotations</id>
<!-- here the phase you need -->
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/generated-sources/annotations</outputDirectory>
<resources>
<resource>
<directory>${basedir}/srcnone</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-resources_copyLibs</id>
<!-- here the phase you need -->
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/admin/WEB-INF/lib</outputDirectory>
<resources>
<resource>
<directory>lib</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<!--如果想在没有web.xml文件的情况下构建WAR,请设置为false。 -->
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork><!-- 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart -->
</configuration>
</plugin>
</plugins>
<resources>
<!--
<resource>
<directory>src/main/webapp</directory>
</resource>
-->
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>local</id>
<properties>
<spring.active>local</spring.active>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>dev</id>
<properties>
<spring.active>dev</spring.active>
</properties>
</profile>
<profile>
<id>test</id>
<properties>
<spring.active>test</spring.active>
</properties>
</profile>
<profile>
<id>produce</id>
<properties>
<spring.active>produce</spring.active>
</properties>
</profile>
</profiles>
</project>
Ref
Atitit maven 编译与资源文件与web目录自定义配置 与eclipse的集成与war包打包