提交 864dbe7c 编写于 作者: 武汉红喜's avatar 武汉红喜

optimise

上级 f1a989c5
......@@ -32,6 +32,7 @@
<module>whatsmars-zk</module>
<module>whatsmars-storm</module>
<module>whatsmars-flink</module>
<module>whatsmars-spring-data</module>
</modules>
<!--这里的properties会覆盖父pom里的重名的配置-->
......@@ -197,6 +198,12 @@
<artifactId>javassist</artifactId>
<version>${javassist.version}</version>
</dependency>
<dependency>
<groupId>org.hongxi</groupId>
<artifactId>whatsmars-common</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
......
package org.hongxi.whatsmars.spring.profile;
import org.springframework.util.StringUtils;
package org.hongxi.whatsmars.common.profile;
public class ProfileUtils {
......@@ -9,6 +7,6 @@ public class ProfileUtils {
public static String getProfile() {
String profile = System.getProperty(PROFILE_ENV_NAME);
return StringUtils.isEmpty(profile) ? DEFAULT_PROFILE : profile;
return profile == null || profile.trim().length() == 0 ? DEFAULT_PROFILE : profile;
}
}
......@@ -88,7 +88,6 @@
<dependency>
<groupId>org.hongxi</groupId>
<artifactId>whatsmars-common</artifactId>
<version>Rocket.S7</version>
</dependency>
</dependencies>
......
......@@ -60,6 +60,11 @@
<artifactId>snakeyaml</artifactId>
</dependency>
<dependency>
<groupId>org.hongxi</groupId>
<artifactId>whatsmars-common</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
......
package org.hongxi.whatsmars.spring.profile;
import org.hongxi.whatsmars.common.profile.ProfileUtils;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
......
package org.hongxi.whatsmars.spring.profile;
import org.hongxi.whatsmars.common.profile.ProfileUtils;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
public class TestSpring {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册