diff --git a/api/pom.xml b/api/pom.xml index e4ae34193a1..0863cf6346c 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -37,6 +37,20 @@ com.alibaba fastjson + + + + junit + junit + test + + + + org.springframework + spring-test + test + + diff --git a/api/src/test/java/com/alibaba/nacos/client/AppTest.java b/api/src/test/java/com/alibaba/nacos/client/AppTest.java deleted file mode 100644 index 7c119e06791..00000000000 --- a/api/src/test/java/com/alibaba/nacos/client/AppTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 1999-2018 Alibaba Group Holding Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.alibaba.nacos.client; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Unit test for simple App. - */ -public class AppTest - extends TestCase -{ - /** - * Create the test case - * - * @param testName name of the test case - */ - public AppTest( String testName ) - { - super( testName ); - } - - /** - * @return the suite of tests being tested - */ - public static Test suite() - { - return new TestSuite( AppTest.class ); - } - - /** - * Rigourous Test :-) - */ - public void testApp() - { - assertTrue( true ); - } -} diff --git a/client/pom.xml b/client/pom.xml index 82832aa724e..6dc477aeb56 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -33,18 +33,13 @@ + org.slf4j slf4j-api true - - log4j - log4j - true - - org.apache.logging.log4j log4j-core @@ -52,30 +47,12 @@ true - - commons-logging - commons-logging - true - - - - org.slf4j - slf4j-log4j12 - true - - org.apache.logging.log4j log4j-slf4j-impl true - - org.slf4j - jcl-over-slf4j - true - - ${project.groupId} nacos-common @@ -94,11 +71,13 @@ ch.qos.logback logback-classic + true ch.qos.logback logback-core + true diff --git a/client/src/main/java/com/alibaba/nacos/client/logger/LoggerFactory.java b/client/src/main/java/com/alibaba/nacos/client/logger/LoggerFactory.java index bc421aca797..2de5eee6ee7 100644 --- a/client/src/main/java/com/alibaba/nacos/client/logger/LoggerFactory.java +++ b/client/src/main/java/com/alibaba/nacos/client/logger/LoggerFactory.java @@ -15,16 +15,15 @@ */ package com.alibaba.nacos.client.logger; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import com.alibaba.nacos.client.logger.log4j.Log4jLoggerFactory; import com.alibaba.nacos.client.logger.log4j2.Log4j2LoggerFactory; import com.alibaba.nacos.client.logger.nop.NopLoggerFactory; import com.alibaba.nacos.client.logger.slf4j.Slf4jLoggerFactory; import com.alibaba.nacos.client.logger.support.ILoggerFactory; import com.alibaba.nacos.client.logger.support.LogLog; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + /** *
  * 阿里中间件LoggerFactory,获取具体日志实现
@@ -57,17 +56,12 @@ private LoggerFactory() {
             LogLog.info("Init JM logger with Slf4jLoggerFactory success, " + LoggerFactory.class.getClassLoader());
         } catch (Throwable e1) {
             try {
-                setLoggerFactory(new Log4jLoggerFactory());
-                LogLog.info("Init JM logger with Log4jLoggerFactory, " + LoggerFactory.class.getClassLoader());
+                setLoggerFactory(new Log4j2LoggerFactory());
+                LogLog.info("Init JM logger with Log4j2LoggerFactory, " + LoggerFactory.class.getClassLoader());
             } catch (Throwable e2) {
-                try {
-                    setLoggerFactory(new Log4j2LoggerFactory());
-                    LogLog.info("Init JM logger with Log4j2LoggerFactory, " + LoggerFactory.class.getClassLoader());
-                } catch (Throwable e3) {
-                    setLoggerFactory(new NopLoggerFactory());
-                    LogLog.warn("Init JM logger with NopLoggerFactory, pay attention. "
-                                + LoggerFactory.class.getClassLoader(), e2);
-                }
+                setLoggerFactory(new NopLoggerFactory());
+                LogLog.warn("Init JM logger with NopLoggerFactory, pay attention. "
+                        + LoggerFactory.class.getClassLoader(), e2);
             }
         }
 
diff --git a/client/src/main/java/com/alibaba/nacos/client/logger/log4j/Log4jLogger.java b/client/src/main/java/com/alibaba/nacos/client/logger/log4j/Log4jLogger.java
deleted file mode 100644
index 04389b494d2..00000000000
--- a/client/src/main/java/com/alibaba/nacos/client/logger/log4j/Log4jLogger.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright 1999-2018 Alibaba Group Holding Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.alibaba.nacos.client.logger.log4j;
-
-import org.apache.log4j.Level;
-
-import com.alibaba.nacos.client.logger.Logger;
-import com.alibaba.nacos.client.logger.option.Log4jActivateOption;
-import com.alibaba.nacos.client.logger.support.LoggerHelper;
-import com.alibaba.nacos.client.logger.support.LoggerSupport;
-import com.alibaba.nacos.client.logger.util.MessageUtil;
-
-
-/**
- * Log4jLogger
- * @author Nacos
- *
- */
-public class Log4jLogger extends LoggerSupport implements Logger {
-
-    private org.apache.log4j.Logger delegate;
-
-    public Log4jLogger(org.apache.log4j.Logger delegate) {
-        super(delegate);
-
-        if (delegate == null) {
-            throw new IllegalArgumentException("delegate Logger is null");
-        }
-        this.delegate = delegate;
-
-        this.activateOption = new Log4jActivateOption(delegate);
-    }
-
-    @Override
-    public void debug(String context, String message) {
-        if (isDebugEnabled()) {
-            message = LoggerHelper.getResourceBundleString(getProductName(), message);
-            delegate.debug(MessageUtil.getMessage(context, message));
-        }
-    }
-
-    @Override
-    public void debug(String context, String format, Object... args) {
-        if (isDebugEnabled()) {
-            format = LoggerHelper.getResourceBundleString(getProductName(), format);
-            delegate.debug(MessageUtil.getMessage(context, MessageUtil.formatMessage(format, args)));
-        }
-    }
-
-    @Override
-    public void info(String context, String message) {
-        if (isInfoEnabled()) {
-            message = LoggerHelper.getResourceBundleString(getProductName(), message);
-            delegate.info(MessageUtil.getMessage(context, message));
-        }
-    }
-
-    @Override
-    public void info(String context, String format, Object... args) {
-        if (isInfoEnabled()) {
-            format = LoggerHelper.getResourceBundleString(getProductName(), format);
-            delegate.info(MessageUtil.getMessage(context, MessageUtil.formatMessage(format, args)));
-        }
-    }
-
-    @Override
-    public void warn(String message, Throwable t) {
-        if (isWarnEnabled()) {
-            message = LoggerHelper.getResourceBundleString(getProductName(), message);
-            delegate.warn(MessageUtil.getMessage(null, message), t);
-        }
-    }
-
-    @Override
-    public void warn(String context, String message) {
-        if (isWarnEnabled()) {
-            message = LoggerHelper.getResourceBundleString(getProductName(), message);
-            delegate.warn(MessageUtil.getMessage(context, message));
-        }
-    }
-
-    @Override
-    public void warn(String context, String format, Object... args) {
-        if (isWarnEnabled()) {
-            format = LoggerHelper.getResourceBundleString(getProductName(), format);
-            delegate.warn(MessageUtil.getMessage(context, MessageUtil.formatMessage(format, args)));
-        }
-    }
-
-    @Override
-    public void error(String context, String errorCode, String message) {
-        if (isErrorEnabled()) {
-            message = LoggerHelper.getResourceBundleString(getProductName(), message);
-            delegate.error(MessageUtil.getMessage(context, errorCode, message));
-        }
-    }
-
-    @Override
-    public void error(String context, String errorCode, String message, Throwable t) {
-        if (isErrorEnabled()) {
-            message = LoggerHelper.getResourceBundleString(getProductName(), message);
-            delegate.error(MessageUtil.getMessage(context, errorCode, message), t);
-        }
-    }
-
-    @Override
-    public void error(String context, String errorCode, String format, Object... args) {
-        if (isErrorEnabled()) {
-            format = LoggerHelper.getResourceBundleString(getProductName(), format);
-            delegate.error(MessageUtil.getMessage(context, errorCode, MessageUtil.formatMessage(format, args)));
-        }
-    }
-
-    @Override
-    public boolean isDebugEnabled() {
-        return delegate.isDebugEnabled();
-    }
-
-    @Override
-    public boolean isInfoEnabled() {
-        return delegate.isInfoEnabled();
-    }
-
-    @Override
-    public boolean isWarnEnabled() {
-        return delegate.isEnabledFor(Level.WARN);
-    }
-
-    @Override
-    public boolean isErrorEnabled() {
-        return delegate.isEnabledFor(Level.ERROR);
-    }
-}
diff --git a/client/src/main/java/com/alibaba/nacos/client/logger/log4j/Log4jLoggerFactory.java b/client/src/main/java/com/alibaba/nacos/client/logger/log4j/Log4jLoggerFactory.java
deleted file mode 100644
index 86ca0aa9f48..00000000000
--- a/client/src/main/java/com/alibaba/nacos/client/logger/log4j/Log4jLoggerFactory.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 1999-2018 Alibaba Group Holding Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.alibaba.nacos.client.logger.log4j;
-
-import org.apache.log4j.LogManager;
-
-import com.alibaba.nacos.client.logger.Logger;
-import com.alibaba.nacos.client.logger.nop.NopLogger;
-import com.alibaba.nacos.client.logger.support.ILoggerFactory;
-import com.alibaba.nacos.client.logger.support.LogLog;
-
-/**
- * Log4jLogger Factory
- * @author Nacos
- *
- */
-public class Log4jLoggerFactory implements ILoggerFactory {
-
-    public Log4jLoggerFactory() throws ClassNotFoundException {
-        Class.forName("org.apache.log4j.Level");
-    }
-
-    public Logger getLogger(Class clazz) {
-        try {
-            return new Log4jLogger(LogManager.getLogger(clazz));
-        } catch (Throwable t) {
-            LogLog.error("Failed to get Log4jLogger", t);
-            return new NopLogger();
-        }
-    }
-
-    public Logger getLogger(String name) {
-        try {
-            return new Log4jLogger(LogManager.getLogger(name));
-        } catch (Throwable t) {
-            LogLog.error("Failed to get Log4jLogger", t);
-            return new NopLogger();
-        }
-    }
-}
diff --git a/client/src/main/java/com/alibaba/nacos/client/logger/option/AbstractActiveOption.java b/client/src/main/java/com/alibaba/nacos/client/logger/option/AbstractActiveOption.java
index 209054e6816..7debb078d51 100644
--- a/client/src/main/java/com/alibaba/nacos/client/logger/option/AbstractActiveOption.java
+++ b/client/src/main/java/com/alibaba/nacos/client/logger/option/AbstractActiveOption.java
@@ -15,8 +15,6 @@
  */
 package com.alibaba.nacos.client.logger.option;
 
