Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #346

Open
wants to merge 50 commits into
base: stable
Choose a base branch
from
Open

test #346

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
ef18449
re
knightliao Jul 18, 2016
563a62c
Merge branch 'master' into dev
knightliao Jul 18, 2016
454ef50
re
knightliao Aug 31, 2016
e553fab
Merge branch 'master' into dev
knightliao Aug 31, 2016
9122064
配置和配置项可支持自定义app https://github.com/knightliao/disconf/issues/147
knightliao Sep 5, 2016
bdba14a
https://github.com/knightliao/disconf/issues/158
knightliao Sep 5, 2016
0eb8bfd
use debug to log no use dynamic properties
knightliao Sep 6, 2016
e45692d
re
knightliao Sep 6, 2016
c61feb7
fix bug: class path 不能支持windows环境 https://github.com/knightliao/disco…
knightliao Sep 8, 2016
9963408
re
knightliao Sep 11, 2016
c4bf256
re
knightliao Sep 11, 2016
289e322
Merge branch 'stable' into dev
knightliao Sep 11, 2016
a5a05ea
删除 DisconfMgrJustHostFileBean
knightliao Sep 11, 2016
105ce0a
add update.rst
knightliao Sep 11, 2016
b7c9a20
re
knightliao Sep 11, 2016
5973d80
re
knightliao Sep 11, 2016
78dcecb
re
knightliao Sep 11, 2016
92f94ad
re
knightliao Sep 11, 2016
e99a436
re
knightliao Sep 11, 2016
923626a
re
knightliao Sep 11, 2016
08d032a
re
knightliao Sep 11, 2016
b64299a
re
knightliao Sep 11, 2016
68d4a82
re
knightliao Sep 11, 2016
6916d18
re
knightliao Sep 11, 2016
b28470b
re
knightliao Sep 11, 2016
3efc5ab
re
knightliao Sep 11, 2016
f52fc87
re
knightliao Sep 12, 2016
b156120
re
knightliao Sep 19, 2016
c3f5b93
re
knightliao Sep 19, 2016
651e2e4
re
knightliao Sep 19, 2016
6c7cbe6
re
knightliao Oct 4, 2016
73cafb2
re
knightliao Oct 8, 2016
54c69f2
re
knightliao Oct 11, 2016
c066d8e
re
knightliao Nov 7, 2016
d7b0102
remove trans for update config value
knightliao Nov 8, 2016
0988bfc
re
knightliao Dec 10, 2016
8f98729
re
knightliao Dec 10, 2016
b537870
re
knightliao Dec 10, 2016
c7546e9
re
knightliao Dec 10, 2016
9bdca11
re
knightliao Dec 10, 2016
2ac5c82
re
knightliao Dec 10, 2016
561a200
Update README.md
knightliao Jul 26, 2018
d413cbc
Update README.md
knightliao Jul 26, 2018
23f6d3d
fix pack
knightliao Sep 27, 2021
11d0888
re
knightliao Sep 27, 2021
f95a68d
update
knightliao Sep 27, 2021
4efbd1e
re
knightliao Sep 27, 2021
02227c0
re
knightliao Sep 27, 2021
904ab7a
re
knightliao Sep 27, 2021
872e69c
re
knightliao Sep 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Disconf [![Build Status](https://travis-ci.org/knightliao/disconf.svg?branch=master)](https://travis-ci.org/knightliao/disconf) [![Coverage Status](https://coveralls.io/repos/knightliao/disconf/badge.png?branch=master)](https://coveralls.io/r/knightliao/disconf?branch=master)
Disconf
=======

[![Apache License 2](https://img.shields.io/badge/license-ASF2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.txt)
[![Build Status](https://travis-ci.org/knightliao/disconf.svg?branch=master)](https://travis-ci.org/knightliao/disconf)
[![Coverage Status](https://coveralls.io/repos/knightliao/disconf/badge.png?branch=master)](https://coveralls.io/r/knightliao/disconf?branch=master)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.baidu.disconf/disconf-client/badge.svg?style=plastic)](https://maven-badges.herokuapp.com/maven-central/com.baidu.disconf/disconf-client)

Distributed Configuration Management Platform(分布式配置管理平台)

专注于各种「分布式系统配置管理」的「通用组件」和「通用平台」, 提供统一的「配置管理服务」
Expand Down Expand Up @@ -28,10 +33,9 @@ Distributed Configuration Management Platform(分布式配置管理平台)

## 版本

- dev(latest branch): 2.6.36-SNAPSHOT
- master(cooperate && contribute branch):2.6.35
- stable(release && stable branch): 2.6.35
- 在Maven Central Repository里查看 [com.baidu.disconf](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.baidu.disconf%22 )
- dev(dev branch): 2.6.36
- master(latest && cooperate && contribute branch):2.6.36
- stable(release && stable branch): 2.6.36

## 功能特点 ##

Expand Down Expand Up @@ -84,9 +88,5 @@ Disconf的功能特点描述图:

![http://ww4.sinaimg.cn/bmiddle/60c9620fjw1est6pzqo68j208k05tjrm.jpg](http://ww4.sinaimg.cn/bmiddle/60c9620fjw1est6pzqo68j208k05tjrm.jpg)

## 群·联系·讨论

- disconf技术QQ群: 239203866
- disconf技术QQ二群: 280712860
- 有态度无广告的搜索引擎: https://www.sov5.com
- 高质量的微信公众号阅读: http://www.100weidu.com

8 changes: 1 addition & 7 deletions disconf-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>com.baidu.disconf</groupId>
<artifactId>disconf-base</artifactId>
<version>2.6.35</version>
<version>2.6.36</version>
</parent>

<licenses>
Expand Down Expand Up @@ -92,12 +92,6 @@

<!-- log dependencies -->

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected String parseStringValue(String strVal, Properties props, Set visitedPl
}
addDependency(dynamic, placeholder);
} else {
logger.warn("dynamic property outside bean property value - ignored: " + strVal);
logger.debug("dynamic property outside bean property value - ignored: " + strVal);
}
startIndex = endIndex - this.placeholderPrefix.length() + this.placeholderPrefix.length() +
this.placeholderSuffix.length();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,15 @@
String version() default "";

/**
* 以"/"开头则是系统的全路径,否则则是相对于classpath的路径,默认是classpath根路径
* 版本,默认为用户指定的app
*/
String app() default "";

/**
* 配置文件目标地址dir, 以"/"开头则是系统的全路径,否则则是相对于classpath的路径,默认是classpath根路径
* 注意:根路径要注意是否有权限,否则会出现找不到路径,推荐采用相对路径
*
* @return
*/
String copy2TargetDirPath() default "";
String targetDirPath() default "";
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
*/
String env() default "";

/**
* 版本,默认为用户指定的app
*/
String app() default "";

/**
* 版本,默认为用户指定的版本
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public class DisconfCenterFile extends DisconfCenterBaseModel {
// 文件名
private String fileName;

// 复制到指定的路径下
private String copy2TargetDirPath;
// 配置文件 指定路径下
private String targetDirPath;

// 文件类型
private SupportFileTypeEnum supportFileTypeEnum = SupportFileTypeEnum.ANY;
Expand Down Expand Up @@ -95,18 +95,18 @@ public void setIsTaggedWithNonAnnotationFile(boolean isTaggedWithNonAnnotationFi
this.isTaggedWithNonAnnotationFile = isTaggedWithNonAnnotationFile;
}

public String getCopy2TargetDirPath() {
return copy2TargetDirPath;
public String getTargetDirPath() {
return targetDirPath;
}

public void setCopy2TargetDirPath(String copy2TargetDirPath) {
this.copy2TargetDirPath = copy2TargetDirPath;
public void setTargetDirPath(String targetDirPath) {
this.targetDirPath = targetDirPath;
}

@Override
public String toString() {
return "\n\tDisconfCenterFile [\n\tkeyMaps=" + keyMaps + "\n\tcls=" + cls + "\n\tfileName=" + fileName
+ "\n\tcopy2TargetDirPath=" + copy2TargetDirPath +
+ "\n\ttargetDirPath=" + targetDirPath +
super.toString() + "]";
}

Expand Down Expand Up @@ -141,17 +141,19 @@ public Map<String, Object> getKV() {
* 配置文件的路径
*/
public String getFilePath() {

// 不放到classpath, 则文件路径根据 userDefineDownloadDir 来设置
if (!DisClientConfig.getInstance().enableLocalDownloadDirInClassPath) {
return OsUtil.pathJoin(DisClientConfig.getInstance().userDefineDownloadDir, fileName);
}

if (copy2TargetDirPath != null) {
if (targetDirPath != null) {

if (copy2TargetDirPath.startsWith("/")) {
return OsUtil.pathJoin(copy2TargetDirPath, fileName);
if (targetDirPath.startsWith("/")) {
return OsUtil.pathJoin(targetDirPath, fileName);
}

return OsUtil.pathJoin(ClassLoaderUtil.getClassPath(), copy2TargetDirPath, fileName);
return OsUtil.pathJoin(ClassLoaderUtil.getClassPath(), targetDirPath, fileName);
}

return OsUtil.pathJoin(ClassLoaderUtil.getClassPath(), fileName);
Expand All @@ -163,13 +165,13 @@ public String getFilePath() {
public String getFileDir() {

// 获取相对于classpath的路径
if (copy2TargetDirPath != null) {
if (targetDirPath != null) {

if (copy2TargetDirPath.startsWith("/")) {
return OsUtil.pathJoin(copy2TargetDirPath);
if (targetDirPath.startsWith("/")) {
return OsUtil.pathJoin(targetDirPath);
}

return OsUtil.pathJoin(ClassLoaderUtil.getClassPath(), copy2TargetDirPath);
return OsUtil.pathJoin(ClassLoaderUtil.getClassPath(), targetDirPath);
}

return ClassLoaderUtil.getClassPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ public interface FetcherMgr {
String getValueFromServer(String url) throws Exception;

/**
* 下载配置文件, remoteUrl是目标 url, 下载到预定义的文件夹,并复制到classpath文件夹下
* 下载配置文件, remoteUrl是目标 url, 下载到预定义的文件夹,并 下载到 targetDirPath 目录下
*
* @throws Exception
*/
String downloadFileFromServer(String url, String fileName, String copy2TargetDirPath) throws Exception;
String downloadFileFromServer(String url, String fileName, String targetDirPath) throws Exception;

/**
* 释放资源
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,17 @@ private static DisconfCenterFile transformScanFile(Class<?> disconfFileClass, Se
// file name
disconfCenterFile.setFileName(disconfFileAnnotation.filename());

// copy 2 target path
disconfCenterFile.setCopy2TargetDirPath(disconfFileAnnotation.copy2TargetDirPath().trim());
// config file target dir path
disconfCenterFile.setTargetDirPath(disconfFileAnnotation.targetDirPath().trim());

// file type
disconfCenterFile.setSupportFileTypeEnum(SupportFileTypeEnum.getByFileName(disconfFileAnnotation.filename()));

//
// disConfCommonModel
DisConfCommonModel disConfCommonModel =
makeDisConfCommonModel(disconfFileAnnotation.env(), disconfFileAnnotation.version());
makeDisConfCommonModel(disconfFileAnnotation.app(), disconfFileAnnotation.env(), disconfFileAnnotation
.version());
disconfCenterFile.setDisConfCommonModel(disConfCommonModel);

// Remote URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ private static DisconfCenterItem transformScanItem(Method method) {

//
// disConfCommonModel
DisConfCommonModel disConfCommonModel = makeDisConfCommonModel(disconfItem.env(), disconfItem.version());
DisConfCommonModel disConfCommonModel = makeDisConfCommonModel(disconfItem.app(), disconfItem.env(),
disconfItem.version());
disconfCenterItem.setDisConfCommonModel(disConfCommonModel);

// Disconf-web url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ public class StaticScannerMgrImplBase {
/**
* env/version 默认是应用整合设置的,但用户可以在配置中更改它
*/
protected static DisConfCommonModel makeDisConfCommonModel(String env, String version) {
protected static DisConfCommonModel makeDisConfCommonModel(String app, String env, String version) {

DisConfCommonModel disConfCommonModel = new DisConfCommonModel();

// app
disConfCommonModel.setApp(DisClientConfig.getInstance().APP);
if (!app.isEmpty()) {
disConfCommonModel.setApp(app);
} else {
disConfCommonModel.setApp(DisClientConfig.getInstance().APP);
}

// env
if (!env.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static DisconfCenterBaseModel getDisconfCenterFile(String fileName) {

//
// disConfCommonModel
DisConfCommonModel disConfCommonModel = makeDisConfCommonModel("", "");
DisConfCommonModel disConfCommonModel = makeDisConfCommonModel("", "", "");
disconfCenterFile.setDisConfCommonModel(disConfCommonModel);

// Remote URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public <T> T getJsonData(Class<T> clazz, RemoteUrl remoteUrl, int retryTimes, in
*/
@Mock
public String downloadFromServer(RemoteUrl remoteUrl, String fileName, String localFileDir, String localFileDirTemp,
String copy2TargetDirPath, boolean download2Classpath, int retryTimes,
String targetDirPath, boolean download2Classpath, int retryTimes,
int retrySleepSeconds)
throws Exception {

Expand Down
25 changes: 2 additions & 23 deletions disconf-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>com.baidu.disconf</groupId>
<artifactId>disconf-base</artifactId>
<version>2.6.35</version>
<version>2.6.36</version>
</parent>

<licenses>
Expand All @@ -32,7 +32,6 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0-rc2</version>
</dependency>

<dependency>
Expand All @@ -43,7 +42,7 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.1</version>
<version>4.5.13</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -86,26 +85,6 @@
<artifactId>slf4j-api</artifactId>
</dependency>

<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- test dependencies -->

<dependency>
Expand Down
Loading