Browse Source
Previously, when @EnableAutoConfiguration was used in multiple packages, the last @EnableAutoConfiguration that was processed would win and only its package would be stored as an auto-configuration package. This commit updates AutoConfigurationPackages to allow multiple package name registrations. AutoConfigurationPackages.set(…) has been altered to augment the constructor arguments of the BeanDefinition registered for the initial call to the method so that the packages handed to the method call will be added to the bean definition and not replace the previous ones. The method has been renamed register(…) to reflect the changed behavior. Closes gh-1994pull/2009/head
5 changed files with 129 additions and 15 deletions
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
/* |
||||
* Copyright 2012-2014 the original author or authors. |
||||
* |
||||
* 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 org.springframework.boot.autoconfigure.packages.one; |
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurationPackagesTests.TestRegistrar; |
||||
import org.springframework.context.annotation.Configuration; |
||||
import org.springframework.context.annotation.Import; |
||||
|
||||
@Configuration |
||||
@Import(TestRegistrar.class) |
||||
public class FirstConfiguration { |
||||
|
||||
} |
||||
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
/* |
||||
* Copyright 2012-2014 the original author or authors. |
||||
* |
||||
* 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 org.springframework.boot.autoconfigure.packages.two; |
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurationPackagesTests.TestRegistrar; |
||||
import org.springframework.context.annotation.Configuration; |
||||
import org.springframework.context.annotation.Import; |
||||
|
||||
@Configuration |
||||
@Import(TestRegistrar.class) |
||||
public class SecondConfiguration { |
||||
|
||||
} |
||||
Loading…
Reference in new issue