java - MAVEN 项目未创建

标签 java maven netbeans windows-7-x64

我正在尝试使用 Netbeans 8.2 使用 Maven 创建 Web 服务,但是没有创建任何内容,并且得到以下输出。

cd D:\Applications\mavenproject1; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_121\\jre" "M2_HOME=C:\\Program Files (x86)\\apache-maven-3.3.9" cmd /c "\"\"C:\\Program Files (x86)\\apache-maven-3.3.9\\bin\\mvn.cmd\" -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=ejb-javaee7 -DarchetypeVersion=1.1 -DarchetypeRepository=http://repo.maven.apache.org/maven2 -DgroupId=com.iirosa -DartifactId=mavenproject1-ejb -Dversion=1.0-SNAPSHOT -Dbasedir=D:\\Applications\\mavenproject1 -Darchetype.interactive=false -Dmaven.ext.class.path=\"C:\\Program Files\\NetBeans 8.2\\java\\maven-nblib\\netbeans-eventspy.jar\" --batch-mode archetype:generate\""
Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.4: Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.4
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.3/maven-site-plugin-3.3.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-site-plugin:3.3: Plugin org.apache.maven.plugins:maven-site-plugin:3.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-site-plugin:jar:3.3
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-antrun-plugin:jar:1.3
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-5/maven-assembly-plugin-2.2-beta-5.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/2.8/maven-dependency-plugin-2.8.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-dependency-plugin:2.8: Plugin org.apache.maven.plugins:maven-dependency-plugin:2.8 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:2.8
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-release-plugin/2.3.2/maven-release-plugin-2.3.2.pom
Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-release-plugin:2.3.2: Plugin org.apache.maven.plugins:maven-release-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-release-plugin:jar:2.3.2
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Failure to transfer org.apache.maven.plugins/maven-metadata.xml from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Failure to transfer org.codehaus.mojo/maven-metadata.xml from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 2.418 s
Finished at: 2017-01-31T14:58:29+03:00
Final Memory: 12M/309M
------------------------------------------------------------------------
No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\Feras.Felimban\.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

Windows7 64 位 -- Netbeans 8.2 -- JDK8 更新 121 -- apache-maven-3.3.9 -- glassfish 4.1.1

我查看了之前与我相关的问题,并尝试了所有建议的解决方案,但没有任何效果。环境变量已全部设置:

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
M2_HOME=C:\Program Files (x86)\apache-maven-3.3.9
MAVEN_HOME=C:\Program Files (x86)\apache-maven-3.3.9
MAVEN_OPTS=-Xms256m -Xmx512m
PATH=....;%M2_HOME%\bin;%M2%

enter image description here

请注意,该项目根本没有被创建,所以这并不是我无法打开项目的情况。

我访问了输出显示的网站,但我没有运气(:

感谢您的帮助。

最佳答案

这看起来您可能是在公司代理后面。

您需要按照 Maven - Guide to using proxies 中的说明进行操作.

此外,我建议删除 M2_HOMEMAVEN_HOME 环境变量。请参阅MAVEN_HOME, MVN_HOME or M2_HOME 。直接设置%PATH%即可。

关于java - MAVEN 项目未创建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41957707/

相关文章:

java - 网络服务器的实现

java - 如果添加了名称模板,为什么 Eclipse 无法识别多模块 Maven 项目的 Java 性质?

java - 使用 tomcat 的简单 Java Web 应用程序,从本地主机到部署

java - 创建 JavaFX 可执行文件,包括 JRE 和外部库

java - 如何在 Glassfish (2.x) 中设置 RMI,以便注入(inject)远程 EJB

java - Spock通过Maven启动后测试不成功

java - 修改库存程序以使用 GUI

Java GUI Netbeans,在另一个包中的类的文本区域中显示输出

java - 从 JSF 1.2 迁移到 JSF 2.0 后,每次导航都会出现 ViewExpiredException

java - 在 Java、Maven 中导入路径