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

时间:2023-01-25 23:10:14

I've imported my project into Eclipse (Helios + m2eclipse), and also into Netbeans (7.0) and in both IDEs one of the troubles is:

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

This is what I get in Netbeans when I try to build.

这是我尝试构建时在Netbeans中得到的。

The project com.miCompany:myProject:1.0 (.....) has 1 error

项目com.miCompany:myProject:1.0(…)有一个错误。

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]

Unresolveable build extension: Plugin org.apache.axis2:axis2-wsdl2code-maven-plugin:1.3或它的一个依赖项无法得到解决:未能收集到对org.apache.axis2的依赖关系:axis2-wsdl2code-maven-plugin:jar:1.3():未能读取org.apache.woden:woden: 1.0-incubating-M7b:无法传输工件的组织。使用可用的工厂WagonRepositoryConnectorFactory ->(帮助2)来访问存储库jibx (http://jibx.sourceforge.net/maven)。

This is what I get in Eclipse:

这就是我在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

项目构建错误:无法解决的构建扩展:插件org.apache.axis2:axis2-wsdl2code-maven-plugin:1.3或它的一个依赖项无法得到解决:未能收集到对org.apache.axis2的依赖关系:axis2-wsdl2code-maven-plugin:jar:1.3 () pom。xml /myProject第1行Maven问题。

In Eclipse I've downloaded this: http://www.apache.org/dyn/mirrors/mirrors.cgi/axis/axis2/java/core/1.5.4/axis2-eclipse-service-plugin-1.5.4.zip unzipped and copied the file: "org.apache.axis2.eclipse.codegen.plugin_1.5.4.jar" into the directory "plugins" of my Eclipse instalation. And I still getting the same error.

在Eclipse中,我已经下载了这个:http://www.apache.org/dyn/mirrors/mirrors.cgi/axis/axis2/java/core/1.5.4/ axis2eclipse -service-plugin-1.5.4.zip解压并复制文件:“org.apache.axis2.eclipse.codegen.plugin_1.5.4。jar“进入我的Eclipse instalation的目录”插件。我仍然得到相同的误差。

I am running Netbeans over Win XP and Eclipse over Win XP and also over Mac, allways the same error.

我在Win XP和Eclipse上运行Netbeans胜过Win XP,也在Mac上运行,allways也有同样的错误。

Does somebody have any idea what can I do?

有人知道我能做什么吗?

Here goes my pom.xml

这是我的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 个解决方案

#1


3  

Well, I can only offer suggestions as I"m not much of a maven expert, but I did just have to do this today and it was pretty straightforward for me -

嗯,我只能提供建议,因为我并不是一个专家,但我今天就必须这么做,这对我来说非常简单。

  • set up the maven project to be eclipse friendly : mvn eclipse:eclipse

    设置maven项目为eclipse友好型:mvn eclipse:eclipse。

  • make sure eclipse can see the libs. this meant going to the projectsetup/buildpath/libraries editor in eclipse and adding the variable M2_REPO to point to your local maven repository (e.g. something like /home/nacho3d/.m2/repository)

    确保eclipse可以看到libs。这意味着要在eclipse中使用projectsetup/buildpath/库编辑器,并将变量M2_REPO添加到本地maven存储库(例如/home/nacho3d/.m2/repository)。

Your error, actually, looks to me like maven can't find a dependency for axis. The specifics for that should be on the axis website,

您的错误,实际上,在我看来,maven无法找到axis的依赖项。具体内容应该在axis网站上,

#2


2  

I think you're using maven 3.0+, right?

我想你使用的是maven 3.0+,对吧?

That pom(org.apache.woden:woden:jar:1.0-incubating-M7b) isn't compatible with maven 3 yet. If you use maven 2.2.1 to build ESB 4.3.0-03 source, then it would be successfully.

woden:jar:1.0-incubating-M7b)与maven 3不兼容。如果您使用maven 2.2.1构建ESB 4.3.0-03源代码,那么它将会成功。

#3


0  

If you have the jar of the missing dependency you can:

如果你有一罐缺失的依赖,你可以:

1) deploy it on your maven repository, if you have one

1)如果有的话,将它部署到maven存储库中。

2) declare the dependency in your pom with a scope of 'system': check this out

2)在pom中声明一个“系统”范围的依赖项:检查这个。

#4


0  

I have also faced the same problem and fixed it by following below step...

我也遇到了同样的问题,并通过以下步骤解决了……

  1. In you project directory do the command: mvn eclipse:eclipse
  2. 在您的项目目录中执行以下命令:mvn eclipse:eclipse。
  3. In eclipse project right click->Maven->Update Project.
  4. 在eclipse项目右击->Maven->更新项目。
  5. Again right click->Maven->Disable Maven Nature
  6. 再次右击->Maven->禁用Maven属性。
  7. Restart eclipse.
  8. 重新启动eclipse。
  9. Right click on project->Configure->Convert to Maven Project.
  10. 右键单击project->配置->转换为Maven项目。

Finish. Error will gone.

完成。错误就会消失。

Thanks

谢谢

#1


3  

Well, I can only offer suggestions as I"m not much of a maven expert, but I did just have to do this today and it was pretty straightforward for me -

嗯,我只能提供建议,因为我并不是一个专家,但我今天就必须这么做,这对我来说非常简单。

  • set up the maven project to be eclipse friendly : mvn eclipse:eclipse

    设置maven项目为eclipse友好型:mvn eclipse:eclipse。

  • make sure eclipse can see the libs. this meant going to the projectsetup/buildpath/libraries editor in eclipse and adding the variable M2_REPO to point to your local maven repository (e.g. something like /home/nacho3d/.m2/repository)

    确保eclipse可以看到libs。这意味着要在eclipse中使用projectsetup/buildpath/库编辑器,并将变量M2_REPO添加到本地maven存储库(例如/home/nacho3d/.m2/repository)。

Your error, actually, looks to me like maven can't find a dependency for axis. The specifics for that should be on the axis website,

您的错误,实际上,在我看来,maven无法找到axis的依赖项。具体内容应该在axis网站上,

#2


2  

I think you're using maven 3.0+, right?

我想你使用的是maven 3.0+,对吧?

That pom(org.apache.woden:woden:jar:1.0-incubating-M7b) isn't compatible with maven 3 yet. If you use maven 2.2.1 to build ESB 4.3.0-03 source, then it would be successfully.

woden:jar:1.0-incubating-M7b)与maven 3不兼容。如果您使用maven 2.2.1构建ESB 4.3.0-03源代码,那么它将会成功。

#3


0  

If you have the jar of the missing dependency you can:

如果你有一罐缺失的依赖,你可以:

1) deploy it on your maven repository, if you have one

1)如果有的话,将它部署到maven存储库中。

2) declare the dependency in your pom with a scope of 'system': check this out

2)在pom中声明一个“系统”范围的依赖项:检查这个。

#4


0  

I have also faced the same problem and fixed it by following below step...

我也遇到了同样的问题,并通过以下步骤解决了……

  1. In you project directory do the command: mvn eclipse:eclipse
  2. 在您的项目目录中执行以下命令:mvn eclipse:eclipse。
  3. In eclipse project right click->Maven->Update Project.
  4. 在eclipse项目右击->Maven->更新项目。
  5. Again right click->Maven->Disable Maven Nature
  6. 再次右击->Maven->禁用Maven属性。
  7. Restart eclipse.
  8. 重新启动eclipse。
  9. Right click on project->Configure->Convert to Maven Project.
  10. 右键单击project->配置->转换为Maven项目。

Finish. Error will gone.

完成。错误就会消失。

Thanks

谢谢

相关文章