mvn创建新项目失败

执行命令mvn -B archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId=com.mycompany.app -DartifactId=my-app
不报错,但是没有生成对应的文件夹和项目,接下来显示很多信息,
constituent[0]: file:/data/software/apache-maven-3.3.3/lib/maven-settings-builder-3.3.3.jar
上面这种constituent有几十行

Exception in thread "main" java.lang.InternalError

at sun.security.ec.SunEC.initialize(Native Method)

at sun.security.ec.SunEC.access$000(SunEC.java:49)
上面这种at也有几十行。
已邀请:

wangxiaolei

赞同来自: zhudejun_1985

/etc/apache-maven-3.3.3/conf/settings.xml
没有配置小象的镜像,国外的文件无法下载,所以出现错误了。
先配置下,然后再用
mvn -B archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeCatalog=http://DX2:8081/nexus/content/groups/public

wangxiaolei

赞同来自: zhudejun_1985

[code=Java]
chinahadoop.central
central
ChinaHadoop central Mirror.
http://DX2:8081/nexus/content/repositories/central/

[/code]如图:

[attach]3992[/attach]
 
现在用的jdk是那个版本的,换成jdk1.8的试试。

zhudejun_1985 - 天下大事,必作于细

换成了jdk1.8,可依然还是不行,呜呜
[DEBUG] Could not find metadata org.apache.maven.plugins/maven-metadata.xml in local (/root/.m2/repository)
[DEBUG] Skipped remote request for org.apache.maven.plugins/maven-metadata.xml, already updated during this session.
[WARNING] 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): java.security.ProviderException: java.security.KeyException
org.eclipse.aether.transfer.MetadataTransferException: 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): java.security.ProviderException: java.security.KeyException

[DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in local (/root/.m2/repository)
[DEBUG] Skipped remote request for org.codehaus.mojo/maven-metadata.xml, already updated during this session.
[WARNING] 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): java.security.ProviderException: java.security.KeyException
org.eclipse.aether.transfer.MetadataTransferException: 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): java.security.ProviderException: java.security.KeyException

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:34 min
[INFO] Finished at: 2016-08-02T11:08:42+08:00
[INFO] Final Memory: 8M/29M
[INFO] ------------------------------------------------------------------------
[ERROR] 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 (/root/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: 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 (/root/.m2/repository), central (https://repo.maven.apache.org/maven2)]
还是报这些错误,无法生成文件夹。


 
私信发我下ip和密码

zhudejun_1985 - 天下大事,必作于细

这个镜像在文件里具体怎么配置呢?settings.xml........最后这一行也是命令行的一部分?-DarchetypeCatalog=http://DX2:8081/nexus/content/groups/public

要回复问题请先登录注册