2011-05-17 65 views
2

我最近从使用Eclipse切换到IntelliJ,并且更喜欢这种体验。如何使IntelliJ了解注释

但是,IDE不理解任何注释。我正在使用Spring @Autowired注释以及一些Spring-WS注释,IDE告诉我他们没有解决。

当使用Maven构建项目时,它构建得很好,并且在Eclipse中可以识别Annotations。

我确定这是一个简单的设置,但找不到任何关于如何设置的信息。

+3

你有没有正确地将你的Maven项目导入IntelliJ?然后它应该正确地看到依赖关系。 – 2011-05-17 08:36:02

+0

如果我检查依赖关系,那么我可以在那里看到spring-ws库,但是没有注释包。 – Xetius 2011-05-17 08:40:10

+0

我是个白痴。解决。 IDE不分析POM中的属性。当我改变依赖 $ {spring.ws.version} 2.0.1.RELEASE它的工作。现在我要解决的新问题。 – Xetius 2011-05-17 08:54:21

回答

1

根据记录,在我们的项目POM,我们有以下的依存关系:

<dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-context</artifactId> 
     <version>3.0.5.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-orm</artifactId> 
     <version>3.0.5.RELEASE</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.ws</groupId> 
     <artifactId>spring-ws-core</artifactId> 
     <version>2.0.1.RELEASE</version> 
    </dependency> 

前两者已经目前已经实现web服务之前,所以他们可能没有严格要求的Web服务。