打包配置
<profiles>
<profile>
<id>local</id>
<properties>
<log4j.logfile.path>d:/tmp/logs/gg.log</log4j.logfile.path>
<log4j.log.level>INFO</log4j.log.level>
<system.test>false</system.test>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>server</id>
<properties>
<log4j.log.level>INFO</log4j.log.level>
<log4j.logfile.path>/root/logs/gg.log</log4j.logfile.path>
<system.test>false</system.test>
</properties>
</profile>
</profiles>
<build>
<finalName>interface</finalName>
<resources>
<!-- 先指定 src/main/resources下所有文件及文件夹为资源文件 -->
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<!--打包插件-->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
<warName>web-demo</warName>
<webResources>
<resource>
<directory>src/main/resources</directory>
<targetPath>WEB-INF/classes</targetPath>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
<!-- 这个配置应该是把哪些位置的资源 打包(复制) 到指定位置 -->
<!--
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/projectName/WEB-INF/classes
</outputDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
-->
<!-- 这个配置应该是把指定资源打进war包 Eclipse -->
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>src/main/resources</directory>
<targetPath>WEB-INF/classes/</targetPath>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/webapp</directory>
<includes>
<include>**/web.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
-->
<!-- 生成javadoc文档包的插件 -->
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<configuration>
<show>private</show>
<nohelp>true</nohelp>
<aggregate>true</aggregate>
<charset>UTF-8</charset>
<encoding>UTF-8</encoding>
<docencoding>UTF-8</docencoding>
<tags>
<tag>
<name>description</name>
<placement>a</placement>
<head>description</head>
</tag>
</tags>
<bottom>
<![CDATA[copy right 2017 <a href="https://my.oschina.net/medvin">yuwan</a>]]></bottom>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
生成sources源码包的插件
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<configuration>
<attach>true</attach>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
-->
<!--把所有子模块的resources里面的东西复制到指定目录-->
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>process-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/classes/sql-mappers</outputDirectory>
<resources>
<resource>
<directory>../service/src/main/resources</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
-->
</plugins>
</build>