Maven存储库设置不起作用 [英] maven repository setup not working

查看:101
本文介绍了Maven存储库设置不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在POM.xml中引用一个存储库以将ojdbc.jar添加到我的项目中,但是Maven(我使用STS插件)一直告诉我找不到该jar.
我正在显示我的存储库和POM.xml中定义的jar依赖项.

I am referencing a repository in my POM.xml to add the ojdbc.jar to my project but Maven (I use the STS plugin) keeps telling me it can't find the jar.
I am showing below my repositories and jar dependency as defined in my POM.xml.

有人知道为什么找不到该罐子吗?我的POM.xml是否设置不正确?

Anyone has an idea as to why the jar can't be found? Is my POM.xml not setup properly?

请注意,由于vaadin jar已正确添加到我的项目中,因此vaadin回购可以正常工作.

Note the vaadin repo works fine as the vaadin jars are correctly added to my project.

  <repositories>

    <repository>
    <id>myrepo</id>
    <url>http://mvnrepository.com/</url>
    </repository>

    <repository>
    <id>vaadin-addons</id>
    <url>http://maven.vaadin.com/vaadin-addons</url>
    </repository>
  </repositories>

,这是在 http://mvnrepository.com/artifact/ojdbc中定义的依赖项设置/ojdbc/14 :

<dependencies>
<dependency>
  <groupId>ojdbc</groupId>
  <artifactId>ojdbc</artifactId>
  <version>14</version>
</dependency>
</dependencies>

推荐答案

有人知道为什么找不到该罐子吗?

Anyone has an idea as to why the jar can't be found?

由于许可证限制,找不到jar .

The jar can't be found due to license constraints.

我的POM.xml是否设置不正确?

Is my POM.xml not setup properly?

不,不是,但是将依赖项添加到pom:

No it isn't, but adding to your pom the dependency:

<dependency>
    <groupId>ojdbc</groupId>
    <artifactId>ojdbc</artifactId>
    <version>14</version>
</dependency>

您可以仅下载 ojdbc14 pom,因为它没有关于发行的许可证限制.

you are able to download only the ojdbc14 pom because it has not a license limitation about distribution.

为了使上述依赖关系起作用,必须将jar手动安装到本地Maven存储库中,

In order to make the above dependency works the jar has to be manually installed into your local Maven repository, without violating the license, by running:

mvn install:install-file -Dfile={Path_to_your_ojdbc.jar} -DgroupId=ojdbc 
-DartifactId=ojdbc -Dversion=14 -Dpackaging=jar

最终在-Dversion属性中更改为适当的版本号,如 user1570577 正确建议的那样.

eventually changing to the appropriate version number in -Dversion attribute, as correctly suggested by user1570577.

这篇关于Maven存储库设置不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