-import org.apache.log4j.AsyncAppender;
-
 import com.alibaba.nacos.client.logger.Level;
 import com.alibaba.nacos.client.logger.support.LogLog;
 
diff --git a/client/src/main/java/com/alibaba/nacos/client/logger/option/Log4jActivateOption.java b/client/src/main/java/com/alibaba/nacos/client/logger/option/Log4jActivateOption.java
deleted file mode 100644
index ca3e3a6f9a9..00000000000
--- a/client/src/main/java/com/alibaba/nacos/client/logger/option/Log4jActivateOption.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright 1999-2018 Alibaba Group Holding Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.alibaba.nacos.client.logger.option;
-
-import org.apache.log4j.*;
-
-import com.alibaba.nacos.client.logger.Logger;
-import com.alibaba.nacos.client.logger.support.LoggerHelper;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * ActivateOption的Log4j实现
- *
- * @author zhuyong 2014年3月20日 上午10:24:36
- */
-public class Log4jActivateOption extends AbstractActiveOption {
-
-    protected org.apache.log4j.Logger logger;
-
-    public Log4jActivateOption(org.apache.log4j.Logger logger) {
-        this.logger = logger;
-    }
-
-    @Override
-    public void activateConsoleAppender(String target, String encoding) {
-        org.apache.log4j.ConsoleAppender appender = new org.apache.log4j.ConsoleAppender();
-        appender.setLayout(new PatternLayout(LoggerHelper.getPattern()));
-        appender.setTarget(target);
-        appender.setEncoding(encoding);
-        appender.activateOptions();
-
-        logger.removeAllAppenders();
-        logger.addAppender(appender);
-    }
-
-    @Override
-    public void activateAppender(String productName, String file, String encoding) {
-        org.apache.log4j.Appender appender = getLog4jDailyRollingFileAppender(productName, file, encoding);
-        logger.removeAllAppenders();
-        logger.addAppender(appender);
-
-        setProductName(productName);
-    }
-
-    @Override
-    public void activateAsyncAppender(String productName, String file, String encoding) {
-        activateAsyncAppender(productName, file, encoding, Integer.MIN_VALUE, Integer.MIN_VALUE);
-    }
-
-    @Override
-    public void activateAsyncAppender(String productName, String file, String encoding, int queueSize,
-                                      int discardingThreshold) {
-        activateAppender(productName, file, encoding);
-        activateAsync(queueSize, discardingThreshold);
-    }
-
-    @Override
-    public void activateAppenderWithTimeAndSizeRolling(String productName, String file, String encoding, String size) {
-        activateAppender(productName, file, encoding);
-    }
-
-    @Override
-    public void setLevel(com.alibaba.nacos.client.logger.Level level) {
-        this.level = level;
-        logger.setLevel(org.apache.log4j.Level.toLevel(level.getName()));
-    }
-
-    @Override
-    public void setAdditivity(boolean additivity) {
-        logger.setAdditivity(additivity);
-    }
-
-    protected org.apache.log4j.Appender getLog4jDailyRollingFileAppender(String productName, String file,
-                                                                         String encoding) {
-        DailyRollingFileAppender appender = new DailyRollingFileAppender();
-        appender.setName(productName + "." + file.replace(File.separatorChar, '.') + ".Appender");
-        appender.setLayout(new PatternLayout(LoggerHelper.getPattern(productName)));
-        appender.setAppend(true);
-        appender.setFile(LoggerHelper.getLogFileP(productName, file));
-        appender.setEncoding(encoding);
-        appender.activateOptions();
-
-        return appender;
-    }
-
-    @Override
-    public void activateAppender(Logger logger) {
-        if (!(logger.getDelegate() instanceof org.apache.log4j.Logger)) {
-            throw new IllegalArgumentException(
-                    "logger must be org.apache.log4j.Logger, but it's " + logger.getDelegate().getClass());
-        }
-        activateAppender((org.apache.log4j.Logger) logger.getDelegate());
-
-        setProductName(logger.getProductName());
-    }
-
-    protected void activateAppender(org.apache.log4j.Logger logger) {
-        this.logger.removeAllAppenders();
-
-        Enumeration enums = logger.getAllAppenders();
-        while (enums != null && enums.hasMoreElements()) {
-            this.logger.addAppender((Appender) enums.nextElement());
-        }
-    }
-
-    @Override
-    public void activateAppenderWithTimeAndSizeRolling(String productName, String file, String encoding, String size,
-                                                       String datePattern) {
-        Appender appender = getLog4jRollingFileAppender(productName, file, encoding, size, datePattern, -1);
-
-        logger.removeAllAppenders();
-        logger.addAppender(appender);
-
-        setProductName(productName);
-    }
-
-    @Override
-    public void activateAppenderWithTimeAndSizeRolling(String productName, String file, String encoding, String size,
-                                                       String datePattern, int maxBackupIndex) {
-        Appender appender = getLog4jRollingFileAppender(productName, file, encoding, size, datePattern, maxBackupIndex);
-        logger.removeAllAppenders();
-        logger.addAppender(appender);
-
-        setProductName(productName);
-    }
-
-    protected org.apache.log4j.Appender getLog4jRollingFileAppender(String productName, String file, String encoding,
-                                                                    String size, String datePattern,
-                                                                    int maxBackupIndex) {
-        RollingFileAppender appender = new RollingFileAppender();
-        appender.setName(productName + "." + file.replace(File.separatorChar, '.') + ".Appender");
-        appender.setLayout(new PatternLayout(LoggerHelper.getPattern(productName)));
-        appender.setAppend(true);
-        appender.setFile(LoggerHelper.getLogFileP(productName, file));
-        appender.setEncoding(encoding);
-        appender.setMaxFileSize(size);
-        if (maxBackupIndex >= 0) {
-            // 等于0表示直接truck
-            appender.setMaxBackupIndex(maxBackupIndex);
-        }
-        appender.activateOptions();
-
-        return appender;
-    }
-
-    @Override
-    public void activateAppenderWithSizeRolling(String productName, String file, String encoding, String size,
-                                                int maxBackupIndex) {
-        Appender appender = getLog4jRollingFileAppender(productName, file, encoding, size, null, maxBackupIndex);
-        logger.removeAllAppenders();
-        logger.addAppender(appender);
-
-        setProductName(productName);
-    }
-
-    @Override
-    public void activateAsync(int queueSize, int discardingThreshold) {
-        // discardingThreshold is unused for log4j
-        List args = new ArrayList();
-
-        if (queueSize != Integer.MIN_VALUE) {
-            args.add(new Object[] { "setBufferSize", new Class[] { int.class }, queueSize });
-        }
-        activateAsync(args);
-    }
-
-    @Override
-    public void activateAsync(List args) {
-        AsyncAppender asyncAppender = new AsyncAppender();
-
-        invokeMethod(asyncAppender, args);
-
-        asyncAppender.setName(productName + "." + logger.getName() + ".AsyncAppender");
-        Enumeration appenders = logger.getAllAppenders();
-
-        if (appenders == null) {
-            throw new IllegalStateException("Activate async appender failed, no appender exist.");
-        }
-
-        while (appenders.hasMoreElements()) {
-            asyncAppender.addAppender(appenders.nextElement());
-        }
-
-        appenders = logger.getAllAppenders();
-        while (appenders.hasMoreElements()) {
-            logger.removeAppender(appenders.nextElement());
-        }
-
-        logger.addAppender(asyncAppender);
-
-        setProductName(productName);
-    }
-}
diff --git a/client/src/main/java/com/alibaba/nacos/client/logger/option/Slf4jLog4jAdapterActivateOption.java b/client/src/main/java/com/alibaba/nacos/client/logger/option/Slf4jLog4jAdapterActivateOption.java
deleted file mode 100644
index 71c0a1956df..00000000000
--- a/client/src/main/java/com/alibaba/nacos/client/logger/option/Slf4jLog4jAdapterActivateOption.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 1999-2018 Alibaba Group Holding Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.alibaba.nacos.client.logger.option;
-
-import java.lang.reflect.Field;
-
-import com.alibaba.nacos.client.logger.Logger;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
-/**
- * Slf4j-log4j12架构下的ActivateOption实现
- *
- * @author zhuyong 2014年3月20日 上午10:26:04
- */
-public class Slf4jLog4jAdapterActivateOption extends Log4jActivateOption {
-
-    private static Field loggerField = null;
-
-    static {
-        try {
-            loggerField = org.slf4j.impl.Log4jLoggerAdapter.class.getDeclaredField("logger");
-            loggerField.setAccessible(true);
-        } catch (Exception e) {
-            throw new RuntimeException("logger must be instanceof org.slf4j.impl.Log4jLoggerAdapter", e);
-        }
-    }
-
-    public Slf4jLog4jAdapterActivateOption(Object logger) {
-        super(null);
-
-        try {
-            org.apache.log4j.Logger log4jLogger = (org.apache.log4j.Logger) loggerField.get(logger);
-            super.logger = log4jLogger;
-        } catch (Exception e) {
-            throw new RuntimeException("logger must be instanceof org.slf4j.impl.Log4jLoggerAdapter", e);
-        }
-    }
-
-    @Override
-    @SuppressFBWarnings("NM_WRONG_PACKAGE")
-    public void activateAppender(Logger logger) {
-        if (!(logger.getDelegate() instanceof org.slf4j.impl.Log4jLoggerAdapter)) {
-            throw new IllegalArgumentException(
-                    "logger must be org.slf4j.impl.Log4jLoggerAdapter, but it's "
-                            + logger.getDelegate().getClass());
-        }
-
-        try {
-            org.apache.log4j.Logger log4jLogger =
-                    (org.apache.log4j.Logger) loggerField.get(logger.getDelegate());
-            super.activateAppender(log4jLogger);
-            setProductName(logger.getProductName());
-        } catch (Exception e) {
-            throw new RuntimeException("activateAppender error, ", e);
-        }
-    }
-}
diff --git a/client/src/main/java/com/alibaba/nacos/client/logger/slf4j/Slf4jLogger.java b/client/src/main/java/com/alibaba/nacos/client/logger/slf4j/Slf4jLogger.java
index 9d5fd03c2df..d3543e0c059 100644
--- a/client/src/main/java/com/alibaba/nacos/client/logger/slf4j/Slf4jLogger.java
+++ b/client/src/main/java/com/alibaba/nacos/client/logger/slf4j/Slf4jLogger.java
@@ -15,24 +15,25 @@
  */
 package com.alibaba.nacos.client.logger.slf4j;
 
