2016-01-26 107 views
2

我需要編譯我的項目,但它在我的pom.xml中失敗。第一誤差是:pom.xml中的Maven .m2編譯器錯誤

插件執行未包括生命週期配置:org.apache.maven.plugins:行家-編譯器插件:2.3.2:編譯(執行:默認 - 編譯,相:編譯)

和第二:

插件執行未包括生命週期配置:org.apache.maven.plugins:行家-反編譯 插件:2.3.2:testCompile(執行:默認-testCompile ,階段:測試編譯)

我在我的settings.xml中嘗試了太多東西。

1)實際上,MI行家=>安裝嵌入指向我的Apache行家2.2-1

2)的Maven =>用戶設置的的settings.xml。指向apache maven 2.2.1的正確settings.xml。並刪除m2/repository中的所有文件夾。

3)我試圖把maven離線,因爲我有罐子,所以我不需要使用存儲庫。 4)我試圖更新=> maven prject =>強制更新快照/發佈,脫機和不脫機。這兩種情況都沒用。

5)我不能在控制檯或pom.xml中輸入任何命令,因爲我有這些編譯錯誤。所以Maven安裝,清理,強制或任何命令都是不可能的。

6)我試着把這些插件說出控制檯錯誤,但它也沒用。

7)我的settings.xml代理的標籤是正確的

<proxies> 
    <proxy> 
     <active>?</active> 
     <host>?</host> 
     <port>?</port> 

     <nonProxyHosts>?</nonProxyHosts> 
    </proxy> 
</proxies> 

我不知道還有什麼我能做的。請給我一個建議或信息。


<?xml version="1.0" encoding="UTF-8"?> 
<project 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" 
    xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <modelVersion>4.0.0</modelVersion> 

<!-- <parent> --> 
<!--  <groupId>es.chx</groupId> --> 
<!--  <artifactId>parent-pom</artifactId> --> 
<!--  <version>2.0-SNAPSHOT</version> --> 
<!-- </parent> --> 

    <groupId>es.chx.gestionEnvios</groupId> 
    <artifactId>gestionEnvios</artifactId> 
    <version>1.0</version> 
    <name>gestionEnvios</name> 

    <properties> 
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
     <org.springframework-version>2.5</org.springframework-version> 
    </properties> 

    <dependencies> 

     <dependency> 
      <groupId>es.chx</groupId> 
      <artifactId>arq-chx</artifactId> 
      <version>1.0-SNAPSHOT</version> 
     </dependency> 

<!--  <dependency> --> 
<!--   <groupId>es.chx.web</groupId> --> 
<!--   <artifactId>loginLiferayFromApp</artifactId> --> 
<!--   <version>1.0-SNAPSHOT</version> --> 
<!--  </dependency> --> 

<!--  <dependency> --> 
<!--   <groupId>es.chx.web</groupId> --> 
<!--   <artifactId>commonWeb</artifactId> --> 
<!--   <version>1.0-SNAPSHOT</version> --> 
<!--  </dependency> --> 

