从JENKINS触发生成时,出现错误为“在中央找不到工件com.oracle:ojdbc6:jar:6.0.0”

时间:2018-09-16 17:59:08

标签: java maven jenkins

我正在尝试通过JENKINS作业为我的Spring Maven项目进行构建和部署,但出现以下错误:

Downloading from central: https://repo.maven.apache.org/maven2/com/oracle/ojdbc6/6.0.0/ojdbc6-6.0.0.pom
[WARNING] The POM for com.oracle:ojdbc6:jar:6.0.0 is missing, no dependency information available
Downloading from central: https://repo.maven.apache.org/maven2/com/oracle/ojdbc6/6.0.0/ojdbc6-6.0.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.942 s
[INFO] Finished at: 2018-09-16T23:17:15+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project SpringBootSmaple: Could not resolve dependencies for project com.springboot.practise:SpringBootSmaple:war:0.1: Could not find artifact com.oracle:ojdbc6:jar:6.0.0 in central (https://repo.maven.apache.org/maven2) -> [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
Build step 'Invoke top-level Maven targets' marked build as failure
Unable to deploy to IBM WebSphere Application Server, Build Result = FAILURE
Finished: FAILURE

我还使用以下命令在maven中安装了ojdbc jar:

mvn install:install-file -Dfile=C:\Documents\SharedJars\ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=6.0.0 -Dpackaging=jar

但是仍然出现相同的错误。请有人指导。

1 个答案:

答案 0 :(得分:0)

继续此处- 您使用的mvn install命令可以将jar正确地安装到.m2文件夹中(仅适用于当前用户)-它将放置在<userdir>\.m2\com\oracle\..etc..下。

在目标项目上尝试mvn package;它应该找到依赖项。

Jenkins可能是由其他用户启动的吗?在这种情况下,您应该使用该用户运行mvn install(首选方法是建立公司存储库,并使用mvn deploy您的工件,以便所有用户都可以使用此依赖项。)