例如使用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. oracle撤销表空间和回滚段

    /* 撤销表空间 */ 通过使用撤销技术,能够为Oracle数据库提供以下功能: * 使用ROLLBACK语句撤销事务 * 进行数据库恢复 * 提供数据的读一致性 Oracle强烈建议DBA在Orac ...

  2. VMware Workstation 12 Pro 之安装林耐斯-Solus-系统

    VMware Workstation 12 Pro 之安装林耐斯-Solus-系统... ----------------- ----------------- ------------------- ...

  3. 5_XSS

    XSS简介 XSS(跨站脚本攻击)是指攻击者在网页中嵌入客户端脚本,通常是JavaScript编写的恶意代码,当用户使用浏览器浏览被嵌入恶意代码的网页时,恶意代码将在用户的浏览器上被解析执行.重点在“ ...

  4. python+selenium自动化软件测试(第10章):测试驱动TDD

    测试驱动开发模式,要求开发在写业务代码的时候,先写出测试代码,同时单元测试例子决定了如何来写产品的代码,并且不断的成功的执行编写的所有的单元测试例子,不断的完善单元测试例子进而完善产品代码, 这样随着 ...

  5. C# 单例模式(Singleton Pattern)(转SuagrMatl)

    单例模式的定义: 确保一个类只有一个实例,并提供一个全局访问点. 首先实例大家应该都明白就是类生成对象的过程简单的就是String s=new String(),则s就是个实例. Q:如何只生成一个实 ...

  6. java面向对象(三)之抽象类,接口,向上转型

    java类 java类分为普通类和抽象类,接口,上一节我大概讲了java类的一般格式,今天将抽象类和接口.同时讲一下它们是怎样存储的. 最重要的是理解为什么要有抽象和接口,这样学下来你猜不会迷茫,才能 ...

  7. Windows下配置Nginx

    一.今天是2017年1月18日.揣着一种也许叫做冲动的心情,决定以后每天都记录和回顾新涉及的技术,巩固已学到的知识,坚持. 二.回归到今天的技术主题,因为之前对于[反向代理]这种技术充满了好奇,借此机 ...

  8. 转载 Java基本数据类型

    Java语言是静态类型的(statical typed),也就是说所有变量和表达式的类型再编译时就已经完全确定.由于是statical typed,导致Java语言也是强类型(Strong typed ...

  9. apache如何设置缓存

    基本介绍 httpd是一个比较经典的web服务器,也就是静态资源服务器,主要用来服务于一些静态的文件,例如css,js,html等文件,所谓的静态文件,也就是不需要通过服务器进行运行的文件. 在使用静 ...

  10. Docker 入门实践

    欢迎大家前往腾讯云技术社区,获取更多腾讯海量技术实践干货哦~ 作者:张戈 导语 本文从新手视角记录了一个实际的Dokcer应用场景从创建.上传直到部署的详细过程,并简单的介绍了腾讯云容器服务的使用方法 ...