在Eclipse中无法解析Maven依赖项 [英] Maven dependencies not resolved in Eclipse
问题描述
我正在使用maven依赖项开发Oracle自定义身份验证插件(OAM 11g).我已经按照Oracle文档中列出的所有步骤添加了maven依赖项:
I'm developing Oracle custom authentication plugin(OAM 11g) using maven dependencies.I've followed all the steps listed in Oracle documentation to add maven dependencies:
1)使用OTN创建帐户并接受许可 2)创建我的设置文件和POM文件并添加以下内容:
1)Created account with OTN and accepted the licence 2)Created my setting file and POM file and added the following:
<server>
<id>maven.oracle.com</id>
<username>myemail@gmail.com</username>
<password>*******</password>
<configuration>
<basicAuthScope>
<host>ANY</host>
<port>ANY</port>
<realm>OAM 11g</realm>
</basicAuthScope>
<httpConfiguration>
<all>
<params>
<property>
<name>http.protocol.allow-circular-redirects</name>
<value>%b,true</value>
</property>
</params>
</all>
</httpConfiguration>
</configuration>
</server>
遵循这些步骤之后,我的Java类中仍然出现错误无法解析导入oracle.security",这意味着依赖关系并在我的程序中未解决.如果有人可以帮助我理解此问题,我将不胜感激.谢谢
After following these steps, I still getthe error "The import oracle.security cannot be resolved" in my Java class, which means the dependencies and not resolved in my program. I would appreciate if anybody out there can help me understand this issue.Thanks
推荐答案
我认为此问题与oracle安全性无关.由于许可限制,与oracle相关的jars通常不会发布到maven Central.您将需要
I don't think this issue is related to oracle security. Jars related to oracle are not usually published to maven central due to licensing restriction. You will need to
- 将jar手动上传到您公司的联系或人工产品.
- 或者将它们与您的项目一起使用,并使用系统依赖性机制.
- Upload jars manually to your company nexus or artifactory.
- OR keep them along with your project and use system dependency mechanism.
第2点说明:
- 在项目中维护一个jar文件夹,并将jar文件保存在其中.
- 在pom中的依赖项片段中,
<dependencies>
<dependency>
<groupId>oracle.security</groupId>
<artifactId>oracle-api</artifactId>
<version>2.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/jars/oracle-api.jar</systemPath>
</dependency>
</dependencies>
重复上面的其他罐子.
这将解决您的The import oracle.security cannot be resolved
异常.
这篇关于在Eclipse中无法解析Maven依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!