Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is JavaConfigApplicationContext class nowadays?

What is JavaConfigApplicationContext class address in maven artifacts?

Can't find it in neither of

 <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>4.2.0.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>4.2.0.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>4.2.0.RELEASE</version>
        </dependency>
like image 786
Suzan Cioc Avatar asked Aug 07 '15 20:08

Suzan Cioc


1 Answers

In Spring 4.2.0, in order to create an instance of ApplicationContext from @Configuration-annotated class use:

ApplicationContext context = new AnnotationConfigApplicationContext(MyConfig.class);

Please see this answer for reasons why JavaConfigApplicationContext does not exist anymore.

like image 93
Constantine Avatar answered Oct 14 '22 15:10

Constantine