From 7a3e9fd17b8d588b11b33c8c13e5312cc0c853d6 Mon Sep 17 00:00:00 2001 From: hxy1991 Date: Thu, 15 Nov 2018 22:45:53 +0800 Subject: [PATCH 1/3] Fixes #222 --- .../LoggingSpringApplicationRunListener.java | 32 ---- .../StartingSpringApplicationRunListener.java | 166 ++++++++++++++++++ .../main/resources/META-INF/logback/nacos.xml | 4 + .../main/resources/META-INF/spring.factories | 3 +- distribution/bin/startup.sh | 18 +- distribution/conf/nacos-logback.xml | 49 +++--- 6 files changed, 212 insertions(+), 60 deletions(-) create mode 100644 core/src/main/java/com/alibaba/nacos/core/listener/StartingSpringApplicationRunListener.java diff --git a/core/src/main/java/com/alibaba/nacos/core/listener/LoggingSpringApplicationRunListener.java b/core/src/main/java/com/alibaba/nacos/core/listener/LoggingSpringApplicationRunListener.java index e72b5aa3d..686f12b68 100644 --- a/core/src/main/java/com/alibaba/nacos/core/listener/LoggingSpringApplicationRunListener.java +++ b/core/src/main/java/com/alibaba/nacos/core/listener/LoggingSpringApplicationRunListener.java @@ -25,13 +25,6 @@ import org.springframework.context.ConfigurableApplicationContext; import org.springframework.core.Ordered; import org.springframework.core.env.ConfigurableEnvironment; -import java.io.IOException; -import java.util.List; - -import static com.alibaba.nacos.common.util.SystemUtils.LOCAL_IP; -import static com.alibaba.nacos.common.util.SystemUtils.NACOS_HOME; -import static com.alibaba.nacos.common.util.SystemUtils.STANDALONE_MODE; -import static com.alibaba.nacos.common.util.SystemUtils.readClusterConf; import static org.springframework.boot.context.logging.LoggingApplicationListener.CONFIG_PROPERTY; import static org.springframework.core.io.ResourceLoader.CLASSPATH_URL_PREFIX; @@ -47,10 +40,6 @@ public class LoggingSpringApplicationRunListener implements SpringApplicationRun private static final Logger logger = LoggerFactory.getLogger(LoggingSpringApplicationRunListener.class); - private static final String MODE_PROPERTY_KEY = "nacos.mode"; - - private static final String LOCAL_IP_PROPERTY_KEY = "nacos.local.ip"; - private final SpringApplication application; private final String[] args; @@ -75,32 +64,11 @@ public class LoggingSpringApplicationRunListener implements SpringApplicationRun DEFAULT_NACOS_LOGBACK_LOCATION); } } - - if (STANDALONE_MODE) { - System.setProperty(MODE_PROPERTY_KEY, "stand alone"); - } else { - System.setProperty(MODE_PROPERTY_KEY, "cluster"); - } - - System.setProperty(LOCAL_IP_PROPERTY_KEY, LOCAL_IP); } @Override public void contextPrepared(ConfigurableApplicationContext context) { - System.out.printf("Log files: %s/logs/%n", NACOS_HOME); - System.out.printf("Conf files: %s/conf/%n", NACOS_HOME); - System.out.printf("Data files: %s/data/%n", NACOS_HOME); - if (!STANDALONE_MODE) { - try { - List clusterConf = readClusterConf(); - System.out.printf("The server IP list of Nacos is %s%n", clusterConf); - } catch (IOException e) { - logger.error("read cluster conf fail", e); - } - } - - System.out.println(); } @Override diff --git a/core/src/main/java/com/alibaba/nacos/core/listener/StartingSpringApplicationRunListener.java b/core/src/main/java/com/alibaba/nacos/core/listener/StartingSpringApplicationRunListener.java new file mode 100644 index 000000000..dcd96d002 --- /dev/null +++ b/core/src/main/java/com/alibaba/nacos/core/listener/StartingSpringApplicationRunListener.java @@ -0,0 +1,166 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.core.listener; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.SpringApplicationRunListener; +import org.springframework.boot.context.event.EventPublishingRunListener; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.core.Ordered; +import org.springframework.core.env.ConfigurableEnvironment; + +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.TimeUnit; + +import static com.alibaba.nacos.common.util.SystemUtils.LOCAL_IP; +import static com.alibaba.nacos.common.util.SystemUtils.NACOS_HOME; +import static com.alibaba.nacos.common.util.SystemUtils.STANDALONE_MODE; +import static com.alibaba.nacos.common.util.SystemUtils.readClusterConf; + +/** + * Logging starting message {@link SpringApplicationRunListener} before {@link EventPublishingRunListener} execution + * + * @author hxy1991 + * @since 0.5.0 + */ +public class StartingSpringApplicationRunListener implements SpringApplicationRunListener, Ordered { + + private static final Logger LOGGER = LoggerFactory.getLogger(StartingSpringApplicationRunListener.class); + + private static final String MODE_PROPERTY_KEY = "nacos.mode"; + + private static final String LOCAL_IP_PROPERTY_KEY = "nacos.local.ip"; + + private ScheduledExecutorService scheduledExecutorService; + + private volatile boolean starting; + + public StartingSpringApplicationRunListener(SpringApplication application, String[] args) { + + } + + @Override + public void starting() { + starting = true; + } + + @Override + public void environmentPrepared(ConfigurableEnvironment environment) { + if (STANDALONE_MODE) { + System.setProperty(MODE_PROPERTY_KEY, "stand alone"); + } else { + System.setProperty(MODE_PROPERTY_KEY, "cluster"); + } + + System.setProperty(LOCAL_IP_PROPERTY_KEY, LOCAL_IP); + } + + @Override + public void contextPrepared(ConfigurableApplicationContext context) { + logClusterConf(); + + logStarting(); + } + + @Override + public void contextLoaded(ConfigurableApplicationContext context) { + + } + + @Override + public void started(ConfigurableApplicationContext context) { + starting = false; + + if (scheduledExecutorService != null) { + scheduledExecutorService.shutdownNow(); + } + + logFilePath(); + + LOGGER.info("Nacos started successfully in {} mode.", System.getProperty(MODE_PROPERTY_KEY)); + } + + @Override + public void running(ConfigurableApplicationContext context) { + + } + + @Override + public void failed(ConfigurableApplicationContext context, Throwable exception) { + starting = false; + + logFilePath(); + + LOGGER.error("Nacos failed to start, please see {}/logs/nacos.log for more details.", NACOS_HOME); + } + + /** + * Before {@link EventPublishingRunListener} + * + * @return HIGHEST_PRECEDENCE + */ + @Override + public int getOrder() { + return HIGHEST_PRECEDENCE; + } + + private void logClusterConf() { + if (!STANDALONE_MODE) { + try { + List clusterConf = readClusterConf(); + LOGGER.info("The server IP list of Nacos is {}", clusterConf); + } catch (IOException e) { + LOGGER.error("read cluster conf fail", e); + } + } + } + + private void logFilePath() { + LOGGER.info("Nacos Log files: {}/logs/", NACOS_HOME); + LOGGER.info("Nacos Conf files: {}/conf/", NACOS_HOME); + LOGGER.info("Nacos Data files: {}/data/", NACOS_HOME); + } + + private void logStarting() { + if (!STANDALONE_MODE) { + + scheduledExecutorService = new ScheduledThreadPoolExecutor(1, new ThreadFactory() { + @Override + public Thread newThread(Runnable r) { + Thread thread = new Thread(r, "nacos-starting"); + thread.setDaemon(true); + return thread; + } + }); + + scheduledExecutorService.scheduleWithFixedDelay(new Runnable() { + @Override + public void run() { + if (starting) { + LOGGER.info("Nacos is starting..."); + } + } + }, 1, 1, TimeUnit.SECONDS); + } + } +} diff --git a/core/src/main/resources/META-INF/logback/nacos.xml b/core/src/main/resources/META-INF/logback/nacos.xml index dde233f78..4d69b0083 100644 --- a/core/src/main/resources/META-INF/logback/nacos.xml +++ b/core/src/main/resources/META-INF/logback/nacos.xml @@ -63,4 +63,8 @@ + + + + diff --git a/core/src/main/resources/META-INF/spring.factories b/core/src/main/resources/META-INF/spring.factories index 51c264778..33b9126cd 100644 --- a/core/src/main/resources/META-INF/spring.factories +++ b/core/src/main/resources/META-INF/spring.factories @@ -8,4 +8,5 @@ com.alibaba.nacos.core.env.NacosDefaultPropertySourceEnvironmentPostProcessor # SpringApplicationRunListener org.springframework.boot.SpringApplicationRunListener=\ -com.alibaba.nacos.core.listener.LoggingSpringApplicationRunListener \ No newline at end of file +com.alibaba.nacos.core.listener.LoggingSpringApplicationRunListener,\ +com.alibaba.nacos.core.listener.StartingSpringApplicationRunListener \ No newline at end of file diff --git a/distribution/bin/startup.sh b/distribution/bin/startup.sh index d0ddf5394..ee6226d39 100644 --- a/distribution/bin/startup.sh +++ b/distribution/bin/startup.sh @@ -63,11 +63,17 @@ JAVA_OPT="${JAVA_OPT} --logging.config=${BASE_DIR}/conf/nacos-logback.xml" if [ ! -d "${BASE_DIR}/logs" ]; then mkdir ${BASE_DIR}/logs fi -if [ ! -f "${BASE_DIR}/logs/start.log" ]; then - touch "${BASE_DIR}/logs/start.log" -fi echo "$JAVA ${JAVA_OPT}" -echo "$JAVA ${JAVA_OPT}" > ${BASE_DIR}/logs/start.log 2>&1 & -nohup $JAVA ${JAVA_OPT} >> ${BASE_DIR}/logs/start.log 2>&1 & -echo "nacos is starting,you can check the ${BASE_DIR}/logs/start.log" \ No newline at end of file + +if [[ "${MODE}" == "standalone" ]]; then + $JAVA ${JAVA_OPT} +else + if [ ! -f "${BASE_DIR}/logs/start.out" ]; then + touch "${BASE_DIR}/logs/start.out" + fi + + echo "$JAVA ${JAVA_OPT}" >> ${BASE_DIR}/logs/start.out 2>&1 & + nohup $JAVA ${JAVA_OPT} >> ${BASE_DIR}/logs/start.out 2>&1 & + echo "nacos is starting,you can check the ${BASE_DIR}/logs/start.out" +fi \ No newline at end of file diff --git a/distribution/conf/nacos-logback.xml b/distribution/conf/nacos-logback.xml index 796050ef8..07b6c91eb 100644 --- a/distribution/conf/nacos-logback.xml +++ b/distribution/conf/nacos-logback.xml @@ -524,31 +524,38 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - From c6a32e5357ccd47725d0e7b80dafd44d310ef1f6 Mon Sep 17 00:00:00 2001 From: hxy1991 Date: Fri, 16 Nov 2018 00:29:41 +0800 Subject: [PATCH 2/3] Fixes "unapproved license" issue --- pom.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b1f06ed02..9a6d55763 100644 --- a/pom.xml +++ b/pom.xml @@ -242,7 +242,10 @@ src/main/resources/static/**/*.js src/main/resources/**/*.svg src/main/resources/static/public/css/console1412.css - src/main/resources/static/public/js/vs/editor/editor.main.css + /src/main/resources/static/js/vs/editor/editor.main.css + src/main/resources/static/console-fe/public/css/console1412.css + src/main/resources/static/console-fe/public/js/vs/editor/editor.main.css + src/main/resources/static/console-fe/.vscode/settings.json bin/* conf/* derby.log From af21897608679939d08d7c1060071f12bdf084e0 Mon Sep 17 00:00:00 2001 From: hxy1991 Date: Fri, 16 Nov 2018 10:28:28 +0800 Subject: [PATCH 3/3] correct license --- .../nacos/api/annotation/NacosInjected.java | 13 +++++---- .../nacos/api/annotation/NacosProperties.java | 13 +++++---- .../annotation/NacosConfigListener.java | 13 +++++---- .../NacosConfigurationProperties.java | 13 +++++---- .../api/config/annotation/NacosIgnore.java | 13 +++++---- .../api/config/annotation/NacosProperty.java | 13 +++++---- .../api/config/annotation/NacosValue.java | 13 +++++---- .../config/convert/NacosConfigConverter.java | 13 +++++---- .../api/annotation/NacosPropertiesTest.java | 13 +++++---- .../alibaba/nacos/client/identify/Base64.java | 27 +++++-------------- .../client/naming/utils/CollectionUtils.java | 25 ++++------------- .../nacos/client/naming/utils/JvmRandom.java | 15 ----------- .../client/naming/utils/RandomUtils.java | 15 ----------- .../alibaba/nacos/common/util/Constants.java | 13 +++++---- .../alibaba/nacos/common/SystemUtilsTest.java | 13 +++++---- .../NacosConfigConfiguration.java | 13 +++++---- .../config/server/constant/ConstantsTest.java | 13 +++++---- ...ropertySourceEnvironmentPostProcessor.java | 13 +++++---- .../LoggingSpringApplicationRunListener.java | 13 +++++---- .../StandaloneProfileApplicationListener.java | 13 +++++---- .../StartingSpringApplicationRunListener.java | 13 +++++---- ...rtySourceEnvironmentPostProcessorTest.java | 13 +++++---- ...ndaloneProfileApplicationListenerTest.java | 13 +++++---- .../naming/misc/UtilsAndCommonsTest.java | 13 +++++---- .../nacos/test/smoke/nacosSmoke_ITCase.java | 16 ----------- test/src/test/resources/logback-test.xml | 23 ++++++++-------- 26 files changed, 142 insertions(+), 239 deletions(-) diff --git a/api/src/main/java/com/alibaba/nacos/api/annotation/NacosInjected.java b/api/src/main/java/com/alibaba/nacos/api/annotation/NacosInjected.java index ac8ec7765..ba9d636bc 100644 --- a/api/src/main/java/com/alibaba/nacos/api/annotation/NacosInjected.java +++ b/api/src/main/java/com/alibaba/nacos/api/annotation/NacosInjected.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/api/src/main/java/com/alibaba/nacos/api/annotation/NacosProperties.java b/api/src/main/java/com/alibaba/nacos/api/annotation/NacosProperties.java index fad6d66aa..a6bd2ad6d 100644 --- a/api/src/main/java/com/alibaba/nacos/api/annotation/NacosProperties.java +++ b/api/src/main/java/com/alibaba/nacos/api/annotation/NacosProperties.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosConfigListener.java b/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosConfigListener.java index aad64b87a..5651a4829 100644 --- a/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosConfigListener.java +++ b/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosConfigListener.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosConfigurationProperties.java b/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosConfigurationProperties.java index 2cd57f19b..760c351cd 100644 --- a/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosConfigurationProperties.java +++ b/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosConfigurationProperties.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosIgnore.java b/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosIgnore.java index 99d65c98b..0ca6c4aa7 100644 --- a/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosIgnore.java +++ b/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosIgnore.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosProperty.java b/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosProperty.java index 2be36cbd8..0f24e5762 100644 --- a/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosProperty.java +++ b/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosProperty.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosValue.java b/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosValue.java index b9dbdbd6f..a77ac669e 100644 --- a/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosValue.java +++ b/api/src/main/java/com/alibaba/nacos/api/config/annotation/NacosValue.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/api/src/main/java/com/alibaba/nacos/api/config/convert/NacosConfigConverter.java b/api/src/main/java/com/alibaba/nacos/api/config/convert/NacosConfigConverter.java index 83a2265c9..a277cc9b4 100644 --- a/api/src/main/java/com/alibaba/nacos/api/config/convert/NacosConfigConverter.java +++ b/api/src/main/java/com/alibaba/nacos/api/config/convert/NacosConfigConverter.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/api/src/test/java/com/alibaba/nacos/api/annotation/NacosPropertiesTest.java b/api/src/test/java/com/alibaba/nacos/api/annotation/NacosPropertiesTest.java index 1bc18fc55..53ed76539 100644 --- a/api/src/test/java/com/alibaba/nacos/api/annotation/NacosPropertiesTest.java +++ b/api/src/test/java/com/alibaba/nacos/api/annotation/NacosPropertiesTest.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/client/src/main/java/com/alibaba/nacos/client/identify/Base64.java b/client/src/main/java/com/alibaba/nacos/client/identify/Base64.java index 57877a30f..590c6ca56 100644 --- a/client/src/main/java/com/alibaba/nacos/client/identify/Base64.java +++ b/client/src/main/java/com/alibaba/nacos/client/identify/Base64.java @@ -1,9 +1,10 @@ /* - * 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 + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 * @@ -14,22 +15,6 @@ * limitations under the License. */ package com.alibaba.nacos.client.identify; -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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. - */ import java.io.UnsupportedEncodingException; diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/utils/CollectionUtils.java b/client/src/main/java/com/alibaba/nacos/client/naming/utils/CollectionUtils.java index 438013664..23270c51b 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/utils/CollectionUtils.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/utils/CollectionUtils.java @@ -1,23 +1,3 @@ -/* - * 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.naming.utils; - -/** - * Created by harold on 2015/12/7. - */ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -34,6 +14,11 @@ package com.alibaba.nacos.client.naming.utils; * See the License for the specific language governing permissions and * limitations under the License. */ +package com.alibaba.nacos.client.naming.utils; + +/** + * Created by harold on 2015/12/7. + */ import java.util.*; diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/utils/JvmRandom.java b/client/src/main/java/com/alibaba/nacos/client/naming/utils/JvmRandom.java index 71a8b578a..6252829ba 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/utils/JvmRandom.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/utils/JvmRandom.java @@ -1,18 +1,3 @@ -/* - * 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. - */ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/utils/RandomUtils.java b/client/src/main/java/com/alibaba/nacos/client/naming/utils/RandomUtils.java index 443225749..77dac5eca 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/utils/RandomUtils.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/utils/RandomUtils.java @@ -1,18 +1,3 @@ -/* - * 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. - */ /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file diff --git a/common/src/main/java/com/alibaba/nacos/common/util/Constants.java b/common/src/main/java/com/alibaba/nacos/common/util/Constants.java index 2150b05d3..92b044af5 100644 --- a/common/src/main/java/com/alibaba/nacos/common/util/Constants.java +++ b/common/src/main/java/com/alibaba/nacos/common/util/Constants.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/common/src/test/java/com/alibaba/nacos/common/SystemUtilsTest.java b/common/src/test/java/com/alibaba/nacos/common/SystemUtilsTest.java index 50223641f..84d983533 100644 --- a/common/src/test/java/com/alibaba/nacos/common/SystemUtilsTest.java +++ b/common/src/test/java/com/alibaba/nacos/common/SystemUtilsTest.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/config/src/main/java/com/alibaba/nacos/config/server/configuration/NacosConfigConfiguration.java b/config/src/main/java/com/alibaba/nacos/config/server/configuration/NacosConfigConfiguration.java index 383379b0a..c2966ef26 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/configuration/NacosConfigConfiguration.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/configuration/NacosConfigConfiguration.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/config/src/test/java/com/alibaba/nacos/config/server/constant/ConstantsTest.java b/config/src/test/java/com/alibaba/nacos/config/server/constant/ConstantsTest.java index 0db331ffa..c789f9c8f 100644 --- a/config/src/test/java/com/alibaba/nacos/config/server/constant/ConstantsTest.java +++ b/config/src/test/java/com/alibaba/nacos/config/server/constant/ConstantsTest.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/core/src/main/java/com/alibaba/nacos/core/env/NacosDefaultPropertySourceEnvironmentPostProcessor.java b/core/src/main/java/com/alibaba/nacos/core/env/NacosDefaultPropertySourceEnvironmentPostProcessor.java index eaf7594b2..d3a6a2970 100644 --- a/core/src/main/java/com/alibaba/nacos/core/env/NacosDefaultPropertySourceEnvironmentPostProcessor.java +++ b/core/src/main/java/com/alibaba/nacos/core/env/NacosDefaultPropertySourceEnvironmentPostProcessor.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/core/src/main/java/com/alibaba/nacos/core/listener/LoggingSpringApplicationRunListener.java b/core/src/main/java/com/alibaba/nacos/core/listener/LoggingSpringApplicationRunListener.java index 686f12b68..64336df6f 100644 --- a/core/src/main/java/com/alibaba/nacos/core/listener/LoggingSpringApplicationRunListener.java +++ b/core/src/main/java/com/alibaba/nacos/core/listener/LoggingSpringApplicationRunListener.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/core/src/main/java/com/alibaba/nacos/core/listener/StandaloneProfileApplicationListener.java b/core/src/main/java/com/alibaba/nacos/core/listener/StandaloneProfileApplicationListener.java index 6faf8e0d7..c32c9b817 100644 --- a/core/src/main/java/com/alibaba/nacos/core/listener/StandaloneProfileApplicationListener.java +++ b/core/src/main/java/com/alibaba/nacos/core/listener/StandaloneProfileApplicationListener.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/core/src/main/java/com/alibaba/nacos/core/listener/StartingSpringApplicationRunListener.java b/core/src/main/java/com/alibaba/nacos/core/listener/StartingSpringApplicationRunListener.java index dcd96d002..aeac541ee 100644 --- a/core/src/main/java/com/alibaba/nacos/core/listener/StartingSpringApplicationRunListener.java +++ b/core/src/main/java/com/alibaba/nacos/core/listener/StartingSpringApplicationRunListener.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/core/src/test/java/com/alibaba/nacos/core/env/NacosDefaultPropertySourceEnvironmentPostProcessorTest.java b/core/src/test/java/com/alibaba/nacos/core/env/NacosDefaultPropertySourceEnvironmentPostProcessorTest.java index 761fdec62..019437f72 100644 --- a/core/src/test/java/com/alibaba/nacos/core/env/NacosDefaultPropertySourceEnvironmentPostProcessorTest.java +++ b/core/src/test/java/com/alibaba/nacos/core/env/NacosDefaultPropertySourceEnvironmentPostProcessorTest.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/core/src/test/java/com/alibaba/nacos/core/listener/StandaloneProfileApplicationListenerTest.java b/core/src/test/java/com/alibaba/nacos/core/listener/StandaloneProfileApplicationListenerTest.java index fd8190d06..14ceabadd 100644 --- a/core/src/test/java/com/alibaba/nacos/core/listener/StandaloneProfileApplicationListenerTest.java +++ b/core/src/test/java/com/alibaba/nacos/core/listener/StandaloneProfileApplicationListenerTest.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/naming/src/test/java/com/alibaba/nacos/naming/misc/UtilsAndCommonsTest.java b/naming/src/test/java/com/alibaba/nacos/naming/misc/UtilsAndCommonsTest.java index 89f7d2f2c..f206adedb 100644 --- a/naming/src/test/java/com/alibaba/nacos/naming/misc/UtilsAndCommonsTest.java +++ b/naming/src/test/java/com/alibaba/nacos/naming/misc/UtilsAndCommonsTest.java @@ -1,12 +1,11 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 + * Copyright 1999-2018 Alibaba Group Holding Ltd. * - * http://www.apache.org/licenses/LICENSE-2.0 + * 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, diff --git a/test/src/test/java/com/alibaba/nacos/test/smoke/nacosSmoke_ITCase.java b/test/src/test/java/com/alibaba/nacos/test/smoke/nacosSmoke_ITCase.java index feec9ca05..f0a0ac22f 100644 --- a/test/src/test/java/com/alibaba/nacos/test/smoke/nacosSmoke_ITCase.java +++ b/test/src/test/java/com/alibaba/nacos/test/smoke/nacosSmoke_ITCase.java @@ -13,22 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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.test.smoke; diff --git a/test/src/test/resources/logback-test.xml b/test/src/test/resources/logback-test.xml index f70c7d1e3..651c878bc 100644 --- a/test/src/test/resources/logback-test.xml +++ b/test/src/test/resources/logback-test.xml @@ -1,19 +1,18 @@