导入CXF实例中的maven项目报错

5 篇文章 0 订阅

       今天想学习下CXF的开发,于是上apache官网下载了一个apache-cxf-2.7.8.zip包,解压缩后在samples目录下找了找,准备导入wsdl_first_soap12项目研究下,由于这是个maven工程,于是在springsource中以maven工程方式导入这个项目,可惜导入就报错了

 

报错信息:

ArtifactTransferException: Failure to transfer org.apache.cxf:cxf-rt-frontend-jaxws:jar:2.7.8 from http://192.168.19.38:8081/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.cxf:cxf-rt-frontend-jaxws:jar:2.7.8 from/to central (http://192.168.19.38:8081/nexus/content/groups/public/): No response received after 60000

解决方式:

        执行maven update :在package explorer视图中右击项目  --->   Maven  --->   Update Project  --->   点击OK

        下载jar包是访问的http://192.168.19.38:8081/nexus/content/groups/public/路径,是由于我本地搭建了nexus私服(192.168.19.38是我本机IP),并做了镜像,所以这应该是没问题的

 

上面的错误没有了,可惜项目还是报错了

 

报错信息:

Execution generate-sources of goal org.apache.cxf:cxf-codegen-plugin:2.7.8:wsdl2java failed: Plugin org.apache.cxf:cxf-codegen-plugin:2.7.8 or one of its dependencies could not be resolved: The following artifacts could not be resolved: com.sun.xml.bind:jaxb-xjc:jar:2.2.6, org.springframework:spring-beans:jar:3.0.7.RELEASE, org.springframework:spring-context:jar:3.0.7.RELEASE, org.springframework:spring-aop:jar:3.0.7.RELEASE, org.apache.ant:ant:jar:1.8.4: Failure to transfer com.sun.xml.bind:jaxb-xjc:jar:2.2.6 from http://192.168.19.38:8081/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact com.sun.xml.bind:jaxb-xjc:jar:2.2.6 from/to central (http://192.168.19.38:8081/nexus/content/groups/public/): No response received after 60000 (org.apache.cxf:cxf-codegen-plugin:2.7.8:wsdl2java:generate-sources:generate-sources) pom.xml /wsdl_first_soap12 line 49 Maven Build Problem

解决方式:

        现在再次执行maven update一直不管用,还是报错。仔细看了下错误信息,应该是pom文件中配置的插件的依赖包没有下载到本地仓库

com.sun.xml.bind:jaxb-xjc:jar:2.2.6  、  org.springframework:spring-beans:jar:3.0.7.RELEASE 、 org.springframework:spring-context:jar:3.0.7.RELEASE 、org.springframework:spring-aop:jar:3.0.7.RELEASE 、 org.apache.ant:ant:jar:1.8.4  

根据报错信息中提示的GAV信息到本地仓库中对应目录下(如何根据GAV信息在本地仓库下查找响应构件可参考http://blog.csdn.net/liuxigiant/article/details/17240283文章中仓库布局的说明)查看,文件夹都存在,但是没有jar包。所以运行几次maven update都是没用的。

1、删除报错构件的本地仓库的存储目录,例如:org.springframework:spring-beans:jar:3.0.7.RELEASE构件,可以把3.0.7.RELEASE这层目录删除

2、执行maven update(删除本地仓库,maven构建项目的时候会先从本地仓库查找,本地仓库没找到才会去私服中下下载,所以本地仓库中目录若是存在但是jar包不存在的话,maven就不会去中央仓库下载)

3、若某一个构件下载还是下载不下来,可以手动下载放到对应目录下。 例如:构件jaxb-xjc-2.2.6.jar一直下载不下来,最后直接上网下载了一个jaxb-xjc-2.2.6.jar包,放到本地仓库的对应目录下。

 

现在项目终于不报错了,可以开始研究CXF了。。。。

 

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值