使用autoconfig
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
使用autoconfig的更多相关文章
- mvn filter autoconfig 产生自动配置
可以使用filter, 也可以使用autoconfig 详细请见 http://www.openwebx.org/docs/autoconfig.html
- maven auto-config 多环境自动打包
摘自:http://doc.okbase.net/bjhecwq/archive/118121.html maven有许多优秀的插件,最近在研究打包中替换多重环境的配置,同事介绍使用阿里的auto-c ...
- Maven插件实现的autoconfig机制(转)
autoconfig这种机制在软件开发和发布的过程中是非常方便也是非常必要的一种动态替换配置信息的一种手段,一种很贴切的比喻:这个就像在windows下面安装一个软件时,我们按照安装向导给我们弹出提示 ...
- Lenovo E46A-Win 7_无线灯亮但无法启动(耽误3天以上您信吗.....)问题: wlan autoconfig 依赖服务或组无法启动
Lenovo E46A-Win 7_无线灯亮但无法启动(耽误3天以上您信吗.....)问题: wlan autoconfig 依赖服务或组无法启动 提示: windows7 无线连接服务wlan au ...
- autoconfig操作小结
1.添加maven配置在pom文件中 <profile> <id>prod</id> <properties> < ...
- spring auto-config
spring security auto-config auto-config配置 <http auto-config="true"> </http> 自动 ...
- alibaba druid 在springboot start autoconfig 下的bug
alibaba druid 在springboot start autoconfig下的bug 标签(空格分隔):druid springboot start autoconfig 背景 发现.分析过 ...
- 在R12下加载Java Bean,配置FORMS_WEB_CONFIG_FILE文件/通过AutoConfig实现Form Server配置文件的修改
1.定位模版文件$AD_TOP/bin/adtmplreport.sh contextfile=$CONTEXT_FILE target=$FORMS_WEB_CONFIG_FILE以上命令,通过查看 ...
- Spring boot 继承 阿里 autoconfig 配置环境参数
前提:基于springboot 项目 1. 配置pom.xml 文件 <plugin> <groupId>com.alibaba.citrus.tool</groupId ...
- AutoConfig工具使用
下载安装Auto工具包: http://code.taobao.org/mvn/repository/com/alibaba/citrus/tool/antx-autoconfig/1.0.9/ant ...
随机推荐
- ELNEC Programmer
BeeHive204 Very fast universal 4x 48-pindrive concurrent multiprogramming system with ISP capability ...
- DI容器Ninject在管理接口和实现、基类和派生类并实现依赖注入方面的实例
当一个类依赖于另一个具体类的时候,这样很容易形成两者间的"强耦合"关系.我们通常根据具体类抽象出一个接口,然后让类来依赖这个接口,这样就形成了"松耦合"关系,有 ...
- MVC二级联动使用$.ajax方法获取后端返回的字符串
在"MVC二级联动使用$.getJSON方法"中使用$.getJSON()获取后端返回的JSon. 本篇使用jQuery的$.ajax()获取后端返回的字符串,实现二级联动. ...
- spring mvc 下 applicationContext 和webApplicationContext
spring中的ApplicationContexts可以被限制在不同的作用域.在web框架中,每个DispatcherServlet有它自己的WebApplicationContext,它包含了Di ...
- linux shell if语句使用方法
原文地址:http://blog.chinaunix.net/uid-24607609-id-2118151.html 最精简的 if 命令的语法是: if TEST-COMMANDS; then C ...
- 《逆袭大学:传给IT学子的正能量》
<逆袭大学:传给IT学子的正能量> 基本信息 作者: 贺利坚 丛书名: 图灵原创 出版社:人民邮电出版社 ISBN:9787115347473 上架时间:2014-3-3 出版日期:201 ...
- 在Java程序中使用Hibernate
Hibernate是一种ORM框架,ORM全称为Object-Relative Database-Mapping,在Java对象与关系数据库之间建立某种映射,以实现直接存取Java对象(一般为实体类) ...
- go语言基础之结构体比较和赋值
1.结构体比较和赋值 (同类型的结构体可以相互赋值) 示例: package main //必须有个main包 import "fmt" //定义一个结构体类型 type Stud ...
- XML中PCDATA与CDATA的区别
XML中PCDATA与CDATA的区别 2011-02-10 19:27:25| 分类: XML | 标签:xml中pcdata与cdata的区别 字号:大中小 订阅 所有 XML 文档中 ...
- 读书笔记-C#中装箱拆箱性能
前言 最近在看王涛大神的<你必须知道的.NET(第二版)>一书,嗯,首先膜拜一下…. 在书中的第五章-品味类型中,对装箱与拆箱一节感触很深,概念本身相信每一个程序猿都不陌生,装 ...