0

我想在 Docker 中获得 parquet-tools。它需要建造。但失败并显示以下错误消息。

root@f413770707af:/opt/parquet-mr# cd parquet-tools 
root@f413770707af:/opt/parquet-mr/parquet-tools# mvn clean package -Plocal
[INFO] Scanning for projects...
Downloading from jitpack.io: https://jitpack.io/org/apache/apache/16/apache-16.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/apache/16/apache-16.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.apache.parquet:parquet:1.12.0-SNAPSHOT: Could not transfer artifact org.apache:apache:pom:16 from/to jitpack.io (https://jitpack.io): Transfer failed for https://jitpack.io/org/apache/apache/16/apache-16.pom and 'parent.relativePath' points at wrong local POM @ org.apache.parquet:parquet:1.12.0-SNAPSHOT, /opt/parquet-mr/pom.xml, line 4, column 11
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project org.apache.parquet:parquet-tools:1.12.0-SNAPSHOT (/opt/parquet-mr/parquet-tools/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for org.apache.parquet:parquet:1.12.0-SNAPSHOT: Could not transfer artifact org.apache:apache:pom:16 from/to jitpack.io (https://jitpack.io): Transfer failed for https://jitpack.io/org/apache/apache/16/apache-16.pom and 'parent.relativePath' points at wrong local POM @ org.apache.parquet:parquet:1.12.0-SNAPSHOT, /opt/parquet-mr/pom.xml, line 4, column 11: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty -> [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

我试试这个,但没有奏效。互联网连接很好。并尝试另一台计算机,重现它。

这个问题可能是pom的relativePath。Maven 无法读取父 POM 并引发错误。

这是重现错误环境的 Dockerfile。

FROM python:3.7-stretch

RUN mkdir -p /usr/share/man/man1 \
    && echo 'deb http://ftp.debian.org/debian stretch-backports main' | tee /etc/apt/sources.list.d/stretch-backports.list \
    && apt-get update -yqq \
    && apt-get upgrade -yqq \
    && apt-get install -yqq --no-install-recommends \
        build-essential pv autoconf automake libtool curl make \
        g++ \
        unzip \
        libevent-dev automake libtool flex bison pkg-config xmlstarlet \
        libboost-all-dev \
        libssl-dev \
        openjdk-11-jdk 
RUN wget https://ftp.tsukuba.wide.ad.jp/software/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz \
    && tar -xzvf apache-maven-3.6.3-bin.tar.gz \
    && mv apache-maven-3.6.3 /opt/apache-maven \
    && git clone https://github.com/apache/parquet-mr.git \
    && mv parquet-mr /opt/parquet-mr

ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64/
ENV PATH $PATH:/usr/lib/jvm/java-11-openjdk-amd64/bin
ENV PATH $PATH:/opt/apache-maven/bin

RUN java -version && mvn --version\
    && wget -nv http://archive.apache.org/dist/thrift/0.12.0/thrift-0.12.0.tar.gz \
    && tar xzf thrift-0.12.0.tar.gz \
    && mv thrift-0.12.0 /opt/thrift \
    && cd /opt/thrift/ \
    && chmod +x ./configure \
    && ./configure CFLAGS=-fPIC CXXFLAGS=-fPIC -disable-gen-erl -disable-gen-hs -without-ruby -without-haskell -without-erlang -without-php -without-nodejs \
    && make install

谁能帮我?

4

1 回答 1

0

我找到了解决方案。

使用 OpenJDK-8 并使用这个 dockerfile 代码

FROM maven:3-jdk-8-alpine AS build

RUN apk add --no-cache ca-certificates git
RUN git clone --single-branch --depth=1 --branch=apache-parquet-1.9.0 https://github.com/apache/parquet-mr.git

WORKDIR /parquet-mr/parquet-tools
RUN mvn package -Plocal

FROM something/dockerimage:latest 

COPY --from=build /parquet-mr/parquet-tools/target/parquet-tools-1.9.0.jar /opt/parquet-tools.jar

OpenJDK-11 时会出现此错误。使用 OpenJDK-8。

于 2020-08-06T14:42:36.780 回答