docker搭建jenkins出现插件找不到问题


想着自己搭一下jenkins,于是拿起docker就开干,环境都配置好了,仓库也配置好了。结果在构建的时候一直报插件找不到......

<pre class="console-output" style="box-sizing: inherit; font-size: var(--font-size-monospace); white-space: pre-wrap; overflow-wrap: break-word; margin: 0px; color: rgb(51, 51, 51); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">[ERROR] Plugin org.springframework.boot:spring-boot-maven-plugin:2.2.6.RELEASE or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.springframework.boot:spring-boot-maven-plugin:jar:2.2.6.RELEASE: Could not transfer artifact org.springframework.boot:spring-boot-maven-plugin:pom:2.2.6.RELEASE from/to nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public): /usr/local/maven/repo/org/springframework/boot/spring-boot-maven-plugin/2.2.6.RELEASE/spring-boot-maven-plugin-2.2.6.RELEASE.pom.part.lock (No such file or directory) -> [Help 1] Waiting for Jenkins to finish collecting data
[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/PluginResolutionException</pre>

遇事不决先百度,大多数给出的解决方案是改pom文件,指定插件版本或者添加阿里云插件下载地址。都试了一下,发现还是报一样的错。仔细看报错jenkins控制台日志,发现如下一行

原来我的jenkins容器无法在/usr/local/maven文件夹下面创建文件

解决方案:

使用root进入jenkins容器

docker exec -it -u root [jenkins容器id] /bin/bash

给jenkins添加权限

chown -R jenkins:jenkins /usr/local/maven
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容