maven打包排除排除指定⽂件(war,jar)war包排除⽂件
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.source.version}</source>
<target>${java.target.version}</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<warName>${project.build.finalName}</warName>
<excludes>
js/plugins/*.*
</excludes>
<packagingExcludes>
WEB-INF/classes/jdbc.properties,
WEB-INF/classes/redis.properties,
WEB-INF/classes/system.properties
</packagingExcludes>
</configuration>
</plugin>
<plugins>
</build>
可运⾏jar包,maven-shade-plugin插件
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.source.ManifestResourceTransformer">        <mainClass>com.ansform.main.EntryMain</mainClass>
</transformer>
<transformer implementation="org.apache.maven.source.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer implementation="org.apache.maven.source.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>jdbc.properties</exclude>
<exclude>system.properties</exclude>
</excludes>
</filter>
</filters>
maven打包本地jar包</configuration>
</plugin>
<plugins>
</build>

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。