maven打包处理自定义目录
<build>
<finalName>vertical-search</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
</plugin>
<plugin>
<!-- ${project.build.directory} -->
<!-- 参考API http://ant.apache.org/manual/tasksoverview.html -->
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- 打包之前-->
<execution>
<phase>prepare-package</phase>
<id>prepare-package</id>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<!-- 删除原来配置文件夹 -->
<delete includeemptydirs="true" quiet="true">
<fileset dir="${project.build.directory}/${project.build.finalName}/WEB-INF/conf/" defaultexcludes="true" />
</delete>
<!-- 拷贝新的配置文件夹 -->
<copy todir="${project.build.directory}/${project.build.finalName}/WEB-INF/conf">
<fileset dir="${app_config_path}" />
</copy>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>dev</id>
<properties>
<app_config_path>src/main/conf/dev</app_config_path>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>test</id>
<properties>
<app_config_path>src/main/conf/test</app_config_path>
</properties>
</profile>
<profile>
<id>online</id>
<properties>
<app_config_path>src/main/conf/online</app_config_path>
</properties>
</profile>
</profiles>
上一篇: 教你辣炒素菜怎么做好吃
下一篇: 紫薯的好处你知道多少
推荐阅读
-
SpringBoot工程中导入本地自定义Jar包——通过Maven打包导包(超详细)
-
Maven项src/main/java目录下配置文件无法被导出或者生效的问题和处理方案
-
maven打包处理自定义目录
-
maven springboot如何将jar包打包到指定目录
-
使用了自定义的模块的Maven项目打包报错找不到jar包
-
初学maven(5)-使用assembly plugin实现自定义打包
-
Maven项src/main/java目录下配置文件无法被导出或者生效的问题和处理方案
-
Maven项src/main/java目录下配置文件无法被导出或者生效的问题和处理方案
-
maven springboot如何将jar包打包到指定目录