无法解析maven依赖项

问题描述 投票:2回答:3

在我的项目中,我在pom.xml中添加了以下两个依赖项:

<dependency>
    <groupId>oracle</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.2.0.3</version>
</dependency>
<dependency>
    <groupId>antlr</groupId>
    <artifactId>antlr</artifactId>
    <version>2.7.7</version>
</dependency>

仍然在构建时,maven无法找到上述两个依赖项。我收到以下错误:

[INFO] The following files have NOT been resolved:
[INFO]    antlr:antlr:jar:sources:2.7.7:compile
[INFO]    oracle:ojdbc6:jar:sources:11.2.0.3:compile

我怎么解决这个问题?

java maven
3个回答
0
投票

对于这一个:

<dependency>
    <groupId>oracle</groupId>
    <artifactId>ojdbc6</artifactId>
    <version>11.2.0.3</version>
</dependency>

您必须在settings.xml中添加此存储库:

<repository>
    <id>maven.oracle.com</id>
    <name>oracle-maven-repo</name>
    <url>https://maven.oracle.com</url>
    <layout>default</layout>
    <releases>
        <enabled>true</enabled>
        <updatePolicy>always</updatePolicy>
    </releases>
</repository>

创建一个oracle帐户(它是免费的)并将其添加到settings.xml中的服务器块:

    <server>
        <id>maven.oracle.com </id>
        <username>username</username>
        <password>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>

对于第二个,我需要有关错误消息的更多详细信息。请给我完整的堆栈跟踪。


0
投票

Maven Central没有ojdbc6

请注意,它只是它无法下载的来源。有时项目缺少项目的来源。


0
投票

请使用以下链接了解如何将OJDBC用于您的应用程序。 This link might help solving your problem

© www.soinside.com 2019 - 2024. All rights reserved.