maven打包排除配置⽂件如果你想通过l⽂件的配置实现的话,你可以这样
1、打jar包时过滤配置⽂件
<build>
<!-- 过滤配置⽂件 -->
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>**/*</exclude>
</excludes>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
..............
</plugins>
<build>
2、在plugins中添加插件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<outputDirectory>
${project.build.directory}
</outputDirectory> <!-- 表⽰把配置⽂件拷到和jar包同⼀个路径下 -->
<resources>
<resource>
<directory>src/main/resources/</directory>
</resource>
</resources>
maven打包本地jar包</configuration>
</execution>
</executions>
</plugin>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论