-import java.lang.reflect.Constructor;
-
 import com.alibaba.nacos.client.logger.Logger;
 import com.alibaba.nacos.client.logger.option.ActivateOption;
 import com.alibaba.nacos.client.logger.support.LoggerHelper;
 import com.alibaba.nacos.client.logger.support.LoggerSupport;
 import com.alibaba.nacos.client.logger.util.MessageUtil;
+
+import java.lang.reflect.Constructor;
+
 /**
  * slf4j logger
- * @author Nacos
  *
+ * @author Nacos
  */
 public class Slf4jLogger extends LoggerSupport implements Logger {
 
-    private static boolean   CanUseEncoder = false;
+    private static boolean CanUseEncoder = false;
     private static final String LOGBACK_CLASSNAME = "ch.qos.logback.classic.Logger";
-    private static final String SLF4J_CLASSNAME = "org.slf4j.impl.Log4jLoggerAdapter";
     private static final String SLF4JLOG4J_CLASSNAME = "org.apache.logging.slf4j.Log4jLogger";
+
     static {
         try {
             // logback从0.9.19开始采用encoder,@see http://logback.qos.ch/manual/encoders.html
@@ -46,8 +47,7 @@ public class Slf4jLogger extends LoggerSupport implements Logger {
     private org.slf4j.Logger delegate;
 
     @SuppressWarnings("unchecked")
-    public
-    Slf4jLogger(org.slf4j.Logger delegate){
+    public Slf4jLogger(org.slf4j.Logger delegate) {
         super(delegate);
         if (delegate == null) {
             throw new IllegalArgumentException("delegate Logger is null");
@@ -61,8 +61,6 @@ public class Slf4jLogger extends LoggerSupport implements Logger {
             } else {
                 activateOptionClass = "com.alibaba.nacos.client.logger.option.Logback918ActivateOption";
             }
-        } else if (SLF4J_CLASSNAME.equals(delegate.getClass().getName())) {
-            activateOptionClass = "com.alibaba.nacos.client.logger.option.Slf4jLog4jAdapterActivateOption";
         } else if (SLF4JLOG4J_CLASSNAME.equals(delegate.getClass().getName())) {
             activateOptionClass = "com.alibaba.nacos.client.logger.option.Slf4jLog4j2AdapterActivateOption";
         }
diff --git a/client/src/main/java/com/alibaba/nacos/client/logger/support/DepthThrowableRenderer.java b/client/src/main/java/com/alibaba/nacos/client/logger/support/DepthThrowableRenderer.java
deleted file mode 100644
index 59e4299a424..00000000000
--- a/client/src/main/java/com/alibaba/nacos/client/logger/support/DepthThrowableRenderer.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 1999-2018 Alibaba Group Holding Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * Copyright 2014 Alibaba.com All right reserved. This software is the
- * confidential and proprietary information of Alibaba.com ("Confidential
- * Information"). You shall not disclose such Confidential Information and shall
- * use it only in accordance with the terms of the license agreement you entered
- * into with Alibaba.com.
- */
-package com.alibaba.nacos.client.logger.support;
-
-import java.io.IOException;
-import java.io.InterruptedIOException;
-import java.io.LineNumberReader;
-import java.io.PrintWriter;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.ArrayList;
-
-import org.apache.log4j.spi.ThrowableRenderer;
-
-/**
- * 针对 Log4j 1.2.16 及以上版本,提供对异常栈的深度控制
- *
- * @author zhuyong 2014年9月19日 上午10:31:48
- */
-public final class DepthThrowableRenderer implements ThrowableRenderer {
-
-    private int depth = -1;
-
-    public DepthThrowableRenderer(int depth) {
-        this.depth = depth;
-    }
-
-    public void setDepth(int depth) {
-        this.depth = depth;
-    }
-
-    public String[] doRender(final Throwable throwable) {
-        return render(throwable, depth);
-    }
-
-    /**
-     * Render throwable using Throwable.printStackTrace.
-     *
-     * @param throwable throwable, may not be null.
-     * @param depth     stack depth
-     * @return string representation.
-     */
-    public static String[] render(final Throwable throwable, final int depth) {
-        StringWriter sw = new StringWriter();
-        PrintWriter pw = new PrintWriter(sw);
-        try {
-            throwable.printStackTrace(pw);
-        } catch (RuntimeException ex) {
-        }
-        pw.flush();
-        LineNumberReader reader = new LineNumberReader(new StringReader(sw.toString()));
-        ArrayList lines = new ArrayList();
-        try {
-            String line = reader.readLine();
-            int count = 0;
-            while (line != null && (depth == -1 || count++ <= depth)) {
-                lines.add(line);
-                line = reader.readLine();
-            }
-        } catch (IOException ex) {
-            if (ex instanceof InterruptedIOException) {
-                Thread.currentThread().interrupt();
-            }
-            lines.add(ex.toString());
-        }
-        String[] tempRep = new String[lines.size()];
-        lines.toArray(tempRep);
-        return tempRep;
-    }
-}
diff --git a/client/src/main/java/com/alibaba/nacos/client/logger/support/Log4jHelper.java b/client/src/main/java/com/alibaba/nacos/client/logger/support/Log4jHelper.java
deleted file mode 100644
index 2597a9ba63c..00000000000
--- a/client/src/main/java/com/alibaba/nacos/client/logger/support/Log4jHelper.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright 1999-2018 Alibaba Group Holding Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.alibaba.nacos.client.logger.support;
-
-import org.apache.log4j.Appender;
-import org.apache.log4j.AsyncAppender;
-import org.apache.log4j.ConsoleAppender;
-import org.apache.log4j.FileAppender;
-import org.apache.log4j.Level;
-import org.apache.log4j.LogManager;
-import org.apache.log4j.Logger;
-import org.apache.log4j.spi.LoggerRepository;
-import org.apache.log4j.spi.ThrowableRenderer;
-import org.apache.log4j.spi.ThrowableRendererSupport;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author zhuyong on 2017/6/28.
- */
-@SuppressWarnings("PMD.AbstractClassShouldStartWithAbstractNamingRule")
-public class Log4jHelper {
-
-    private static boolean Log4j = false, Log4jGT1216 = false;
-
-    static {
-        try {
-            Class loggerClass = Class.forName("org.apache.log4j.Logger");
-            // 这里可能会加载到应用中依赖的log4j,因此需要判断classloader
-            if (loggerClass.getClassLoader().equals(Log4jHelper.class.getClassLoader())) {
-                LogManager.getLoggerRepository();
-                try {
-                    Class throwableRendererClass = Class.forName("org.apache.log4j.spi.ThrowableRenderer");
-                    // 这里可能会加载到应用中依赖的log4j 1.2.16版本的类,因此需要额外判断
-                    if (loggerClass.getClassLoader().equals(throwableRendererClass.getClassLoader())
-                        && throwableRendererClass.getClassLoader().equals(Log4jHelper.class.getClassLoader())) {
-                        Log4jGT1216 = true;
-                    }
-                } catch (Throwable t) {
-                    LogLog.warn("log4j must >= 1.2.16 for change throwable depth");
-                }
-                Log4j = true;
-            }
-        } catch (Throwable t) {
-        }
-    }
-    @SuppressFBWarnings("NP_BOOLEAN_RETURN_NULL")
-    public static Boolean setDepth(int depth) {
-        if (Log4j && Log4jGT1216) {
-            try {
-                LoggerRepository repo = LogManager.getLoggerRepository();
-                doSetDepth(repo, depth);
-                return Boolean.TRUE;
-            } catch (Throwable t) {
-                // ignore
-                LogLog.error("failed to set depth for log4j", t);
-                return Boolean.FALSE;
-            }
-        }
-
-        return null;
-    }
-    @SuppressFBWarnings("NP_BOOLEAN_RETURN_NULL")
-    public static Boolean changeLevel(String name, String level) {
-        if (Log4j) {
-            Level l = Level.toLevel(level, Level.ERROR);
-            Logger logger = LogManager.getLoggerRepository().exists(name);
-            if (logger != null) {
-                logger.setLevel(l);
-                LogLog.info("set log4j log level success, " + name + ": " + l);
-                return true;
-            } else {
-                Logger root = LogManager.getLoggerRepository().getRootLogger();
-                if (root.getName().equals(name)) {
-                    root.setLevel(l);
-                    LogLog.info("set log4j log level success, " + name + ": " + l);
-                    return true;
-                }
-            }
-            LogLog.info("set log4j log level fail, no logger name exists: " + name);
-            return false;
-        }
-        return null;
-    }
-
-    public static Map getLoggers(String name) {
-        Map appenders = new HashMap(10);
-        if (!Log4j) {
-            return appenders;
-        }
-
-        if (name != null && !"".equals(name.trim())) {
-            Logger logger = LogManager.getLoggerRepository().exists(name);
-            if (logger != null) {
-                appenders.put(name, doGetLoggerInfo(logger));
-            }
-        } else {
-            // 获取所有logger时,如果没有appender则忽略
-            Enumeration loggers = LogManager.getLoggerRepository().getCurrentLoggers();
-
-            if (loggers != null) {
-                while (loggers.hasMoreElements()) {
-                    Logger logger = loggers.nextElement();
-                    LoggerInfo info = doGetLoggerInfo(logger);
-                    if (info.getAppenders() == null || !info.getAppenders().isEmpty()) {
-                        appenders.put(logger.getName(), info);
-                    }
-                }
-            }
-
-            Logger root = LogManager.getLoggerRepository().getRootLogger();
-            if (root != null) {
-                LoggerInfo info = doGetLoggerInfo(root);
-                if (info.getAppenders() == null || !info.getAppenders().isEmpty()) {
-                    appenders.put(root.getName(), info);
-                }
-            }
-        }
-
-        return appenders;
-    }
-
-    private static LoggerInfo doGetLoggerInfo(Logger logger) {
-        LoggerInfo info = new LoggerInfo(logger.getName(), logger.getAdditivity());
-        Level level = logger.getLevel(), effectiveLevel = logger.getEffectiveLevel();
-        if (level != null) {
-        	info.setLevel(level.toString());
-        }
-        if (effectiveLevel != null) {
-        	info.setEffectiveLevel(effectiveLevel.toString());
-        }
-
-        List result = doGetLoggerAppenders(logger.getAllAppenders());
-        info.setAppenders(result);
-        return info;
-    }
-
-    private static List doGetLoggerAppenders(Enumeration appenders) {
-        List result = new ArrayList();
-
-        while (appenders.hasMoreElements()) {
-            AppenderInfo info = new AppenderInfo();
-            Appender appender = appenders.nextElement();
-
-            info.setName(appender.getName());
-            info.setType(appender.getClass().getName());
-
-            result.add(info);
-            if (appender instanceof FileAppender) {
-                info.setFile(((FileAppender) appender).getFile());
-            } else if (appender instanceof ConsoleAppender) {
-                info.withDetail("target", ((ConsoleAppender) appender).getTarget());
-            } else if (appender instanceof AsyncAppender) {
-                List asyncs = doGetLoggerAppenders(((AsyncAppender) appender).getAllAppenders());
-                // 标明异步appender
-                List nestedNames = new ArrayList();
-                for (AppenderInfo a : asyncs) {
-                    nestedNames.add(a.getName());
-                    result.add(a);
-                }
-                info.withDetail("nestedNames", nestedNames);
-            }
-        }
-
-        return result;
-    }
-
-    private static void doSetDepth(LoggerRepository repo, int depth) {
-        if (repo instanceof ThrowableRendererSupport) {
-            Object tr = ((ThrowableRendererSupport) repo).getThrowableRenderer();
-            if (tr == null || !(tr instanceof DepthThrowableRenderer)) {
-                Object ctr = new DepthThrowableRenderer(depth);
-                // 自定义ThrowableRender,栈深度设置
-                ((ThrowableRendererSupport) repo).setThrowableRenderer((ThrowableRenderer) ctr);
-                LogLog.info("set log4j log depth success, depth: " + depth);
-            } else {
-                ((DepthThrowableRenderer) tr).setDepth(depth);
-                LogLog.info("set log4j log depth success, depth: " + depth);
-            }
-        }
-    }
-}
diff --git a/config/pom.xml b/config/pom.xml
index 495b0c361bc..0c974c098fe 100644
--- a/config/pom.xml
+++ b/config/pom.xml
@@ -119,7 +119,26 @@
             test
         
 
+        
+            org.mockito
+            mockito-core
+            test
+        
+
+        
+            org.springframework
+            spring-test
+            test
+        
+
+        
+            org.springframework.boot
+            spring-boot-test
+            test
+        
+
     
+
     
         
             
diff --git a/pom.xml b/pom.xml
index 2cba0f88527..1eb733b9184 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,705 +14,707 @@
   limitations under the License.
  -->
 
-
-	4.0.0
-	2018
-	com.alibaba.nacos
-	nacos-all
-	0.2.2-SNAPSHOT
-	pom
-
-	Alibaba NACOS ${project.version}
-	Top Nacos project pom.xml file
-	http://nacos.io
-	
-		3.2.5
-	
-
-
-	
-		git@github.com:alibaba/nacos.git
-		scm:git@github.com:alibaba/nacos.git
-		scm:git@github.com:alibaba/nacos.git
-		nacos-all-0.2.2-SNAPSHOT
-	
-
-	
-		
-			Development List
-			dev-nacos+subscribe@googlegroups.com
-			dev-nacos+unsubscribe@googlegroups.com
-			dev-nacos@googlegroups.com
-		
-		
-			User List
-			users-nacos+subscribe@googlegroups.com
-			users-nacos+unsubscribe@googlegroups.com
-			users-nacos@googlegroups.com
-		
-		
-			Commits List
-			commits-nacos+subscribe@googlegroups.com
-			commits-nacos+unsubscribe@googlegroups.com
-			commits-nacos@googlegroups.com
-		
-	
-
-	
-		
-			Alibaba Nacos
-			Nacos
-			http://nacos.io
-			nacos_dev@linux.alibaba.com
-		
-	
-
-	
-		
-			Apache License, Version 2.0
-			http://www.apache.org/licenses/LICENSE-2.0
-			repo
-		
-	
-
-	
-		Alibaba Group
-		https://github.com/alibaba
-	
-
-	
-		github
-		https://github.com/alibaba/nacos/issues
-	
-
-	
-		UTF-8
-		UTF-8
-
-		
-		false
-		true
-		
-		1.6
-		1.6
-		jacoco
-		
-		${project.basedir}/../test/target/jacoco-it.exec
-		file:**/generated-sources/**,**/test/**
-
-	
-	
-	
-	
-	
-		
-			
-				org.codehaus.mojo
-				versions-maven-plugin
-				2.2
-			
-			
-				com.github.vongosling
-				dependency-mediator-maven-plugin
-				1.0.2
-			
-			
-				org.codehaus.mojo
-				clirr-maven-plugin
-				2.7
-			
-			
-				maven-enforcer-plugin
-				1.4.1
-				
-					
-						enforce-ban-circular-dependencies
-						
-							enforce
-						
-					
-				
-				
-					
-						
-					
-					true
-				
-				
-					
-						org.codehaus.mojo
-						extra-enforcer-rules
-						1.0-beta-4
-					
-				
-			
-			
-				maven-compiler-plugin
-				3.5.1
-				
-					${maven.compiler.source}
-					${maven.compiler.target}
-					${maven.compiler.source}
-					true
-					true
-				
-			
-			
-				maven-javadoc-plugin
-				2.10.4
-				
-					UTF-8
-				
-				
-					
-						attach-javadocs
-						
-							jar
-						
-					
-				
-			
-			
-				maven-source-plugin
-				3.0.1
-				
-					
-						attach-sources
-						
-							jar
-						
-					
-				
-			
-			
-				org.apache.maven.plugins
-				maven-pmd-plugin
-				3.8
-				
-					
-						rulesets/java/ali-comment.xml
-						rulesets/java/ali-concurrent.xml
-						rulesets/java/ali-constant.xml
-						rulesets/java/ali-exception.xml
-						rulesets/java/ali-flowcontrol.xml
-						rulesets/java/ali-naming.xml
-						rulesets/java/ali-oop.xml
-						rulesets/java/ali-orm.xml
-						rulesets/java/ali-other.xml
-						rulesets/java/ali-set.xml
-					
-					true
-				
-				
-					
-						
-							check
-						
-					
-				
-				
-					
-						com.alibaba.p3c
-						p3c-pmd
-						1.3.0
-					
-				
-			
-			
-				org.apache.rat
-				apache-rat-plugin
-				0.12
-
-				
-
-					
-						.travis.yml
-						CONTRIBUTING.md
-						CHANGELOG.md
-						style/codeStyle.md
-						REPORTING-BUGS.md
-						README.md
-						.github/*
-						.github/ISSUE_TEMPLATE/bug_report.md
-						.github/ISSUE_TEMPLATE/feature_request.md
-						src/main/resources/*/*
-						src/main/resources/*
-						src/test/resources/*
-						bin/*
-						conf/*
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    4.0.0
+    2018
+    com.alibaba.nacos
+    nacos-all
+    0.2.2-SNAPSHOT
+    pom
+
+    Alibaba NACOS ${project.version}
+    Top Nacos project pom.xml file
+    http://nacos.io
+    
+        3.2.5
+    
+
+
+    
+        git@github.com:alibaba/nacos.git
+        scm:git@github.com:alibaba/nacos.git
+        scm:git@github.com:alibaba/nacos.git
+        nacos-all-0.2.2-SNAPSHOT
+    
+
+    
+        
+            Development List
+            dev-nacos+subscribe@googlegroups.com
+            dev-nacos+unsubscribe@googlegroups.com
+            dev-nacos@googlegroups.com
+        
+        
+            User List
+            users-nacos+subscribe@googlegroups.com
+            users-nacos+unsubscribe@googlegroups.com
+            users-nacos@googlegroups.com
+        
+        
+            Commits List
+            commits-nacos+subscribe@googlegroups.com
+            commits-nacos+unsubscribe@googlegroups.com
+            commits-nacos@googlegroups.com
+        
+    
+
+    
+        
+            Alibaba Nacos
+            Nacos
+            http://nacos.io
+            nacos_dev@linux.alibaba.com
+        
+    
+
+    
+        
+            Apache License, Version 2.0
+            http://www.apache.org/licenses/LICENSE-2.0
+            repo
+        
+    
+
+    
+        Alibaba Group
+        https://github.com/alibaba
+    
+
+    
+        github
+        https://github.com/alibaba/nacos/issues
+    
+
+    
+        UTF-8
+        UTF-8
+
+        
+        false
+        true
+        
+        1.6
+        1.6
+        jacoco
+        
+        ${project.basedir}/../test/target/jacoco-it.exec
+        file:**/generated-sources/**,**/test/**
+
+    
+    
+    
+    
+    
+        
+            
+                org.codehaus.mojo
+                versions-maven-plugin
+                2.2
+            
+            
+                com.github.vongosling
+                dependency-mediator-maven-plugin
+                1.0.2
+            
+            
+                org.codehaus.mojo
+                clirr-maven-plugin
+                2.7
+            
+            
+                maven-enforcer-plugin
+                1.4.1
+                
+                    
+                        enforce-ban-circular-dependencies
+                        
+                            enforce
+                        
+                    
+                
+                
+                    
+                        
+                    
+                    true
+                
+                
+                    
+                        org.codehaus.mojo
+                        extra-enforcer-rules
+                        1.0-beta-4
+                    
+                
+            
+            
+                maven-compiler-plugin
+                3.5.1
+                
+                    ${maven.compiler.source}
+                    ${maven.compiler.target}
+                    ${maven.compiler.source}
+                    true
+                    true
+                
+            
+            
+                maven-javadoc-plugin
+                2.10.4
+                
+                    UTF-8
+                
+                
+                    
+                        attach-javadocs
+                        
+                            jar
+                        
+                    
+                
+            
+            
+                maven-source-plugin
+                3.0.1
+                
+                    
+                        attach-sources
+                        
+                            jar
+                        
+                    
+                
+            
+            
+                org.apache.maven.plugins
+                maven-pmd-plugin
+                3.8
+                
+                    
+                        rulesets/java/ali-comment.xml
+                        rulesets/java/ali-concurrent.xml
+                        rulesets/java/ali-constant.xml
+                        rulesets/java/ali-exception.xml
+                        rulesets/java/ali-flowcontrol.xml
+                        rulesets/java/ali-naming.xml
+                        rulesets/java/ali-oop.xml
+                        rulesets/java/ali-orm.xml
+                        rulesets/java/ali-other.xml
+                        rulesets/java/ali-set.xml
+                    
+                    true
+                
+                
+                    
+                        
+                            check
+                        
+                    
+                
+                
+                    
+                        com.alibaba.p3c
+                        p3c-pmd
+                        1.3.0
+                    
+                
+            
+            
+                org.apache.rat
+                apache-rat-plugin
+                0.12
+
+                
+
+                    
+                        .travis.yml
+                        CONTRIBUTING.md
+                        CHANGELOG.md
+                        style/codeStyle.md
+                        REPORTING-BUGS.md
+                        README.md
+                        .github/*
+                        .github/ISSUE_TEMPLATE/bug_report.md
+                        .github/ISSUE_TEMPLATE/feature_request.md
+                        src/main/resources/*/*
+                        src/main/resources/*
+                        src/test/resources/*
+                        bin/*
+                        conf/*
                         derby.log
 
-					
-				
-			
-			
-				maven-resources-plugin
-				3.0.2
-				
-					
-					${project.build.sourceEncoding}
-				
-			
-			
-				org.eluder.coveralls
-				coveralls-maven-plugin
-				4.3.0
-			
-			
-				org.jacoco
-				jacoco-maven-plugin
-				0.7.8
-				
-					
-						default-prepare-agent
-						
-							prepare-agent
-						
-						
-							${project.build.directory}/jacoco.exec
-						
-					
-					
-						default-prepare-agent-integration
-						pre-integration-test
-						
-							prepare-agent-integration
-						
-						
-							${project.build.directory}/jacoco-it.exec
-							failsafeArgLine
-						
-					
-					
-						default-report
-						
-							report
-						
-					
-					
-						default-report-integration
-						
-							report-integration
-						
-					
-				
-			
-			
-				maven-surefire-plugin
-				2.19.1
-				
-					1
-					true
-				
-			
-			
-				org.codehaus.mojo
-				findbugs-maven-plugin
-				3.0.4
-			
-			
-				org.sonarsource.scanner.maven
-				sonar-maven-plugin
-				3.0.2
-			
-		
-
-	
-
-	
-		
-			jdk7
-			
-				[1.7,)
-			
-			
-			
-				
-					
-						maven-javadoc-plugin
-						2.10.4
-						
-							-Xdoclint:none
-						
-					
-				
-			
-			
-				
-					
-						maven-javadoc-plugin
-						2.10.4
-						
-							-Xdoclint:none
-						
-					
-				
-			
-		
-		
-			release-sign-artifacts
-			
-				
-					performRelease
-					true
-				
-			
-			
-				
-					
-						maven-gpg-plugin
-						1.6
-						
-							
-								sign-artifacts
-								verify
-								
-									sign
-								
-							
-						
-					
-				
-			
-		
-		
-			it-test
-			
-				
-					
-						maven-failsafe-plugin
-						2.19.1
-						
-							@{failsafeArgLine}
-							-Dnacos.standalone=true
-							
-								**/*ITCase.java
-							
-							
-								**/RestAPI_ITCase.java
-							
-						
-						
-							
-								
-									integration-test
-									verify
-								
-							
-						
-					
-				
-			
-		
-		
-			sonar-apache
-			
-				
-				https://builds.apache.org/analysis
-			
-		
-	
-	
-		
-			
-				org.codehaus.mojo
-				findbugs-maven-plugin
-				3.0.1
-			
-		
-	
-
-	
-	
-		config
-		core
-		naming
-		test
-		api
-		client
-		example
-		common
-		distribution
-		console
-	
-
-	
-	
-		
-			org.springframework.boot
-			spring-boot-starter-test
-			test
-		
-	
-
-	
-	
-		
-			
-				
-				org.springframework.boot
-				spring-boot-dependencies
-				2.0.5.RELEASE
-				pom
-				import
-			
-
-			
-				${project.groupId}
-				nacos-config
-				${project.version}
-			
-			
-				${project.groupId}
-				nacos-core
-				${project.version}
-			
-			
-				${project.groupId}
-				nacos-naming
-				${project.version}
-			
-			
-				${project.groupId}
-				nacos-api
-				${project.version}
-			
-			
-				${project.groupId}
-				nacos-client
-				${project.version}
-			
-			
-				${project.groupId}
-				nacos-test
-				${project.version}
-			
-			
-				${project.groupId}
-				nacos-common
-				${project.version}
-			
-			
-				${project.groupId}
-				nacos-console
-				${project.version}
-			
-			
-				${project.groupId}
-				nacos-distribution
-				${project.version}
-			
-			
-				${project.groupId}
-				nacos-example
-				${project.version}
-			
-			
-				org.slf4j
-				slf4j-api
-				1.7.7
-			
-			
-				ch.qos.logback
-				logback-classic
-				1.2.3
-			
-			
-				ch.qos.logback
-				logback-core
-				1.2.3
-			
-			
-				commons-cli
-				commons-cli
-				1.2
-			
-			
-				io.netty
-				netty-all
-				4.0.42.Final
-			
-			
-				com.alibaba
-				fastjson
-				1.2.47
-			
-			
-				com.ning
-				async-http-client
-				1.7.17
-			
-			
-				org.apache.commons
-				commons-lang3
-				3.4
-			
-			
-				commons-lang
-				commons-lang
-				2.6
-			
-			
-				commons-collections
-				commons-collections
-				3.2.2
-			
-			
-				commons-logging
-				commons-logging
-				1.2
-			
-			
-				org.codehaus.jackson
-				jackson-core-asl
-				1.9.10
-			
-			
-				apache-log4j
-				log4j
-				1.2.15
-			
-			
-				log4j
-				log4j
-				1.2.17
-			
-			
-				org.apache.logging.log4j
-				log4j-core
-				2.10.0
-			
-			
-				org.apache.logging.log4j
-				log4j-slf4j-impl
-				2.10.0
-			
-			
-				com.github.spotbugs
-				spotbugs-annotations
-				3.1.3
-			
-			
-
-			
-				javax.ws.rs
-				javax.ws.rs
-				2.1
-			
-			
-				javax.servlet
-				servlet-api
-				3.0
-				provided
-			
-			
-				taglibs
-				standard
-				1.1.2
-			
-
-			
-				commons-io
-				commons-io
-				2.2
-			
-			
-				mysql
-				mysql-connector-java
-				5.1.34
-			
-
-			
-				commons-dbcp
-				commons-dbcp
-				1.4
-			
-
-			
-				org.apache.derby
-				derby
-				10.10.1.1
-			
-
-			
-				cglib
-				cglib-nodep
-				2.1
-			
-			
-				org.apache.httpcomponents
-				httpasyncclient
-				4.1.3
-			
-			
-				net.jcip
-				jcip-annotations
-				1.0
-			
-			
-				org.codehaus.jackson
-				jackson-mapper-lgpl
-				1.9.6
-			
-			
-
-
-			
-			
-				org.apache.mina
-				mina-core
-				2.0.0-RC1
-			
-			
-				com.google.guava
-				guava
-				19.0
-			
-			
-				org.javatuples
-				javatuples
-				1.2
-			
-			
-				org.apache.velocity
-				velocity
-				1.7
-			
-			
-				org.apache.velocity
-				velocity-tools
-				2.0
-				
-					
-						commons-logging
-						commons-logging
-					
-					
-						commons-digester
-						commons-digester
-					
-				
-			
-			
-				org.apache.httpcomponents
-				httpcore
-				4.4.1
-			
-			
-				org.apache.httpcomponents
-				httpclient
-				4.5
-				
-					
-						commons-logging
-						commons-logging
-					
-				
-			
-			
-		
-	
+                    
+                
+            
+            
+                maven-resources-plugin
+                3.0.2
+                
+                    
+                    ${project.build.sourceEncoding}
+                
+            
+            
+                org.eluder.coveralls
+                coveralls-maven-plugin
+                4.3.0
+            
+            
+                org.jacoco
+                jacoco-maven-plugin
+                0.7.8
+                
+                    
+                        default-prepare-agent
+                        
+                            prepare-agent
+                        
+                        
+                            ${project.build.directory}/jacoco.exec
+                        
+                    
+                    
+                        default-prepare-agent-integration
+                        pre-integration-test
+                        
+                            prepare-agent-integration
+                        
+                        
+                            ${project.build.directory}/jacoco-it.exec
+                            failsafeArgLine
+                        
+                    
+                    
+                        default-report
+                        
+                            report
+                        
+                    
+                    
+                        default-report-integration
+                        
+                            report-integration
+                        
+                    
+                
+            
+            
+                maven-surefire-plugin
+                2.19.1
+                
+                    1
+                    true
+                
+            
+            
+                org.codehaus.mojo
+                findbugs-maven-plugin
+                3.0.4
+            
+            
+                org.sonarsource.scanner.maven
+                sonar-maven-plugin
+                3.0.2
+            
+        
+
+    
+
+    
+        
+            jdk7
+            
+                [1.7,)
+            
+            
+            
+                
+                    
+                        maven-javadoc-plugin
+                        2.10.4
+                        
+                            -Xdoclint:none
+                        
+                    
+                
+            
+            
+                
+                    
+                        maven-javadoc-plugin
+                        2.10.4
+                        
+                            -Xdoclint:none
+                        
+                    
+                
+            
+        
+        
+            release-sign-artifacts
+            
+                
+                    performRelease
+                    true
+                
+            
+            
+                
+                    
+                        maven-gpg-plugin
+                        1.6
+                        
+                            
+                                sign-artifacts
+                                verify
+                                
+                                    sign
+                                
+                            
+                        
+                    
+                
+            
+        
+        
+            it-test
+            
+                
+                    
+                        maven-failsafe-plugin
+                        2.19.1
+                        
+                            @{failsafeArgLine}
+                            -Dnacos.standalone=true
+                            
+                                **/*ITCase.java
+                            
+                            
+                                **/RestAPI_ITCase.java
+                            
+                        
+                        
+                            
+                                
+                                    integration-test
+                                    verify
+                                
+                            
+                        
+                    
+                
+            
+        
+        
+            sonar-apache
+            
+                
+                https://builds.apache.org/analysis
+            
+        
+    
+    
+        
+            
+                org.codehaus.mojo
+                findbugs-maven-plugin
+                3.0.1
+            
+        
+    
+
+    
+    
+        config
+        core
+        naming
+        test
+        api
+        client
+        example
+        common
+        distribution
+        console
+    
+
+    
+    
+
+        
+            junit
+            junit
+            test
+        
+
+    
+
+    
+    
+        
+            
+                
+                org.springframework.boot
+                spring-boot-dependencies
+                2.0.5.RELEASE
+                pom
+                import
+            
+
+            
+                ${project.groupId}
+                nacos-config
+                ${project.version}
+            
+            
+                ${project.groupId}
+                nacos-core
+                ${project.version}
+            
+            
+                ${project.groupId}
+                nacos-naming
+                ${project.version}
+            
+            
+                ${project.groupId}
+                nacos-api
+                ${project.version}
+            
+            
+                ${project.groupId}
+                nacos-client
+                ${project.version}
+            
+            
+                ${project.groupId}
+                nacos-test
+                ${project.version}
+            
+            
+                ${project.groupId}
+                nacos-common
+                ${project.version}
+            
+            
+                ${project.groupId}
+                nacos-console
+                ${project.version}
+            
+            
+                ${project.groupId}
+                nacos-distribution
+                ${project.version}
+            
+            
+                ${project.groupId}
+                nacos-example
+                ${project.version}
+            
+            
+                org.slf4j
+                slf4j-api
+                1.7.7
+            
+            
+                ch.qos.logback
+                logback-classic
+                1.2.3
+            
+            
+                ch.qos.logback
+                logback-core
+                1.2.3
+            
+            
+                commons-cli
+                commons-cli
+                1.2
+            
+            
+                io.netty
+                netty-all
+                4.0.42.Final
+            
+            
+                com.alibaba
+                fastjson
+                1.2.47
+            
+            
+                com.ning
+                async-http-client
+                1.7.17
+            
+            
+                org.apache.commons
+                commons-lang3
+                3.4
+            
+            
+                commons-lang
+                commons-lang
+                2.6
+            
+            
+                commons-collections
+                commons-collections
+                3.2.2
+            
+            
+                commons-logging
+                commons-logging
+                1.2
+            
+            
+                org.codehaus.jackson
+                jackson-core-asl
+                1.9.10
+            
+            
+                apache-log4j
+                log4j
+                1.2.15
+            
+            
+                log4j
+                log4j
+                1.2.17
+            
+            
+                org.apache.logging.log4j
+                log4j-core
+                2.10.0
+            
+            
+                org.apache.logging.log4j
+                log4j-slf4j-impl
+                2.10.0
+            
+            
+                com.github.spotbugs
+                spotbugs-annotations
+                3.1.3
+            
+            
+
+            
+                javax.ws.rs
+                javax.ws.rs
+                2.1
+            
+            
+                javax.servlet
+                servlet-api
+                3.0
+                provided
+            
+            
+                taglibs
+                standard
+                1.1.2
+            
+
+            
+                commons-io
+                commons-io
+                2.2
+            
+            
+                mysql
+                mysql-connector-java
+                5.1.34
+            
+
+            
+                commons-dbcp
+                commons-dbcp
+                1.4
+            
+
+            
+                org.apache.derby
+                derby
+                10.10.1.1
+            
+
+            
+                cglib
+                cglib-nodep
+                2.1
+            
+            
+                org.apache.httpcomponents
+                httpasyncclient
+                4.1.3
+            
+            
+                net.jcip
+                jcip-annotations
+                1.0
+            
+            
+                org.codehaus.jackson
+                jackson-mapper-lgpl
+                1.9.6
+            
+            
+
+
+            
+            
+                org.apache.mina
+                mina-core
+                2.0.0-RC1
+            
+            
+                com.google.guava
+                guava
+                19.0
+            
+            
+                org.javatuples
+                javatuples
+                1.2
+            
+            
+                org.apache.velocity
+                velocity
+                1.7
+            
+            
+                org.apache.velocity
+                velocity-tools
+                2.0
+                
+                    
+                        commons-logging
+                        commons-logging
+                    
+                    
+                        commons-digester
+                        commons-digester
+                    
+                
+            
+            
+                org.apache.httpcomponents
+                httpcore
+                4.4.1
+            
+            
+                org.apache.httpcomponents
+                httpclient
+                4.5
+                
+                    
+                        commons-logging
+                        commons-logging
+                    
+                
+            
+            
+        
+    
 
 
diff --git a/test/pom.xml b/test/pom.xml
index ec33a71e9ee..ffffc016d26 100644
--- a/test/pom.xml
+++ b/test/pom.xml
@@ -73,6 +73,24 @@
 			${project.groupId}
 			nacos-core
 		
+
+		
+			junit
+			junit
+			test
+		
+
+		
+			org.springframework
+			spring-test
+			test
+		
+
+		
+			org.springframework.boot
+			spring-boot-test
+			test
+