task-sdk-visual


License

License

Categories

Categories

ORM Data
GroupId

GroupId

cn.dceast.platform
ArtifactId

ArtifactId

task-sdk-visual
Last Version

Last Version

1.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

task-sdk-visual
task-sdk-visual
Project URL

Project URL

https://github.com/qingliuyun
Source Code Management

Source Code Management

https://github.com/qingliuyun/platform-config-client

Download task-sdk-visual

How to add to project

<!-- https://jarcasting.com/artifacts/cn.dceast.platform/task-sdk-visual/ -->
<dependency>
    <groupId>cn.dceast.platform</groupId>
    <artifactId>task-sdk-visual</artifactId>
    <version>1.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/cn.dceast.platform/task-sdk-visual/
implementation 'cn.dceast.platform:task-sdk-visual:1.1.2'
// https://jarcasting.com/artifacts/cn.dceast.platform/task-sdk-visual/
implementation ("cn.dceast.platform:task-sdk-visual:1.1.2")
'cn.dceast.platform:task-sdk-visual:jar:1.1.2'
<dependency org="cn.dceast.platform" name="task-sdk-visual" rev="1.1.2">
  <artifact name="task-sdk-visual" type="jar" />
</dependency>
@Grapes(
@Grab(group='cn.dceast.platform', module='task-sdk-visual', version='1.1.2')
)
libraryDependencies += "cn.dceast.platform" % "task-sdk-visual" % "1.1.2"
[cn.dceast.platform/task-sdk-visual "1.1.2"]

Dependencies

compile (6)

Group / Artifact Type Version
cn.dceast.platform : task-sdk jar 2.0.0
org.eclipse.jetty.aggregate : jetty-all jar 9.0.6.v20130930
org.eclipse.jetty : jetty-annotations jar 9.0.6.v20130930
org.eclipse.jetty.orbit : org.objectweb.asm jar 3.1.0.v200803061910
javax.servlet : javax.servlet-api jar 3.0.1
org.eclipse.jetty : jetty-plus jar 9.0.6.v20130930

Project Modules

There are no modules declared in this project.

本工程为oss平台提供的配置中心的客户端,主要目的为了部署在平台上的应用可以从配置中心获取配置。

支持OSS平台配置中心、本地properties文件。默认读取工程中的properties文件,最少要有一个application.properties

客户端集成

Spring boot工程,只需要将此工程jar包放入工程即可。pom.xml 中添加如下依赖

<dependency>
    <groupId>cn.dceast.platform</groupId>
    <artifactId>platform-config-client</artifactId>
    <version>2.3.0</version>
</dependency>

普通Spring工程,需要额外按照如下方式配置bean

<bean id="propertyPlaceholderConfigAdapter" class="cn.dceast.platform.config.adapter.SpringPropertyPlaceholderConfigAdapter">
    <property name="loadProperties">
        <list>
            <value>application.properties</value>
            <value>cas.properties</value>
        </list>
    </property>
</bean>

普通java web工程

使用 CommonConfigAdapter类。此类型readPropertiesByEnvironment()方法可以根据环境变量决定是读取本地properties文件还是读取配置中心。 此方法默认读取application.properties。可以自定义设置此类的loadProperties属性。

对于静态资源中,需要替换属性变量 在web.xml中如下配置

<context-param>
    <param-name>replaceFiles</param-name>
    <param-value>1.js,2.js,3.css</param-value>
</context-param>
<context-param>
    <param-name>replaceFileStrs</param-name>
    <param-value>co.test.helper</param-value>
</context-param>
<context-param>
    <param-name>replaceProperties</param-name>
    <param-value>application.properties,cas.properties</param-value>
</context-param>

<listener>
    <listener-class>cn.dceast.platform.config.adapter.listener.ReplaceStaticResourceListener</listener-class>
</listener>

replaceFiles:需要替换的静态文件清单。
replaceFileStrs:需要替换的属性。
replaceProperties:默认替换的属性值的来源。

应用详情页面设置环境变量

  *  CONFIG_CENTER_ENABLE = true 开启从配置中心读配置
  *  CONFIG_CENTER_HOST = "http://221.178.232.93:86/oss-config-center" 配置中心的host
  *  CONFIG_PROJECT_NAME = "demo-huajian"  项目名称
  *  CONFIG_PROFILE_NAME = "profile03"  配置组名称
  *  CONFIG_SECRET_KEY = "rh2p6w6sgas" 配置组安全key

Versions

Version
1.1.2