Maven依赖Mina:管理项目时出现"Missing artifact xxx bundle"问题
2014-02-25 15:39
441 查看
前言
这几天,了解和学习Apache Mina,使用Maven管理项目,可是生成项目时,一直报一个异常,查了很多资料,尝试了很多办法,就是木有解决,开始以为自己钻了牛角尖,将此问题放置几天,再来看,今天再次看,还是同样的问题,不过最后还是给解决了,记录下吧,算是一个教训。问题
在使用Maven管理mina的包时,由于mina打包为bundle,此包为OSGI使用,OSGI的各个模块叫做bundle,OSGI,以前在公司使用过,做过一个项目,木有深入的了解,在管理mina的依赖时,首先生成项目的命令,运行此命令时,就出错了D:\GitHub\java>mvn install eclipse:eclipse -Dwtpversion=2.0 -DdownloadSources=true
异常如下:
[ERROR] Failed to execute goal on project java: Could not resolve dependencies f or project com.wds:java:jar:1.0-SNAPSHOT: The following artifacts could not be r esolved: org.apache.mina:mina-core:bundle:2.0.7, org.apache.mina:mina-integratio n-beans:bundle:2.0.7, org.apache.mina:mina-integration-ognl:bundle:2.0.7: Failur e to find org.apache.mina:mina-core:bundle:2.0.7 in http://xxxxx:8081/nexus /content/repositories/gvbase/ was cached in the local repository, resolution wil l not be reattempted until the update interval of nexus has elapsed or updates a re forced -> [Help 1]
pom.xml文件
<dependency> <groupId>org.apache.mina</groupId> <artifactId>mina-core</artifactId> <version>${mina-version}</version> </dependency> <dependency> <groupId>org.apache.mina</groupId> <artifactId>mina-transport-apr</artifactId> <version>${mina-version}</version> </dependency> <dependency> <groupId>org.apache.mina</groupId> <artifactId>mina-statemachine</artifactId> <version>${mina-version}</version> </dependency> <dependency> <groupId>org.apache.mina</groupId> <artifactId>mina-integration-xbean</artifactId> <version>${mina-version}</version> </dependency> <dependency> <groupId>org.apache.mina</groupId> <artifactId>mina-integration-ognl</artifactId> <version>${mina-version}</version> </dependency> <dependency> <groupId>org.apache.mina</groupId> <artifactId>mina-integration-jmx</artifactId> <version>${mina-version}</version> </dependency> <dependency> <groupId>org.apache.mina</groupId> <artifactId>mina-integration-beans</artifactId> <version>${mina-version}</version> <!-- <exclusions> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> </exclusion> </exclusions>--> </dependency> <dependency> <groupId>org.apache.mina</groupId> <artifactId>mina-filter-compression</artifactId> <version>${mina-version}</version> </dependency>
解决办法
在项目中的pom.xml文件中增加一个插件,配置如下:<plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> </plugin>加上此配置,再运行命令,就可创建成功了!
相关文章推荐
- MySQL下外键约束问题
- Android View中 layout 的使用
- dll错误等笔记
- 杭电4510—小Q系列故事—为什么时光不能倒流
- jQuery Mobile 列表内容
- sqlserver中各个字段类型详解
- 在ios中使用FMDB
- Android_HttpClient
- 也谈一点web应用架构的看法——基于http api的web应用
- Remove Duplicates from Sorted Array II - LeetCode
- Servlet容器如何同时来处理多个请求
- Mysql 冷备份批处理
- 行业应用也在不断诞生
- mmc流程
- OpenGL: Ubuntu创建窗体
- MySQL CMake参数说明手册
- Dell定制Intel 主动管理技术 (Intel AMT)设置指南
- 俄语专业个人简历范文
- Html中td自动换行问题
- css回到顶部