[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could

Jenkins 导入Maven项目,编译时候出错

[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 from/to central (https://repo.maven.apache.org/maven2): Specified destination directory cannot be created: /maven/repository/org/apache/maven/plugins/maven-clean-plugin/2.4.1 -> [Help 1]
[JENKINS] Archiving /var/lib/jenkins/workspace/test-for-maven2/pom.xml to springmvc-maven/easy-springmvc-maven/0.0.1-SNAPSHOT/easy-springmvc-maven-0.0.1-SNAPSHOT.pom
[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
channel stopped
Finished: FAILURE

解决办法

https://blog.csdn.net/zoubf/article/details/51009476

  • 打开maven配置文件(maven安装目录下的settings.xml文件)

  • 搜索mirrors关键字,加入mirror镜像节点

    <mirror>
            <id>osc</id>
            <mirrorOf>*</mirrorOf>
            <url>http://maven.oschina.net/content/groups/public/</url>
    </mirror>
    
  • 找到 localRepository

    <localRepository>/maven/repository</localRepository>
    
  • 创建上面的目录

    mkdir -p /maven/repository
    chown -R jenkins.jenkins /maven
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值