mvn clean package fails without error

I encountered a pit today. When I use maven to package it, it fails and no error is reported. The
script snippet is as follows:
mvn clean package -Dmaven.test.skip=true
[ $? -ne 0 ] && echo -e "\033[31m BUILD FAILED!!! \033[0m" && exit -1;

has always been: The reason for the
BUILD FAILED

problem is that manven goes back to apply for a large chunk of memory when compiling, I don't know why, it seems to be 2G by default , so if the application fails, it will return -1
[ $? -ne 0 ] && echo -e "\033[31m BUILD FAILED!!! \033[0m" && exit -1;
this script will be treated as a failure , is actually successful.
By setting export MAVEN_OPTS="-Xms512m -Xmx512m" , the problem is solved.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326643704&siteId=291194637