使用autoconfig
2024-09-16 12:14:50
1. 增加maven 依赖
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<mockito-all.version>1.10.19</mockito-all.version>
<spring-boot.version>1.5.9.RELEASE</spring-boot.version>
<maven-antrun.version>1.8</maven-antrun.version>
<pandora-boot.version>-release</pandora-boot.version>
<pandora-boot-maven-plugin.version>xxx</pandora-boot-maven-plugin.version>
<autoconfig-maven-plugin.version>1.2-fixcompress-SNAPSHOT</autoconfig-maven-plugin.version>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun.version}</version>
</plugin>
<plugin>
<groupId>com.taobao.pandora</groupId>
<artifactId>pandora-boot-maven-plugin</artifactId>
<version>${pandora-boot-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>com.alibaba.citrus.tool</groupId>
<artifactId>autoconfig-maven-plugin</artifactId>
<version>${autoconfig-maven-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<build>
<plugins>
<plugin>
<groupId>com.taobao.pandora</groupId>
<artifactId>pandora-boot-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>repackage</goal>
</goals> </execution>
</executions>
</plugin>
<plugin>
<groupId>com.alibaba.citrus.tool</groupId>
<artifactId>autoconfig-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>autoconfig</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- 解压fat jar到target/${project-name}目录 -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<configuration>
<tasks>
<unzip
src="${project.build.directory}/${project.build.finalName}.${project.packaging}"
dest="${project.build.directory}/abc" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
auto-config.xml 内容
<?xml version="1.0" encoding="UTF-8"?>
<config>
<group name="default">
<property name="spring.profiles.active" defaultValue="local" description="config env"/>
</group>
<script>
<generate template="application.properties"/>
</script>
</config>
application.properties 内容
project.name=sdfs
spring.profiles.active=${spring.profiles.active}
-Dautoconfig.userProperties=/abc/def/antx.properties
最新文章
- jQuery中的$.grep()方法的使用
- UVA 820 --- POJ 1273 最大流
- Js的引用关系示例和总结
- vba 工作案例-sheet间拷贝内容
- DevExpress中的ASPxTreeView 递归显示checknodes并获得选中值
- Nokia 的 Scrum标准
- js和jQuery 获取屏幕高度、宽度
- 动态创建MySQL数据库
- 数据库(学习整理)----4--Oracle数据查询(基础点1)
- DOCKER功能练习
- 在Eclipse如何实现在xml文件实现代码提示
- 搭建微信小程序的本地测试服务器 json-server
- mac下git安装与使用
- 骨灰级玩家体验带你测试体验天使纪元OL折扣端
- JVM运行时数据区域
- Git回滚代码到某个commit
- AngularJS中转换响应内容
- http_range说明
- 【转】IE浏览器CSS BUG集锦
- Python学习--Selenium模块
热门文章
- hdu 1847 博弈基础题 SG函数 或者规律2种方法
- nyist oj 214 单调递增子序列(二) (动态规划经典)
- Spring DAO vs Spring ORM vs Spring JDBC
- Ext.state.Manager.setProvider(new Ext.state.CookieProvider())
- OpenShift上部署Redis主从集群
- 硬件负载均衡F5和软负责均衡Nginx
- Objective-C:动态绑定
- OpenCV学习(35) OpenCV中的PCA算法
- 微信小程序Nginx环境配置
- Minimum Window Substring leetcode java