Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 未创建MVN项目_Java_Maven_Netbeans_Windows 7 X64 - Fatal编程技术网

Java 未创建MVN项目

Java 未创建MVN项目,java,maven,netbeans,windows-7-x64,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

我正在尝试使用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%

请注意,项目根本没有被创建,因此我不能打开项目

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


非常感谢您的帮助。

事实是,您的maven插件尝试连接到https远程存储库,但失败,安全认证无效。请在pom.xml中添加以下内容

<pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <name>Maven Plugin Repository</name>
      <url>http://repo1.maven.org/maven2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <updatePolicy>never</updatePolicy>
      </releases>
    </pluginRepository>
  </pluginRepositories>

中心的
Maven插件库
http://repo1.maven.org/maven2
违约
假的
从未

看起来您可能是公司代理的幕后黑手

您需要按照上的说明进行操作


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

原因:我在公司防火墙后面,这导致不允许Netbeans下载所需插件


我的简单解决方案是连接到另一个网络并运行该项目,它自动开始下载所需的插件。我根本不需要更改任何文件或配置。

看起来您缺少插件。消息很清楚。您可以通过设置-X和-e标志重新运行来获得更多信息。@duffymo yup I k现在,我从IDE安装了所有相关的maven插件,但仍然不起作用。我建议暂时放弃IDE,专注于maven。在命令行上运行。我还建议注释掉现在不需要的插件。让这些插件工作起来,然后添加它们。消息
sun.security.provider.certpath.SunCertPathBuildeRXCEPACTION:找不到请求的目标<代码>的有效认证路径,说你的本地安装证书有问题。看这个不,你不应该这么做。最好用证书来解决这个问题…否则你会选择中间人攻击的选项…