在Intellij(Linux-VM)中创建Maven项目时出错

时间:2019-03-08 07:11:56

标签: java maven intellij-idea

我试图在Linux 16中的Intellij中创建一个Maven项目。这总是使我出错。尝试使用网络上可用的解决方案,但无济于事。

这是我得到的错误:

/usr/lib/jvm/java-7-oracle-cloudera/bin/java 
-Dmaven.multiModuleProjectDirectory=/tmp/archetypetmp 
-Dmaven.multiModuleProjectDirectory -Dmaven.home=/usr/share/maven 
-Dclassworlds.conf=/usr/share/maven/bin/m2.conf -Dfile.encoding=UTF-8 
-classpath /usr/share/maven/boot/plexus-classworlds-2.x.jar 
org.codehaus.classworlds.Launcher -Didea.version=2018.3.5 
-DinteractiveMode=false -DgroupId=com.test.java "-DartifactId=Java Proj" 
-Dversion=1.0-SNAPSHOT -DarchetypeGroupId=org.apache.maven.archetypes 
-DarchetypeArtifactId=maven-archetype-quickstart 
-DarchetypeVersion=RELEASE org.apache.maven.plugins:maven-archetype-
plugin:RELEASE:generate
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins
/maven-archetype-plugin/maven-metadata.xml

[WARNING] Could not transfer metadata org.apache.maven.plugins:maven-
archetype-plugin/maven-metadata.xml from/to central 
(https://repo.maven.apache.org/maven2): Received fatal alert: 
protocol_version
[INFO] 

------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] 
------------------------------------------------------------------------
[INFO] Total time: 1.460 s
[INFO] Finished at: 2019-03-08T01:41:55-05:00
[INFO] Final Memory: 7M/146M
[INFO] 
------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-archetype-plugin:RELEASE or 
one of its dependencies could not be resolved: Failed to read artifact 
descriptor for org.apache.maven.plugins:maven-archetype-
plugin:jar:RELEASE: Failed to resolve version for 
org.apache.maven.plugins:maven-archetype-plugin:jar:RELEASE: Could not 
find metadata org.apache.maven.plugins:maven-archetype-plugin/maven-
metadata.xml in local (/home/vishnu/.m2/repository) -> [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
[ERROR] Maven execution terminated abnormally (exit code 1)

1 个答案:

答案 0 :(得分:1)

好的,所以我解决了。我没有更改JRE,所以请不要忘记JRE。发布答案,以便将来对某人有用。附加图像以供参考。

也可以将其用于VM选项。

 -Dmaven.multiModuleProjectDirectory

Snapshot of the solution