我在编写maven项目时遇到了麻烦

时间:2011-05-18 22:42:27

标签: java eclipse netbeans maven

我已将我的项目导入Eclipse(Helios + m2eclipse),也导入Netbeans(7.0),在两个IDE中,其中一个问题是:

这是我尝试构建时在Netbeans中获得的内容。

项目com.miCompany:myProject:1.0(.....)有1个错误

  

无法解析的构建扩展:插件   org.apache.axis2:Axis2的-wsdl2code - Maven的插件:1.3   或其中一个依赖项不能   解决:收集失败   依赖性   org.apache.axis2:Axis2的-wsdl2code - Maven的插件:罐子:1.3   ():无法读取工件描述符   对于   org.apache.woden:沃登:罐:1.0温育-M7B:   无法转移神器   org.apache.woden:沃登:POM:1.0温育-M7B   从/到jibx   (http://jibx.sourceforge.net/maven):   没有可用的连接器   存储库jibx   (http://jibx.sourceforge.net/maven)   使用可用的类型遗留   工厂   WagonRepositoryConnectorFactory - >   [帮助2]

这是我在Eclipse中得到的:

  

项目构建错误:无法解析的构建扩展:插件   org.apache.axis2:Axis2的-wsdl2code - Maven的插件:1.3   或其中一个依赖项不能   解决:收集失败   依赖性   org.apache.axis2:Axis2的-wsdl2code - Maven的插件:罐子:1.3   ()pom.xml / myProject第1行Maven   问题

在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安装目录“plugins”中。我仍然得到同样的错误。

我在Win XP和Eclipse上通过Win XP和Mac运行Netbeans,总是出现同样的错误。

有人知道我该怎么办?

这是我的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>

4 个答案:

答案 0 :(得分:3)

好吧,我只能提供建议,因为我不是一个专家,但我今天必须这样做,这对我来说非常简单 -

  • 将maven项目设置为日食友好:mvn eclipse:eclipse

  • 确保eclipse可以看到libs。这意味着转到eclipse中的projectsetup / buildpath / libraries编辑器并添加变量M2_REPO以指向您当地的maven存储库(例如/home/nacho3d/.m2/repository)

实际上,你的错误看起来像maven找不到轴的依赖。具体内容应该在轴网站上,

答案 1 :(得分: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源代码,那么它将成功。

答案 2 :(得分:0)

如果你有缺少依赖的jar,你可以:

1)如果您有一个

,请将其部署在您的maven存储库中

2)使用'system'范围声明你的pom中的依赖关系:check this out

答案 3 :(得分:0)

我也面临同样的问题并通过以下步骤修复它......

  1. 在项目目录中执行命令:mvn eclipse:eclipse
  2. 在eclipse项目中右键单击 - &gt; Maven-&gt;更新项目。
  3. 再次右击 - &gt; Maven-&gt;禁用Maven Nature
  4. 重启eclipse。
  5. 右键单击项目 - &gt;配置 - &gt;转换为Maven项目。
  6. 完成。错误将消失。

    由于

相关问题