2011-05-18 155 views
6

我已經導入我的項目到Eclipse(赫利俄斯+ m2eclipse的),並且還到NetBeans(7.0)和兩個IDE中的煩惱之一就是:我有麻煩編譯Maven項目

這是當我嘗試構建時,我在Netbeans中獲得了什麼。

項目com.miCompany:myProject的:1.0(.....)有1個錯誤

Unresolveable build extension: Plugin org.apache.axis2:axis2-wsdl2code-maven-plugin:1.3 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.axis2:axis2-wsdl2code-maven-plugin:jar:1.3 (): Failed to read artifact descriptor for org.apache.woden:woden:jar:1.0-incubating-M7b: Could not transfer artifact org.apache.woden:woden:pom:1.0-incubating-M7b from/to jibx (http://jibx.sourceforge.net/maven): No connector available to access repository jibx (http://jibx.sourceforge.net/maven) of type legacy using the available factories WagonRepositoryConnectorFactory -> [Help 2]

這是我得到在Eclipse:

Project build error: Unresolveable build extension: Plugin org.apache.axis2:axis2-wsdl2code-maven-plugin:1.3 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.axis2:axis2-wsdl2code-maven-plugin:jar:1.3 () pom.xml /myProject line 1 Maven Problem

在Eclipse中我已經下載這個:http://www.apache.org/dyn/mirrors/mirrors.cgi/axis/axis2/java/core/1.5.4/axis2-eclipse-service-plugin-1.5.4.zip解壓縮並將文件:「org.apache.axis2.eclipse.codegen.plugin_1.5.4.jar」複製到我的Eclipse安裝目錄「插件」中。而且我仍然遇到同樣的錯誤。

我在運行Win XP和Eclipse的Netbeans上運行Win XP以及在Mac上運行,總是出現同樣的錯誤。

有人知道我能做什麼嗎?

這裏去我的pom.xml

<?xml version="1.0"?> 
<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> 
    <artifactId>MyParent</artifactId> 
    <groupId>com.mycompany</groupId> 
    <version>1.0</version> 
    </parent> 
    <groupId>com.mycompany</groupId> 
    <artifactId>myModule</artifactId> 
    <version>1.0</version> 
    <name>myModule</name> 
    <url>http://maven.apache.org</url> 

    <build> 
    <plugins> 
     <plugin> 
      <artifactId>maven-clean-plugin</artifactId> 
      <configuration> 
       <filesets>  
        <fileset> 
         <directory>src/main/java</directory> 
         <includes> 
          <include>com/mycompany/client/*.java</include> 
         </includes> 
        </fileset> 
       </filesets> 
      </configuration> 
     </plugin> 

     <plugin> 
      <groupId>org.apache.axis2</groupId> 
      <artifactId>axis2-wsdl2code-maven-plugin</artifactId> 
      <version>1.3</version> 
      <extensions>true</extensions> 
      <executions> 
       <execution> 
        <phase>generate-sources</phase> 
        <goals> 
         <goal>wsdl2code</goal> 
        </goals> 
       </execution> 
      </executions> 
      <configuration> 
       <packageName>com.mycompany.client</packageName> 
       <wsdlFile>src/main/axis2/MyWsdl.wsdl</wsdlFile> 
       <outputDirectory>.</outputDirectory> 
       <targetResourcesFolderLocation>target/main/axis2</targetResourcesFolderLocation> 
       <targetSourceFolderLocation>src/main/java</targetSourceFolderLocation> 
       <namespaceURIs> 
        <namespaceURI> 
         <uri>http://schema.mycompany.com/Esb</uri> 
         <packageName>com.mycompany.services.Esbsrv.schema</packageName> 
        </namespaceURI> 
        <namespaceURI> 
         <uri>http://wsdl.mycompany.com/Esb</uri> 
         <packageName>com.mycompany.services.Esbsrv.schema</packageName> 
        </namespaceURI> 
        <namespaceURI> 
         <uri>http://schema.mycompany.com/Global/WSException</uri> 
         <packageName>com.mycompany.schema.global.wsexception</packageName> 
        </namespaceURI> 
       </namespaceURIs> 
      </configuration> 
     </plugin> 

    </plugins> 
    </build> 

    <dependencies> 
    <!-- 
    <dependency> 
     <groupId>wsdl4j</groupId> 
     <artifactId>wsdl4j</artifactId> 
     <version>1.6.2</version> 
     <scope>compile</scope> 
    </dependency> 
--> 
    <dependency> 
     <groupId>org.apache.axis2</groupId> 
     <artifactId>axis2-adb</artifactId> 
     <version>1.3</version> 
     <scope>compile</scope> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.axis2</groupId> 
     <artifactId>axis2-kernel</artifactId> 
     <version>1.3</version> 
     <scope>compile</scope> 
    </dependency> 
<!-- 
    <dependency> 
     <groupId>org.apache.axis2</groupId> 
     <artifactId>axis2-xmlbeans</artifactId> 
     <version>1.3</version> 
     <scope>compile</scope> 
    </dependency> 
    --> 
    </dependencies> 

</project> 
+0

請問您能否提供您的pom.xml文件。 – Tnem 2011-05-18 23:30:21

+0

如果您直接從maven構建項目,是否可以構建?只要到pom.xml所在的路徑,執行'mvn clean package'並查看你得到了什麼(mvn.bat或mvn.sh需要在PATH中)。 – 2011-05-24 12:18:06

回答

3

好吧,我只能提供建議,我「米沒有太大的行家高手,但我只是有這個今天做的,它是非常簡單的我 -

  • 建立Maven項目被蝕友好:mvn eclipse:eclipse

  • 確保Eclipse可以看到庫這意味着要去頁。在Eclipse中rojectsetup/buildpath/libraries編輯器,並添加變量M2_REPO以指向您的本地Maven存儲庫(例如,像/home/nacho3d/.m2/repository)

你的錯誤,其實,在我看來就像行家找不到軸的依賴。造成這種情況的具體細節應當軸線網站上,

+0

我不得不在我的本地回購庫中放入由人員開發的幾個庫,以開發我正在開發的項目。 – FreelanceAr 2011-06-02 02:29:37

0

如果你有丟失的依賴,你可以的罐子:

1)它部署到你的Maven倉庫,如果你有一個

2)用'system'的範圍聲明你的pom依賴:check this out

2

我想你使用的是maven 3.0+,對不對?

那個pom(org.apache.woden:woden:jar:1.0-incubating-M7b)與maven 3不兼容。 如果您使用maven 2.2.1構建ESB 4.3.0-03源代碼,那麼它將會成功。

+0

我正在使用maven2。我仍然無法運行...你有什麼想法嗎? 1.3版本可以繼續使用嗎? – FreelanceAr 2011-06-28 23:42:46

0

我也面臨着同樣的問題,並按照下面的步驟固定它...

  1. 在你的項目目錄下執行命令:MVN日食:日食
  2. 在Eclipse項目中右點擊 - >的Maven - >更新項目。
  3. 再次右鍵單擊 - > Maven->禁用Maven自然
  4. 重新啓動eclipse。
  5. 右鍵單擊project-> Configure-> Convert to Maven Project。

完成。錯誤將消失。

謝謝