[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下防火墙没有关闭