例如使用maven编译使用了mina的包的工程,出现如下提示: 
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Hello 1.0
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.187s
[INFO] Finished at: Tue Nov 27 06:27:12 CST 2012
[INFO] Final Memory: 3M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Hello: Could not resolve dependencies for project tur:Hello:jar:1.0: The following artifacts could not be resolved: org.apache.mina:mina-core:bundle:2.0.7, org.apache.mina:mina-integration-beans:bundle:2.0.7, org.apache.mina:mina-integration-jmx:bundle:2.0.7, org.apache.mina:mina-integration-ognl:bundle:2.0.7, org.apache.mina:mina-statemachine:bundle:2.0.7: Failure to find org.apache.mina:mina-core:bundle:2.0.7 in http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
这个问题可能是依赖的项目打包成bundle造成,比如mina就是这样的,打包成bundle,例子:
  1. <dependency>
  2. <groupId>org.apache.mina</groupId>
  3. <artifactId>mina-core</artifactId>
  4. <version>2.0.4</version>
  5. <type>bundle</type>
  6. <scope>compile</scope>
  7. </dependency>
加入上面依赖出现错误如下:
11-9-26 上午10时21分30秒: Maven Builder: AUTO_BUILD requireFullBuild

11-9-26
上午10时21分30秒: Build errors for test-http-mina;
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal on project test-http-mina: Could not resolve dependencies
for project com.tecno:test-http-mina:jar:0.0.1-SNAPSHOT: Failure to find
org.apache.mina:mina-core:bundle:2.0.4 in http://uk.maven.org/maven2/
was cached in the local repository, resolution will not be reattempted
until the update interval of uk.maven.org has elapsed or updates are
forced
11-9-26 上午10时22分11秒: Refreshing [/test-http-mina/pom.xml]
11-9-26 上午10时22分11秒: Missing artifact org.apache.mina:mina-core:bundle:2.0.4:compile
11-9-26 上午10时22分11秒: Maven Builder: AUTO_BUILD

原因
mina打包为了bundle格式,为此,需要添加插件
在maven的pom.xml中plugins段中加入plugin即可
  1. <plugin>
  2. <groupId>org.apache.felix</groupId>
  3. <artifactId>maven-bundle-plugin</artifactId>
  4. <extensions>true</extensions>
  5. </plugin>

其中

  1. <extensions>true</extensions>

是必须的。

@import
url(http://www.cppblog.com/cutesoft_client/cuteeditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import
url(/css/cuteeditor.css);

 
 
      <plugin>  
                <groupId>org.apache.felix</groupId>  
                <artifactId>maven-bundle-plugin</artifactId>  
                <version>2.3.7</version>
                <extensions>true</extensions>  
            </plugin>

解决Maven管理的项目下"Missing artifact xxx bundle"问题的更多相关文章

  1. Spring入门(四):使用Maven管理Spring项目

    让我们先回顾下本系列的前3篇博客: Spring入门(一):创建Spring项目 Spring入门(二):自动化装配bean Spring入门(三):通过JavaConfig装配bean 1.为什么要 ...

  2. maven管理的项目出现Error configuring application listener of class org.springframework.web.context.ContextL

    eclipse里用maven管理的项目,在运行的时候出现 Error configuring application listener of class org.springframework.web ...

  3. eclipse的maven项目报Missing artifact jdk.toos:jdk.toos:jar:1.6错

    很多框架都会依赖jdk中的tools.jar,但是maven仓库中却没有. 如在eclipse+maven编写mapreduce代码,就会报Missing artifact jdk.toos:jdk. ...

  4. Maven搭建hadoop环境报Missing artifact jdk.tools:jdk.tools:jar:1.7

    今天,更新了工程,报错了. 项目中用了HBase,也有Hadoop相关的jar配置. pom文件, Missing artifact jdk.tools:jdk.tools:jar:1.7 Maven ...

  5. maven工程pom.xml报Missing artifact net.sf.jasperreports:jasperreports:jar:6.2.0

    有时maven工程的pom.xml报以下类型错误: Description Resource Path Location TypeMissing artifact net.sf.jasperrepor ...

  6. 【坑】解决maven管理SSM中mybatis的mapper文件扫描失败的问题

    文章目录 前言 改进方式来替换原始的使用方式 后记 好久没有写博客了,11月底来到公司实习,上个月写个小demo,趁此回顾下SSM,今天将最近的积累记录下: 前言 在学习 mybatis 的时候,都知 ...

  7. Maven管理Android项目1

    maven-android-plugin网站:https://code.google.com/p/maven-android-plugin/wiki/GettingStarted   android ...

  8. 对于Maven管理的项目制定虚拟目录

    基于Maven管理的web项目结构: target目录是用来存放项目打包之后生成的文件的目录,此目录中的文件必须调用mvn clean package后才能生成, 如果把虚拟目录设置在此目录中,则每次 ...

  9. Maven下把父项目下的子项目导出到myeclipse中

    第一种在父项目下已有子项目:右击空白------import 第二步Maven4MyEclipse-----------Existing  Maven  Projects 第三部选择父项目下面的子项目 ...

随机推荐

  1. Hibernate 马士兵 学习笔记 (转)

    目录(?)[+] 第2课 Hibernate UML图 第3课 风格 第4课 资源 第5课 环境准备 第6课 第一个示例Hibernate HelloWorld 第7课 建立Annotation版本的 ...

  2. Linux安装MariaDB(Mysql)和简单配置

    1.安装MariaDB 安装命令 yum -y install mariadb mariadb-server 安装完成MariaDB,首先启动MariaDB systemctl start maria ...

  3. C/C++ 定义与声明详解(转)

    转自:http://blog.csdn.net/xiaoyusmile/article/details/5420252 1. 变量的定义.声明 变量的声明有两种情况: 一种是需要建立存储空间的.例如: ...

  4. scrapy使用

    我们都知道大名鼎鼎的爬虫框架scrapy,它是基于twisted框架基础上进行的封装,它是基于异步调用,所以爬取的速度会很快,下面简单介绍一下scrapy的组成. 首先我们先安装scrapy,如果是基 ...

  5. MyEclipse2014安装图解

    MyEclipse2014安装图解.. ------------------ ------------------ ------------------ ------------------ ---- ...

  6. Win10个性化设置

    Win10个性化设置.. ---------------------- Capture001-我的桌面 ---------------------- Win10设置任务栏的颜色 ----------- ...

  7. [js高手之路]this知多少

    this关键字在javascript中的变化非常的灵活,如果用的不好就非常恶心,用的好,程序就非常的优雅,灵活,飘逸.所以掌握this的用法,是每一个前端工程师必知必会的.而且这个也是一些大公司笔试中 ...

  8. maven 搭新建成之后 无法创建 src/main/java 目录解决

    maven项目创建后 创建 src/main/java     和   src/main/test 会报错,目录已存在 打开build path 界面    src/main/java     和   ...

  9. IT团队之非正式沟通

      沟通能力是一种能证明和让对方发现你具有社会工作能力的能力.从表面上看来,它只是一种能说会道的能力,可实际上它却包罗了一个人从穿衣打扮到言谈举止等一切行为的能力.   从大体上,我将沟通分为正式沟通 ...

  10. 从聚合数据请求菜谱大全接口数据,解析显示到ListView