java - Maven 依赖项仅下载 pom 而不是新版本的 jar

标签 java maven teiid

我依赖 JBoss 的 teiid 框架。如果我添加对旧版本的依赖项,它会下载 jar 文件,而如果我添加对新版本的依赖项,它只会下载 pom 文件。下面是我的 pom 配置

存储库:

  <repository>
    <id>jboss-public-repository-group</id>
    <url>http://repository.jboss.org/nexus/content/groups/public/</url>
  </repository>

这将下载 jar

<dependency>
    <groupId>org.jboss.teiid</groupId>
    <artifactId>teiid-client</artifactId>
    <version>8.5.0.Final</version>
</dependency>

这只会下载 pom 文件

<dependency>
    <groupId>org.jboss.teiid</groupId>
    <artifactId>teiid-client</artifactId>
    <version>8.9.1</version>
</dependency>

更新: Maven 日志

[INFO] Scanning for projects...
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building hello-teiid 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: http://repository.jboss.org/nexus/content/groups/public/org/jboss/teiid/teiid-client/8.9.1/teiid-client-8.9.1.pom
[INFO] Downloaded: http://repository.jboss.org/nexus/content/groups/public/org/jboss/teiid/teiid-client/8.9.1/teiid-client-8.9.1.pom (2 KB at 1.4 KB/sec)
[INFO] Downloading: http://repository.jboss.org/nexus/content/groups/public/org/jboss/as/jboss-as-parent/7.4.0.Final-redhat-4/jboss-as-parent-7.4.0.Final-redhat-4.pom
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/jboss/as/jboss-as-parent/7.4.0.Final-redhat-4/jboss-as-parent-7.4.0.Final-redhat-4.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.047 s
[INFO] Finished at: 2015-01-28T09:41:17-05:00
[INFO] Final Memory: 6M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project hello-teiid: Could not resolve dependencies for project hello:hello-teiid:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at org.jboss.teiid:teiid-client:jar:8.9.1: Failed to read artifact descriptor for org.jboss.teiid:teiid-client:jar:8.9.1: Could not find artifact org.jboss.as:jboss-as-parent:pom:7.4.0.Final-redhat-4 in jboss-public-repository-group (http://repository.jboss.org/nexus/content/groups/public/) -> [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

最佳答案

如果您搜索 this artifact in the jboss repo ,你可以在 version 8.9.1 its packaging is "bundle" 中看到,而在version 8.5.0 it was defaulted to "jar" .

现在我们已经注意到了这一点,我们可以联系@AlexandrM的评论,OSGI Bundle vs jar dependency ,

或者更具体地说,Why can't maven find an osgi bundle dependency? (请注意第二个答案,而不是已接受的答案。基本上,您需要添加一个定义它的插件,即 maven-bundle-plugin)。

关于java - Maven 依赖项仅下载 pom 而不是新版本的 jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28194867/

相关文章:

java - Solr Custom RequestHandler - 注入(inject)查询参数

java - 如何计时Java程序执行速度

属性的 Java 字段隐藏

java - preparedstatement 的 executebatch() 不返回添加的批处理数

java - 如何从 ODATA 结果集中返回计数

java - 滚动背景,JAVA

java - Maven 着色 "Project main artifact doesnt exist"

java - Spark 连接器错误 : WARN NettyUtil: Found Netty's native epoll transport, 但未在基于 linux 的操作系统上运行。改用 NIO

java - Virgo tomcat 服务器运行在 3.1.0.release of spring 我的网络应用程序依赖于 3.2.0。我该如何解决这个问题?