带有生成POM的Maven安装仍会生成未找到POM错误

时间:2018-07-06 06:01:26

标签: java maven

mvn install:install-file -DgroupId=com.oracle 
-DartifactId=ojdbc7 -Dfile=ojdbc7.jar -Dpackaging=jar -Dversion=12.1.0.2 -DgeneratePom=true

安装成功...

[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------------< XXXX:XXXX >----------------------------
[INFO] Building XXXX 18.2.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ XXXX ---
[INFO] Installing C:\Projects\XXXX-svn\trunk\XXXX\ojdbc7.jar to C:\Users\QXV0615\.m2\repository\com\oracle\ojdbc7\12.1.0.2\ojdbc7-12.1.0.2.jar
[INFO] Installing C:\Users\QXV0615\AppData\Local\Temp\mvninstall491035374333687338.pom to C:\Users\QXV0615\.m2\repository\com\oracle\ojdbc7\12.1.0.2\ojdbc7-12.1.0.2.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.096 s
[INFO] Finished at: 2018-07-06T07:30:13+02:00
[INFO] ------------------------------------------------------------------------

但是然后

mvn安装

[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------------< XXXX:XXXX >----------------------------
[INFO] Building XXXX 18.2.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[WARNING] The POM for com.oracle.jdbc:ojdbc7:jar:12.1.0.2 is missing, no dependency information available
[WARNING] The POM for com.ibm.mq:jms:jar:7.0.1.9 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.993 s
[INFO] Finished at: 2018-07-06T07:30:26+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project XXXX: Could not resolve dependencies for project XXXX:XXXX:war:18.2.0-SNAPSHOT: The following artifacts could not be resolved: com.oracle.jdbc:ojdbc7:jar:12.1.0.2, com.ibm.mq:jms:jar:7.0.1.9: Failure to find com.oracle.jdbc:ojdbc7:jar:12.1.0.2 in https://repo.maven.apache.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]

依赖关系是:

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc7</artifactId>
    <version>12.1.0.2</version>
</dependency>

1 个答案:

答案 0 :(得分:3)

您的项目取决于

com.oracle.jdbc:ojdbc7:jar:12.1.0.2

您正在使用-DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0.2安装JAR,因此它将安装为

com.oracle:ojdbc7:jar:12.1.0.2

请注意,Maven坐标不匹配,或者将JAR与第一个Maven坐标一起安装,或者使项目依赖于第二个Maven坐标。