M1 Mac环境下Maven项目构建失败求助(已用Azul Zulu JDK8)
M1 Mac下Maven项目构建失败排查请求
基础环境
- 设备:M1芯片Mac电脑
- JDK:Azul Zulu JDK8(已安装适配M1的aarch64版本)
- Java版本输出:
java -version openjdk version "1.8.0_345" OpenJDK Runtime Environment (Zulu 8.64.0.19-CA-macos-aarch64) (build 1.8.0_345-b01) OpenJDK 64-Bit Server VM (Zulu 8.64.0.19-CA-macos-aarch64) (build 25.345-b01, mixed mode) javac -version javac 1.8.0_345
- 执行构建命令:
mvn clean install -e - 问题:执行命令后构建失败,错误截图如下:

- 已尝试修复:将frontend-maven-plugin升级至适配M1的1.11.0版本,问题仍未解决
ems_react_ui模块的pom.xml内容
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.inc.gem</groupId> <artifactId>ems_react_ui</artifactId> <packaging>pom</packaging> <version>1.0-SNAPSHOT</version> <parent> <groupId>com.inc</groupId> <artifactId>gem</artifactId> <version>1.0-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <java.version>1.8</java.version> </properties> <build> <finalName>ems_react_ui</finalName> <plugins> <plugin> <artifactId>maven-clean-plugin</artifactId> <version>2.4.1</version> <configuration> <filesets> <fileset> <directory>../ems/src/main/webapp/scripts/react</directory> <includes> <include>**/**</include> </includes> <followSymlinks>false</followSymlinks> </fileset> <fileset> <directory>./node</directory> <includes> <include>**/**</include> </includes> <followSymlinks>false</followSymlinks> </fileset> </filesets> </configuration> </plugin> <plugin> <groupId>com.github.eirslett</groupId> <artifactId>frontend-maven-plugin</artifactId> <version>1.11.0</version> <configuration> <workingDirectory>./</workingDirectory> <environmentVariables> <!-- Avoid certificates issues for npm install, needed behind a corporate proxy --> <NODE_TLS_REJECT_UNAUTHORIZED>0</NODE_TLS_REJECT_UNAUTHORIZED> </environmentVariables> </configuration> <executions> <execution> <id>install node and npm</id> <goals> <goal>install-node-and-npm</goal> </goals> <configuration> <nodeVersion>v12.14.1</nodeVersion> <npmVersion>3.10.8</npmVersion> </configuration> </execution> <execution> <!-- npm runs in the docker context and needs to be normal user for execution --> <id>npm config set user root</id> <goals> <goal>npm</goal> </goals> <configuration> <arguments>config set user root</arguments> </configuration> </execution> <execution> <id>npm i</id> <goals> <goal>npm</goal> </goals> <configuration> <arguments>i</arguments> </configuration> </execution> <execution> <id>npm run build</id> <goals> <goal>npm</goal> </goals> <configuration> <arguments>run build</arguments> </configuration> </execution> </executions> </plugin> <plugin> <artifactId>maven-resources-plugin</artifactId> <version>3.1.0</version> <executions> <execution> <id>copy-react-to-webapp</id> <phase>install</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>../ems/src/main/webapp/scripts/react/dist</outputDirectory> <resources> <resource> <directory>./dist</directory> </resource> </resources> </configuration> </execution> <execution> <id>copy-mainjs-to-webapp</id> <phase>install</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>../ems/src/main/webapp/scripts/react/</outputDirectory> <resources> <resource> <directory>./</directory> <includes> <include>main.js</include> </includes> <filtering>true</filtering> </resource> </resources> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>
当前系统PATH环境变量
/Users/danieljohnson/.pyenv/shims:/Users/danieljohnson/.pyenv/bin:/Users/danieljohnson/.nvm/versions/node/v10.24.1/bin:/usr/local/opt/python@3.7/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/python@3.7/bin/pip3:/usr/local/opt/python@3.7/bin/python3:/Applications/Postgres.app/Contents/Versions/latest/bin
请帮忙排查该Maven项目构建失败的原因。
内容的提问来源于stack exchange,提问作者Daniel Johnson
相关产品推荐
相关产品推荐

