当前位置: 首页 > 知识库问答 >
问题:

jenkins maven无法解析项目的依赖项

华浩壤
2023-03-14

我想通过Jenkins用maven Build运行一个项目。

使用的存储库-Git从存储库中提取代码

使用的构建工具--Maven

我的jenkins控制台输出

请注意:-如果你看不到图像,只需使用Ctrl++缩放即可

    FailedConsole Output

    Started by user jones
    [EnvInject] - Loading node environment variables.
    Building on master in workspace C:\Program Files (x86)\Jenkins\jobs\Mar31SpringMVCPOC\workspace
     > C:\Program Files (x86)\Git\cmd\git.exe rev-parse --is-inside-work-tree # timeout=10
    Fetching changes from the remote Git repository
     > C:\Program Files (x86)\Git\cmd\git.exe config remote.origin.url https://github.com/jonesjalapatgithub/Mar31Springpoc.git # timeout=10
    Fetching upstream changes from https://github.com/jonesjalapatgithub/Mar31Springpoc.git
     > C:\Program Files (x86)\Git\cmd\git.exe --version # timeout=10
    using .gitcredentials to set credentials
     > C:\Program Files (x86)\Git\cmd\git.exe config --local credential.helper store --file=\"C:\Windows\TEMP\git5818541449937257930.credentials\" # timeout=10
     > C:\Program Files (x86)\Git\cmd\git.exe -c core.askpass=true fetch --tags --progress https://github.com/jonesjalapatgithub/Mar31Springpoc.git +refs/heads/*:refs/remotes/origin/*
     > C:\Program Files (x86)\Git\cmd\git.exe config --local --remove-section credential # timeout=10
     > C:\Program Files (x86)\Git\cmd\git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
     > C:\Program Files (x86)\Git\cmd\git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
    Checking out Revision 21788e4bc94fb2bd274935890a302529f8a17c6a (refs/remotes/origin/master)
     > C:\Program Files (x86)\Git\cmd\git.exe config core.sparsecheckout # timeout=10
     > C:\Program Files (x86)\Git\cmd\git.exe checkout -f 21788e4bc94fb2bd274935890a302529f8a17c6a
     > C:\Program Files (x86)\Git\cmd\git.exe rev-list 21788e4bc94fb2bd274935890a302529f8a17c6a # timeout=10
    [workspace] $ D:\softwares\apache-maven-3.0.3\bin\mvn.bat clean install
    [INFO] Scanning for projects...
    [WARNING] 
    [WARNING] Some problems were encountered while building the effective model for com.demo.common:SpringMVC:war:1.0-SNAPSHOT
    [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 79, column 12
    [WARNING] 
    [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
    [WARNING] 
    [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
    [WARNING] 
    [INFO]                                                                         
    [INFO] ------------------------------------------------------------------------
    [INFO] Building SpringMVC Maven Webapp 1.0-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    Downloading: http://repo1.maven.org/maven2/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE.pom

    Downloading: http://repo1.maven.org/maven2/org/springframework/spring-web/3.0.5.RELEASE/spring-web-3.0.5.RELEASE.pom

    Downloading: http://repo1.maven.org/maven2/org/springframework/spring-webmvc/3.0.5.RELEASE/spring-webmvc-3.0.5.RELEASE.pom

    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 0.494s
    [INFO] Finished at: Tue Mar 31 19:14:37 IST 2015
    [INFO] Final Memory: 4M/149M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal on project SpringMVC: Could not resolve dependencies for project com.demo.common:SpringMVC:war:1.0-SNAPSHOT: Failed to collect dependencies for [org.springframework:spring-core:jar:3.0.5.RELEASE (compile), org.springframework:spring-web:jar:3.0.5.RELEASE (compile), org.springframework:spring-webmvc:jar:3.0.5.RELEASE (compile), org.mockito:mockito-all:jar:1.8.5 (test), junit:junit:jar:4.5 (test)]: Failed to read artifact descriptor for org.springframework:spring-core:jar:3.0.5.RELEASE: Could not transfer artifact org.springframework:spring-core:pom:3.0.5.RELEASE from/to central (http://repo1.maven.org/maven2): Access denied to: http://repo1.maven.org/maven2/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE.pom -> [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
    Notifying upstream projects of job completion
    Finished: FAILURE

共有1个答案

傅穆冉
2023-03-14

我找到了解决这个问题的办法。

我创建了另一个Jenkins用户,然后创建了另一个Jenkins项目。

我也很惊讶,这个项目通过下载它的依赖项而成功了。我不知道它是怎么或者为什么在前一个案例中不起作用的。

 类似资料:
  • 我希望有人面对同样的问题来解决依赖。下面提到的文件 xsi:schemalocation=“http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd”xmlns=“http://maven.apache.org/pom/4.0.0”xmlns:xsi=“http://www.w3.org/2001/x

  • 我对Android的Gradle构建有问题。我尝试了很多方法来解决这个问题,但没有什么不起作用。我需要帮助。 Gradle版本:4.4 Gradle插件:3.0.1 错误:无法解析app@serverDebug /compileClasspath的依赖关系:无法解析项目:vksdk_library。 错误:无法解析“”的依存关系:app@mockDebugAndroidTest/compileCl

  • 我是Android Studio的新手,面临以下错误。 错误:无法解析“:”的依赖项app@debug/compileClasspath“:无法解析项目:floatinglibrary。显示受影响模块的详细信息:应用 错误:无法解析“:app@debug/编译类路径”的依赖关系:无法解析项目:d时间筛选库。显示详细信息 受影响的模块:应用

  • 我试图在Heroku中部署maven web应用程序,它依赖于其他应用程序。当我试图部署应用程序时,却遇到了这个错误。我不知道在传递依赖项时出了什么问题。 错误日志-------- !错误:未能用Maven构建应用程序,我们很抱歉这个构建失败了!如果您在应用程序代码中找不到问题,请提交一张票证,以便我们提供帮助:https://help.heroku.com/!推送被拒绝,无法编译Java应用程序

  • 问题是gradle找不到依赖项的jar,但gradle找错了地方。Gradle一直在错误的目录(谷歌和Android支持libary的目录)中搜索文件.... 在以下位置搜索:文件:/d://programme/androis-sdks/extras/android/m2repository/org/springframework/android/spring-android-rest-templ

  • 我是一名新的Android学习者,我正在为语言翻译制作我的第一个Android应用程序。在添加了一些依赖项之后,我遇到了一些问题。我该怎么解决这个问题? Gradle同步失败:无法解决配置的所有依赖项: app: dedegRuntimeClasspath。无法确定android.arch.lifecycle的工件: livedata: 1.1.1:脱机模式下没有缓存版本有关详细信息,请参阅IDE