我在詹金斯(Jenkins)创建了一项作业,其中有一些目标(清洁验证编译)。但是,当我运行工作时,有错误:
[ERROR] Failed to execute goal on project NameProject: Could not resolve dependencies for project NameProject:x:war:0.0.1-SNAPSHOT: The following artifacts could not be resolved: com.oracle:ojdbc14:jar:10.2.0.5, org.primefaces.themes:sentinel-theme:jar:2.1.2: Could not find artifact com.oracle:ojdbc14:jar:10.2.0.5 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
我在Maven中创建了手动依赖性
mvn install:install-file
-Dfile=<path-to-file>
-DgroupId=<group-id>
-DartifactId=<artifact-id>
-Dversion=<version>
-Dpackaging=<packaging>
-DgeneratePom=true
,但詹金斯不知道POM中的这种依赖性。当我在Maven中执行验证编译时,它的作品!
如果要将其安装到本地存储库中,则需要将其安装到詹金斯服务器(Jenkins Server)使用的本地存储库中。您需要在Jenkins服务器上启动MVN安装。
如果您有公司Nexus服务器,则最好将其安装在此处。
我更改了默认的本地存储库maven
<localRepository>C:/Users/nameUser/.m2/repository</localRepository>
当存储库中的存储库(C:)。