IntelliJ IDEA-Maven2-安装

时间:2019-07-05 10:45:11

标签: maven intellij-idea

我从专用存储库下载一个项目,当我尝试安装时,显示错误消息,我需要Maven2。问题是当我下载IntelliJ IDEA时,我下载了提供Maven3的最新版本。

问题是...可以在IntelliJ IDEA中更改Maven版本吗?

因为其他问题是当我安装项目时在控制台中显示下一个错误。

Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-site-plugin/2.0-beta-7/maven-site-plugin-2.0-beta-7.jar
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-site-plugin:maven-plugin:2.0-beta-7' from repository central (http://repo1.maven.org/maven2): Error transferring file: repo1.maven.org
[INFO] Skipping missing optional mojo: org.apache.maven.plugins:maven-site-plugin:attach-descriptor
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.2/maven-install-plugin-2.2.jar
[WARNING] Unable to get resource 'org.apache.maven.plugins:maven-install-plugin:maven-plugin:2.2' from repository central (http://repo1.maven.org/maven2): Error transferring file: repo1.maven.org
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] A required plugin was not found: Plugin could not be found - check that the goal name is correct: Unable to download the artifact from any repository

Try downloading the file manually from the project website.

Then, install it using the command: 
    mvn install:install-file -DgroupId=org.apache.maven.plugins -DartifactId=maven-install-plugin -Dversion=2.2 -Dpackaging=maven-plugin -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there: 
    mvn deploy:deploy-file -DgroupId=org.apache.maven.plugins -DartifactId=maven-install-plugin -Dversion=2.2 -Dpackaging=maven-plugin -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]


  org.apache.maven.plugins:maven-install-plugin:maven-plugin:2.2

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)


  org.apache.maven.plugins:maven-install-plugin:maven-plugin:2.2

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)

但是我认为问题不在于代理,而是repo1.maven.org适用于maven3。

1 个答案:

答案 0 :(得分:-1)

IntelliJ IDEA(在Mac上为2019.1.3版)设置更改Maven主目录的路径。

Preferences | Build, Execution, Deployment | Build Tools | Maven