您的位置:首页 > 其它

Maven打包例子

2016-06-12 00:00 274 查看
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF8</encoding>
<compilerArguments>
<!--   引用本地jar-->
<extdirs>${basedir}/WebRoot/WEB-INF/lib</extdirs>
</compilerArguments>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<!--  打包war要添加web.xml-->
<webXml>${basedir}/WebRoot/WEB-INF/web.xml</webXml>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
<warName>book</warName>
<webResources>
<resource>
<directory>src/main/resources</directory>
<targetPath>WEB-INF/classes</targetPath>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
<!--引用依赖jar-->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息