diff --git a/alerter/src/main/java/org/apache/hertzbeat/alert/config/AlerterAutoConfiguration.java b/alerter/src/main/java/org/apache/hertzbeat/alert/config/AlerterAutoConfiguration.java index b0afa2c5b8a..f9f78661210 100644 --- a/alerter/src/main/java/org/apache/hertzbeat/alert/config/AlerterAutoConfiguration.java +++ b/alerter/src/main/java/org/apache/hertzbeat/alert/config/AlerterAutoConfiguration.java @@ -17,11 +17,14 @@ package org.apache.hertzbeat.alert.config; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.ComponentScan; /** * Alert auto configuration. */ + +@AutoConfiguration @ComponentScan(basePackages = "org.apache.hertzbeat.alert") public class AlerterAutoConfiguration { } diff --git a/alerter/src/main/resources/META-INF/spring.factories b/alerter/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 13843a7949e..00000000000 --- a/alerter/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,17 +0,0 @@ -# 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. - -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -org.apache.hertzbeat.alert.config.AlerterAutoConfiguration diff --git a/alerter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/alerter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 0becd31fa85..bbff659d5c8 100644 --- a/alerter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/alerter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -org.apache.hertzbeat.alert.config.AlerterAutoConfiguration \ No newline at end of file +org.apache.hertzbeat.alert.config.AlerterAutoConfiguration diff --git a/collector/src/main/java/org/apache/hertzbeat/collector/config/CollectorAutoConfiguration.java b/collector/src/main/java/org/apache/hertzbeat/collector/config/CollectorAutoConfiguration.java index e4bfd909556..a94d74488ba 100644 --- a/collector/src/main/java/org/apache/hertzbeat/collector/config/CollectorAutoConfiguration.java +++ b/collector/src/main/java/org/apache/hertzbeat/collector/config/CollectorAutoConfiguration.java @@ -17,12 +17,15 @@ package org.apache.hertzbeat.collector.config; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.ComponentScan; /** * Collector Auto Configuration * @version 2.1 */ + +@AutoConfiguration @ComponentScan(basePackages = "org.apache.hertzbeat.collector") public class CollectorAutoConfiguration { } diff --git a/collector/src/main/resources/META-INF/spring.factories b/collector/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 771bb51c6bc..00000000000 --- a/collector/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,17 +0,0 @@ -# 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. - -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -org.apache.hertzbeat.collector.config.CollectorAutoConfiguration diff --git a/collector/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/collector/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 85622a853b4..88a05890b6f 100644 --- a/collector/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/collector/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -org.apache.hertzbeat.collector.config.CollectorAutoConfiguration \ No newline at end of file +org.apache.hertzbeat.collector.config.CollectorAutoConfiguration diff --git a/common/src/main/java/org/apache/hertzbeat/common/config/CommonConfig.java b/common/src/main/java/org/apache/hertzbeat/common/config/CommonConfig.java index 7dfaf4ab597..fa51f981e45 100644 --- a/common/src/main/java/org/apache/hertzbeat/common/config/CommonConfig.java +++ b/common/src/main/java/org/apache/hertzbeat/common/config/CommonConfig.java @@ -18,16 +18,17 @@ package org.apache.hertzbeat.common.config; import org.apache.hertzbeat.common.util.AesUtil; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; /** * common module config */ + +@AutoConfiguration @ComponentScan(basePackages = "org.apache.hertzbeat.common") @EnableConfigurationProperties(CommonProperties.class) -@Configuration public class CommonConfig { public CommonConfig(CommonProperties commonProperties) { diff --git a/common/src/main/resources/META-INF/spring.factories b/common/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 9027bee7cb0..00000000000 --- a/common/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,18 +0,0 @@ -# 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. - - -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -org.apache.hertzbeat.common.config.CommonConfig diff --git a/push/src/main/java/org/apache/hertzbeat/push/config/PushAutoConfiguration.java b/push/src/main/java/org/apache/hertzbeat/push/config/PushAutoConfiguration.java index d087c5adc98..372897d594e 100644 --- a/push/src/main/java/org/apache/hertzbeat/push/config/PushAutoConfiguration.java +++ b/push/src/main/java/org/apache/hertzbeat/push/config/PushAutoConfiguration.java @@ -17,11 +17,14 @@ package org.apache.hertzbeat.push.config; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.ComponentScan; /** * push configuration */ + +@AutoConfiguration @ComponentScan(basePackages = "org.apache.hertzbeat.push") public class PushAutoConfiguration { } diff --git a/push/src/main/resources/META-INF/spring.factories b/push/src/main/resources/META-INF/spring.factories deleted file mode 100644 index a433ed2b39b..00000000000 --- a/push/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,17 +0,0 @@ -# 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. - -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -org.apache.hertzbeat.push.config.PushAutoConfiguration diff --git a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/WarehouseAutoConfiguration.java b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java similarity index 88% rename from warehouse/src/main/java/org/apache/hertzbeat/warehouse/WarehouseAutoConfiguration.java rename to warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java index 498e487e1b2..72a8a1d515e 100644 --- a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/WarehouseAutoConfiguration.java +++ b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/config/WarehouseAutoConfiguration.java @@ -15,14 +15,17 @@ * limitations under the License. */ -package org.apache.hertzbeat.warehouse; +package org.apache.hertzbeat.warehouse.config; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.ComponentScan; /** * WarehouseAutoConfiguration class * @version 2.1 */ + +@AutoConfiguration @ComponentScan(basePackages = "org.apache.hertzbeat.warehouse") public class WarehouseAutoConfiguration { } diff --git a/warehouse/src/main/resources/META-INF/spring.factories b/warehouse/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 2df923ea4c1..00000000000 --- a/warehouse/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,17 +0,0 @@ -# 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. - -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ -org.apache.hertzbeat.warehouse.WarehouseAutoConfiguration diff --git a/warehouse/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/warehouse/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 97c492ff37f..e9d621619dd 100644 --- a/warehouse/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/warehouse/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -org.apache.hertzbeat.warehouse.WarehouseAutoConfiguration \ No newline at end of file +org.apache.hertzbeat.warehouse.config.WarehouseAutoConfiguration