<!-- -->  <dependency> 
<!-- -->   <groupId>es.chx.intranet</groupId> 
<!-- -->   <artifactId>commonIntranet</artifactId> 
<!-- -->   <version>1.0</version> 
<!-- -->  </dependency> 

     <dependency> 
      <groupId>displaytag</groupId> 
      <artifactId>displaytag-doc</artifactId> 
      <version>1.2</version> 
      <type>pom</type> 
     </dependency> 

     <dependency> 
      <groupId>displaytag</groupId> 
      <artifactId>displaytag</artifactId> 
      <version>1.2</version> 
     </dependency> 

     <dependency> 
      <groupId>displaytag</groupId> 
      <artifactId>displaytag-export-poi</artifactId> 
      <version>1.2</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-context</artifactId> 
      <version>${org.springframework-version}</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-webmvc</artifactId> 
      <version>${org.springframework-version}</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-aop</artifactId> 
      <version>${org.springframework-version}</version> 
     </dependency> 

     <dependency> 
      <groupId>org.ajaxtags</groupId> 
      <artifactId>ajaxtags</artifactId> 
      <version>1.3-beta-rc7</version> 
     </dependency> 

     <dependency> 
      <groupId>net.sf.json-lib</groupId> 
      <artifactId>json-lib</artifactId> 
      <version>2.2.3</version> 
      <type>pom</type> 
     </dependency> 

     <dependency> 
      <groupId>net.sf.json-lib</groupId> 
      <artifactId>json-lib-ext-spring</artifactId> 
      <version>1.0.2</version> 
     </dependency> 

     <dependency> 
      <groupId>es.chx.web</groupId> 
      <artifactId>dwr</artifactId> 
      <version>3.0</version> 
     </dependency> 

     <dependency> 
      <groupId>cglib</groupId> 
      <artifactId>cglib</artifactId> 
      <version>2.2.2</version> 
      <scope>compile</scope> 
     </dependency> 

     <dependency> 
      <groupId>javax.inject</groupId> 
      <artifactId>javax.inject</artifactId> 
      <version>1</version> 
     </dependency> 

     <dependency> 
      <groupId>javax.validation</groupId> 
      <artifactId>validation-api</artifactId> 
      <version>1.0.0.GA</version> 
      <scope>compile</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.hibernate</groupId> 
      <artifactId>hibernate-validator</artifactId> 
      <version>4.2.0.Final</version> 
      <scope>compile</scope> 
      <exclusions> 
       <exclusion> 
        <artifactId>slf4j-api</artifactId> 
        <groupId>org.slf4j</groupId> 
       </exclusion> 
      </exclusions> 
     </dependency> 

     <dependency> 
      <groupId>jstl</groupId> 
      <artifactId>jstl</artifactId> 
      <version>1.2</version> 
     </dependency> 

     <dependency> 
      <groupId>log4j</groupId> 
      <artifactId>log4j</artifactId> 
      <version>1.2.14</version> 
     </dependency> 

     <dependency> 
      <groupId>commons-validator</groupId> 
      <artifactId>commons-validator</artifactId> 
      <version>1.4.0</version> 
     </dependency> 

     <dependency> 
      <groupId>commons-lang</groupId> 
      <artifactId>commons-lang</artifactId> 
      <version>2.6</version> 
     </dependency> 

     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>jsp-api</artifactId> 
      <version>2.0</version> 
      <scope>provided</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-tx</artifactId> 
      <version>2.5</version> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-jdbc</artifactId> 
      <version>2.5</version> 
     </dependency> 

     <dependency> 
      <groupId>commons-dbcp</groupId> 
      <artifactId>commons-dbcp</artifactId> 
      <version>1.2.2</version> 
     </dependency> 

     <dependency> 
      <groupId>com.oracle</groupId> 
      <artifactId>ojdbc14</artifactId> 
      <version>10.2.0.2.0</version> 
     </dependency> 

     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.4</version> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework</groupId> 
      <artifactId>spring-test</artifactId> 
      <version>2.5</version> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>com.lowagie</groupId> 
      <artifactId>itext</artifactId> 
      <version>1.3</version> 
     </dependency> 

    </dependencies> 

    <repositories> 
     <repository> 
      <releases> 
       <enabled>true</enabled> 
      </releases> 
      <snapshots> 
       <enabled>true</enabled> 
      </snapshots> 
      <id>nexus-chrono</id> 
      <url>http://192.168.241.125:8081/nexus/content/groups/public/</url> 
     </repository> 
     <repository> 
      <id>apache.snapshots</id> 
      <name>Maven Plugin Snapshots</name> 
      <url>http://repository.apache.org/snapshots/</url> 
      <releases> 
       <enabled>false</enabled> 
      </releases> 
      <snapshots> 
       <enabled>true</enabled> 
      </snapshots> 
     </repository> 
    </repositories> 

    <build> 
     <plugins> 

      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-war-plugin</artifactId> 
       <version>2.1.1</version> 
       <configuration></configuration> 
      </plugin> 

      <plugin> 
       <artifactId>maven-eclipse-plugin</artifactId> 
       <version>2.9</version> 
       <configuration> 
        <additionalProjectnatures> 
         <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature> 
        </additionalProjectnatures> 
        <additionalBuildcommands> 
         <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand> 
        </additionalBuildcommands> 
        <downloadSources>true</downloadSources> 
        <downloadJavadocs>true</downloadJavadocs> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 

</project> 

而且我收到錯誤:

插件運行不屬於生命週期配置:org.apache.maven.plugins:Maven的編譯器插件:2.3.2:編譯(執行:默認 - 編譯,相:編譯)

插件執行未包括生命週期配置:org.apache.maven.plugins:行家-編譯器插件:2.3.2:testCompile(執行:默認 - testCompile,phase:test-compile)

+0

你可以顯示你的項目的pom.xml嗎? – Patrick

+0

這些錯誤消息與Eclipse(m2e插件)中的用法有關。首先,您應該使用最新版本的插件,此外您不應再使用maven-eclipise-plugin ...只需將項目導入爲Maven項目(並使用最新版本的m2e插件1.6。 2.X)... – khmarbaise

回答

0

嗯,我想我已經解決了它。最後,我安裝了STS(彈簧工具套件)和最新的m2e插件。錯誤不再存在。但是,我得到了其他錯誤,但它們來自我的存儲庫的權限。所以......解決方案是將STS作爲IDE安裝在我的電腦中。