2012-03-22 41 views
1

我有一個使用maven的scala項目。當我只使用scala類時,maven插件沒有問題。 但是現在,我試圖編譯時出現錯誤:使用maven-plugin的Scala找不到依賴

[警告] C:\ java \ workspace \ mcare \ src \ main \ scala \ com \ fb \ mcare \ config \ AppConfig.scala:2:錯誤:對象springframework的是不包有機 [警告]進口org.springframework.context.annotation.Configuration的成員

package com.fb.mcare.config 
import org.springframework.context.annotation.Configuration 

@Configuration 
class AppConfig { 

} 

我的POM:

http://maven.apache.org/maven -v4_0_0.xsd「> 4.0.0 com.fb mcare 0。 0.1-SNAPSHOT 2.9.1-1 3.1.0.RELEASE 戰爭 scala-tools.org 斯卡拉工具的Maven2資源庫 http://scala-tools.org/repo-releases com.springsource.repository.maven.release http://maven.springframework.org/release/ 假

<pluginRepositories> 
    <pluginRepository> 
     <id>scala-tools.org</id> 
     <name>Scala-Tools Maven2 Repository</name> 
     <url>http://scala-tools.org/repo-releases</url> 
    </pluginRepository> 
</pluginRepositories> 

<dependencies> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-context</artifactId> 
     <version>${spring.version}</version> 
     <scope>runtime</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-webmvc</artifactId> 
     <version>${spring.version}</version> 
     <scope>runtime</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.scala-lang</groupId> 
     <artifactId>scala-library</artifactId> 
     <version>${scala.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.4</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.specs</groupId> 
     <artifactId>specs</artifactId> 
     <version>1.2.5</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.geronimo.specs</groupId> 
     <artifactId>geronimo-servlet_3.0_spec</artifactId> 
     <version>1.0</version> 
     <scope>provided</scope> 
    </dependency> 
</dependencies> 

<build> 
    <pluginManagement> 
     <plugins> 
      <plugin> 
       <groupId>org.scala-tools</groupId> 
       <artifactId>maven-scala-plugin</artifactId> 
       <version>2.9.1</version> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>2.0.2</version> 
      </plugin> 
     </plugins> 
    </pluginManagement> 
    <plugins> 
     <plugin> 
      <groupId>org.scala-tools</groupId> 
      <artifactId>maven-scala-plugin</artifactId> 
      <executions> 
       <execution> 
        <id>scala-compile-first</id> 
        <phase>process-resources</phase> 
        <goals> 
         <goal>add-source</goal> 
         <goal>compile</goal> 
        </goals> 
       </execution> 
       <execution> 
        <id>scala-test-compile</id> 
        <phase>process-test-resources</phase> 
        <goals> 
         <goal>testCompile</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <executions> 
       <execution> 
        <phase>compile</phase> 
        <goals> 
         <goal>compile</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
    </plugins> 
</build> 

試過幾乎所有的東西,我在這裏錯過了什麼?

問候

回答