第一:

1,如果是resources目录下文件profile参数中动态打入,在pom.xml中的build标签中加入如下配置:

<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering><!-- 非常重要,表示是否动态打入参数 -->
<includes>
  <include>**/*.*</include><!--表示 resources目录下的多级路径 -->
  </includes>
</resource>
</resources>
2,如果想将打入参数的文件换个路径放置,则需要引入下面插件:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources1</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
          <!-- 系统参数${project.build.directory},可以直接使用 -->
<outputDirectory>${project.build.directory}/build/conf</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}/classes</directory>
              <!-- 下面三个是resources路径下的三个文件夹,最终将其放到${project.build.directory}/build/conf下了-->
<include>mybatis</include>
<include>prop</include>
<include>spring</include>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin> 第二:
如果要动态打入参数的文件不在resources下,只需要加入如下插件就可以了
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions> <execution>
<id>copy-resources2</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/build/bin</outputDirectory>
<resources>
<resource>
              <!-- 下面的bin是项目的跟路径下有个bin文件夹 -->
<directory>bin</directory>
<include>start.sh</include>
<include>stop.sh</include>
<filtering>true</filtering><!-- 这个参数非常重要,必须是true,否则无法动态打入参数-->
</resource>
</resources>
</configuration>
</execution> </executions>
</plugin>

最新文章

  1. Shell教程
  2. 前端知识杂烩(Javascript篇)
  3. 用java开发微信公众号:测试公众号与本地测试环境搭建(一)
  4. sap 常用表
  5. HTML5 LocalStorage 本地存储,刷新值还在
  6. 文件操作 fopen() fclose()
  7. Linux之图形化shell------dialog
  8. Mac下安装zshell
  9. React-Native(三):React Native是基于React设计的
  10. zabbix企业级监控dell硬件服务状态
  11. python 0228
  12. 通过DBMS_REDEFINITION包对表在线重定义
  13. JavaBasic_03
  14. kafka_2.11-0.10.0.1生产者producer的Java实现
  15. swift4.2 打印devicetoken
  16. mysql 筛选重复项(单列或者多列同时重复)
  17. 完成向后台添加用户的ssm项目,完整版
  18. POJ1325机器重启次数——二分图匈牙利算法模板
  19. 杂项:Unity3D
  20. js小练习

热门文章

  1. Android学习总结——SQLite
  2. cocos2d-x-2.2.5项目创建--命令行创建
  3. 使用Jquery UI 高仿百度搜索下拉列表功能
  4. js 创建html元素 渲染html元素
  5. SqlServer判断数据库、表、存储过程、函数是否存在
  6. SFTP CONFIGURATION IN FLASHFXP PROGRAM
  7. react学习之props
  8. Spring-----4、使用Spring容器
  9. java poi 导出excel
  10. Fragment之一:Fragment入门