docker打包maven容器编译springboot项目报错

[root@weewemice]# docker run -it --rm -v maven-repo:/root/.m2 -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven registry.cn-hangzhou.aliyuncs.com/acs/maven:3-jdk-8 mvn clean package -DskipTests
[INFO] Scanning for projects...
Downloading from aliyun-nexus: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-dependencies/2.1.3.RELEASE/spring-boot-dependencies-2.1.3.RELEASE.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: commons-fileupload:commons-fileupload:jar -> duplicate declaration of version 1.3.2 @ line 92, column 21
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: commons-codec:commons-codec:jar -> duplicate declaration of version 1.9 @ line 97, column 21
[FATAL] Non-resolvable parent POM for org.hoyozero.mice:mice:1.0-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-dependencies:pom:2.1.3.RELEASE from/to aliyun-nexus (http://maven.aliyun.com/nexus/content/groups/public/): maven.aliyun.com: Temporary failure in name resolution and 'parent.relativePath' points at no local POM @ line 11, column 13
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project org.hoyozero.mice:mice:1.0-SNAPSHOT (/usr/src/mymaven/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for org.hoyozero.mice:mice:1.0-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-dependencies:pom:2.1.3.RELEASE from/to aliyun-nexus (http://maven.aliyun.com/nexus/content/groups/public/): maven.aliyun.com: Temporary failure in name resolution and 'parent.relativePath' points at no local POM @ line 11, column 13: Unknown host maven.aliyun.com: Temporary failure in name resolution -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
[root@iZ2zea17dskhimi1m716kfZ mice]# docker run -it --rm -v maven-repo:/root/.m2 -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven registry.cn-hangzhou.aliyuncs.com/acs/maven:3-jdk-8 mvn clean package -DskipTests
 
 

这是实际运行的命令 

docker run -it --rm --name my-maven-project -v /workspace/maven-rep:/root/.m2 -v "$PWD":/usr/src/mymaven -w /usr/src/mymaven registry.cn-hangzhou.aliyuncs.com/acs/maven:3-jdk-8 mvn clean package -Ptest -Dmaven.test.skip=true

记录一下错误原因 我的错误原因是linux下防火墙没有关闭

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值