草庐IT

java - 我在编译 Maven 项目时遇到了麻烦

coder 2024-03-31 原文

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

这是我尝试构建时在 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 安装目录“plugins”中。我仍然遇到同样的错误。

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

有人知道我能做什么吗?

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

最佳答案

好吧,我只能提供建议,因为我不是专家,但我今天确实需要这样做,这对我来说非常简单 -

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

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

实际上,在我看来,您的错误看起来像是 maven 无法找到轴的依赖项。具体细节应该在轴网站上,

关于java - 我在编译 Maven 项目时遇到了麻烦,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6051861/

有关java - 我在编译 Maven 项目时遇到了麻烦的更多相关文章

  1. ruby - 如何在 buildr 项目中使用 Ruby 代码? - 2

    如何在buildr项目中使用Ruby?我在很多不同的项目中使用过Ruby、JRuby、Java和Clojure。我目前正在使用我的标准Ruby开发一个模拟应用程序,我想尝试使用Clojure后端(我确实喜欢功能代码)以及JRubygui和测试套件。我还可以看到在未来的不同项目中使用Scala作为后端。我想我要为我的项目尝试一下buildr(http://buildr.apache.org/),但我注意到buildr似乎没有设置为在项目中使用JRuby代码本身!这看起来有点傻,因为该工具旨在统一通用的JVM语言并且是在ruby中构建的。除了将输出的jar包含在一个独特的、仅限ruby​​

  2. ruby-on-rails - 项目升级后 Pow 不会更改 ruby​​ 版本 - 2

    我在我的Rails项目中使用Pow和powifygem。现在我尝试升级我的ruby​​版本(从1.9.3到2.0.0,我使用RVM)当我切换ruby​​版本、安装所有gem依赖项时,我通过运行railss并访问localhost:3000确保该应用程序正常运行以前,我通过使用pow访问http://my_app.dev来浏览我的应用程序。升级后,由于错误Bundler::RubyVersionMismatch:YourRubyversionis1.9.3,butyourGemfilespecified2.0.0,此url不起作用我尝试过的:重新创建pow应用程序重启pow服务器更新战俘

  3. ruby-on-rails - 新 Rails 项目 : 'bundle install' can't install rails in gemfile - 2

    我已经像这样安装了一个新的Rails项目:$railsnewsite它执行并到达:bundleinstall但是当它似乎尝试安装依赖项时我得到了这个错误Gem::Ext::BuildError:ERROR:Failedtobuildgemnativeextension./System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/rubyextconf.rbcheckingforlibkern/OSAtomic.h...yescreatingMakefilemake"DESTDIR="cleanmake"DESTDIR="

  4. java - 等价于 Java 中的 Ruby Hash - 2

    我真的很习惯使用Ruby编写以下代码:my_hash={}my_hash['test']=1Java中对应的数据结构是什么? 最佳答案 HashMapmap=newHashMap();map.put("test",1);我假设? 关于java-等价于Java中的RubyHash,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/22737685/

  5. Ruby 从大范围中获取第 n 个项目 - 2

    假设我有这个范围:("aaaaa".."zzzzz")如何在不事先/每次生成整个项目的情况下从范围中获取第N个项目? 最佳答案 一种快速简便的方法:("aaaaa".."zzzzz").first(42).last#==>"aaabp"如果出于某种原因你不得不一遍又一遍地这样做,或者如果你需要避免为前N个元素构建中间数组,你可以这样写:moduleEnumerabledefskip(n)returnto_enum:skip,nunlessblock_given?each_with_indexdo|item,index|yieldit

  6. java - 从 JRuby 调用 Java 类的问题 - 2

    我正在尝试使用boilerpipe来自JRuby。我看过guide从JRuby调用Java,并成功地将它与另一个Java包一起使用,但无法弄清楚为什么同样的东西不能用于boilerpipe。我正在尝试基本上从JRuby中执行与此Java等效的操作:URLurl=newURL("http://www.example.com/some-location/index.html");Stringtext=ArticleExtractor.INSTANCE.getText(url);在JRuby中试过这个:require'java'url=java.net.URL.new("http://www

  7. ruby - Sinatra set cache_control to static files in public folder编译错误 - 2

    我不知道为什么,但是当我设置这个设置时它无法编译设置:static_cache_control,[:public,:max_age=>300]这是我得到的syntaxerror,unexpectedtASSOC,expecting']'(SyntaxError)set:static_cache_control,[:public,:max_age=>300]^我只想将“过期”header设置为css、javaascript和图像文件。谢谢。 最佳答案 我猜您使用的是Ruby1.8.7。Sinatra文档中显示的语法似乎是在Ruby1.

  8. java - 我的模型类或其他类中应该有逻辑吗 - 2

    我只想对我一直在思考的这个问题有其他意见,例如我有classuser_controller和classuserclassUserattr_accessor:name,:usernameendclassUserController//dosomethingaboutanythingaboutusersend问题是我的User类中是否应该有逻辑user=User.newuser.do_something(user1)oritshouldbeuser_controller=UserController.newuser_controller.do_something(user1,user2)我

  9. java - 什么相当于 ruby​​ 的 rack 或 python 的 Java wsgi? - 2

    什么是ruby​​的rack或python的Java的wsgi?还有一个路由库。 最佳答案 来自Python标准PEP333:Bycontrast,althoughJavahasjustasmanywebapplicationframeworksavailable,Java's"servlet"APImakesitpossibleforapplicationswrittenwithanyJavawebapplicationframeworktoruninanywebserverthatsupportstheservletAPI.ht

  10. Matlab imread()读到了什么 (浅显 当复习文档了) - 2

    matlab打开matlab,用最简单的imread方法读取一个图像clcclearimg_h=imread('hua.jpg');返回一个数组(矩阵),往往是a*b*cunit8类型解释一下这个三维数组的意思,行数、数和层数,unit8:指数据类型,无符号八位整形,可理解为0~2^8的数三个层数分别代表RGB三个通道图像rgb最常用的是24-位实现方法,即RGB每个通道有256色阶(2^8)。基于这样的24-位RGB模型的色彩空间可以表现256×256×256≈1670万色当imshow传入了一个二维数组,它将以灰度方式绘制;可以把图像拆分为rgb三层,可以以灰度的方式观察它figure(1

随机推荐