0 0

关于MAVEN的配置和使用5

今天使用maven构建项目,maven和eclipse插件都有!   环境变量也配置了,但是在新建maven项目的时候,出现了图片上的情况!
想问下具体需要怎么样配置才可以正常使用!

问题补充:
suziwen 写道
你直接通过maven命令行能创建项目吗,
看你的.m2文件里的setting.xml和maven安装目录下的setting.xml是怎么配置仓库的,仓库地址能访问到吗

mvn archetype:create -DgroupId=yang   -DartifactId=helloworld命令用的是这个命令,但是提示
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-clean-plugin:2.4.1: Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 o
r one of its dependencies could not be resolved: Failed to read artifact descrip
tor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
site-plugin/3.0/maven-site-plugin-3.0.pom
这样的警告,然后错误就是
[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 (C:\Users\acer\.m2\repository), central (http://repo.maven.a
pache.org/maven2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundF
orPrefixException
C:\Users\acer>
这个错误了!

问题补充:
suziwen 写道
你的MAVEN是什么版本的,我的2.2.1运行你的命令正常

mvn archetype:create -DgroupId=yang   -DartifactId=helloworld -e


mvn archetype:create -DgroupId=yang   -DartifactId=helloworld -X

加上-e或者-X参数看看详细些的错误信息

我的是3.0.4版本的,错误好像是仓库不能更新,难道是我的配置文件那里写错了吗?  
org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found
for prefix 'archetype' in the current project and in the plugin groups [org.apac
he.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\
Users\acer\.m2\repository), central (http://repo.maven.apache.org/maven2)]
        at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.r
esolve(DefaultPluginPrefixResolver.java:94)
        at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.findPluginF
orPrefix(MojoDescriptorCreator.java:262)
        at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDesc
riptor(MojoDescriptorCreator.java:222)
        at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalcul
ator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:106)
        at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalcul
ator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:86)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:98)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
这个是新的错误!

问题补充:
suziwen 写道
你那里直接访问这个网址能访问到吗

http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.0/maven-site-plugin-3.0.pom


要是不行就先把.m2文件删除(或者改个其他名),再执行你那命令那MVN再重新构建下。

你的命令在我机器上的MVN 3.0.4版本也能正常执行

问题解决了!   是网络问题!  那个网站一直到刚才才能访问!   现在已经成功建立了!   真是邪了门了!   难道谁还故意封了apache的IP?
2012年3月18日 02:38
  • 大小: 58.2 KB
  • 大小: 23.6 KB

3个答案 按时间排序 按投票排序

0 0

采纳的答案

你那里直接访问这个网址能访问到吗

http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.0/maven-site-plugin-3.0.pom


要是不行就先把.m2文件删除(或者改个其他名),再执行你那命令那MVN再重新构建下。

你的命令在我机器上的MVN 3.0.4版本也能正常执行

2012年3月18日 17:19
0 0

你的MAVEN是什么版本的,我的2.2.1运行你的命令正常

mvn archetype:create -DgroupId=yang   -DartifactId=helloworld -e


mvn archetype:create -DgroupId=yang   -DartifactId=helloworld -X

加上-e或者-X参数看看详细些的错误信息

2012年3月18日 14:04
0 0

你直接通过maven命令行能创建项目吗,
看你的.m2文件里的setting.xml和maven安装目录下的setting.xml是怎么配置仓库的,仓库地址能访问到吗

2012年3月18日 06:42

相关推荐

Global site tag (gtag.js) - Google Analytics