报错:
maven-default-http-blocker (http://0.0.0.0/)
316#13 12.23 [ERROR] Failed to execute goal on project serviceScoreContract: Could not resolve dependencies for project com.ranger.order:serviceScoreContract:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at com.ranger:ranger-common:jar:0.0.1-SNAPSHOT: Failed to read artifact descriptor for com.ranger:ranger-common:jar:0.0.1-SNAPSHOT: Could not transfer artifact com.ranger:ranger-common:pom:0.0.1-SNAPSHOT from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [nexus-daocloud (http://nexus.daocloud.io/repository/maven-public/, default, releases+snapshots), central (http://repo1.maven.org/maven2/, default, releases+snapshots), public (http://nexus.aaaa.com/repository/maven-public/, default, releases+snapshots)] -> [Help 1]
Dockerfile:
# --- build
FROM maven:3-jdk-8 AS build
RUN mkdir /app
WORKDIR /app
COPY serviceent serviceent
COPY serviceact serviceact
COPY pom.xml pom.xml
RUN mvn -f ./pom.xml package && mv ./serviceent/target/serviceent-0.0.1-SNAPSHOT.jar app.jar && mvn clean
# --- run
FROM java:8-jre-alpine
COPY --from=build /app/app.jar app.jar
CMD java -Xmx256m -jar -Dspring.profiles.active=production app.jar
之前一直没问题,最近打包失败
原因:
https://maven.apache.org/docs/3.8.1/release-notes.html
maven3.8.1 为了解决CVE-2021-26291 这个漏洞,将http 的仓库禁用了。。。而且默认配置了一个http://0.0.0.0 的mirrors,如果自己项目的pom.xml里面配置的是http的仓库,那就会造成拉不到包。。。
解决方法就是把nexus仓库配置成https,然后吧pom.xml里面的http地址改成https的就行了