Я получаю странную ошибку, maven не работает с sudo.
при выполнении mvn clean install -DskipTests
я получил эту ошибку:
Failed to execute goal org.fortasoft:gradle-maven-plugin:1.0.8:invoke (default) on project http: Execution default of goal org.fortasoft:gradle-maven-plugin:1.0.8:invoke failed: Plugin org.fortasoft:gradle-maven-plugin:1.0.8 or one of its dependencies could not be resolved: Failed to collect dependencies at org.fortasoft:gradle-maven-plugin:jar:1.0.8 -> org.gradle:gradle-tooling-api:jar:2.13: Failed to read artifact descriptor for org.gradle:gradle-tooling-api:jar:2.13: Could not transfer artifact org.gradle:gradle-tooling-api:pom:2.13 from/to gradle (http://repo.gradle.org/gradle/libs-releases-local/): Access denied to: http://repo.gradle.org/gradle/libs-releases-local/org/gradle/gradle-tooling-api/2.13/gradle-tooling-api-2.13.pom , ReasonPhrase:Forbidden. -> [Help 1]
[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/PluginResolutionException
поэтому я попробовал sudo mvn clean install -DskipTests
и, как ни странно, я получил эту ошибку:
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
после выполнения mvn -v
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 1.8.0_251, vendor: Oracle Corporation, runtime: /home/akshay/java/jdk1.8.0_251/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "5.3.0-45-generic", arch: "i386", family: "unix"
и при выполнении с sudo sudo mvn -v
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
мои переменные env:
export JAVA_HOME=/home/akshay/java/jdk1.8.0_251
export PATH=$PATH:$JAVA_HOME/bin