Hello.
I want to add spring IOC to maven based Swing Application Framework project. So I added to pom.xml dependencies:
<!-- Spring IOC -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.0.0.RELEASE</version>
<scope>runtime</scope>
</dependency>
<!-- log4j for Spring -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<scope>runtime</scope>
</dependency>
And initializated ApplicationContext in main():
public static void main(String[] args) {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.scan("com.mypackagewithbeans");
ctx.refresh();
launch(DesktopApplication1.class, args);
}
But I can't build project, because IDE can not see spring libraries at all. I tried to remove <scope>runtime</scope>
line, but it does not fix the problem (IDE can not see annotations, for example, @Autowire).
What should I do to add the Spring IOC support to the NetBeans Swing Application Framework project (using maven)?