Qearlhuang的gravatar头像
Qearlhuang 2018-09-06 17:28:12

maven 在cmd命令使用mvn help:system报错

问题描述

maven已经下载好了

C:\Users\HQ>mvn -v
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-25T03:49:05+08:00)
Maven home: C:\Program Files\Java\maven\apache-maven-3.5.3\bin\..
Java version: 1.8.0_171, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_171\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

可是运用到eclipse就报错说文件不存在等问题,后来我就试着在cmd命令下运行 mvn help:system

想导入一些文件进来发现报错一堆,有说文件不存在有说无法访问的

cmd执行命令错误代码:

C:\Users\HQ>mvn help:system
[INFO] Scanning for projects...
Downloading from aliyunMaven: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[WARNING] Failed to create parent directories for tracking file C:\Program Files\Java\maven\repository\org\apache\maven\plugins\maven-clean-plugin\2.5\maven-clean-plugin-2.5.pom.lastUpdated
[WARNING] 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 from aliyunMaven: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom
[WARNING] Failed to create parent directories for tracking file C:\Program Files\Java\maven\repository\org\apache\maven\plugins\maven-install-plugin\2.4\maven-install-plugin-2.4.pom.lastUpdated
[WARNING] 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 from aliyunMaven: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom
[WARNING] Failed to create parent directories for tracking file C:\Program Files\Java\maven\repository\org\apache\maven\plugins\maven-deploy-plugin\2.7\maven-deploy-plugin-2.7.pom.lastUpdated
[WARNING] 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 from aliyunMaven: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-site-plugin/3.3/maven-site-plugin-3.3.pom
[WARNING] Failed to create parent directories for tracking file C:\Program Files\Java\maven\repository\org\apache\maven\plugins\maven-site-plugin\3.3\maven-site-plugin-3.3.pom.lastUpdated
[WARNING] 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 from aliyunMaven: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom
[WARNING] Failed to create parent directories for tracking file C:\Program Files\Java\maven\repository\org\apache\maven\plugins\maven-antrun-plugin\1.3\maven-antrun-plugin-1.3.pom.lastUpdated
[WARNING] 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 from aliyunMaven: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-5/maven-assembly-plugin-2.2-beta-5.pom
[WARNING] Failed to create parent directories for tracking file C:\Program Files\Java\maven\repository\org\apache\maven\plugins\maven-assembly-plugin\2.2-beta-5\maven-assembly-plugin-2.2-beta-5.pom.lastUpdated
[WARNING] 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 from aliyunMaven: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-dependency-plugin/2.8/maven-dependency-plugin-2.8.pom
[WARNING] Failed to create parent directories for tracking file C:\Program Files\Java\maven\repository\org\apache\maven\plugins\maven-dependency-plugin\2.8\maven-dependency-plugin-2.8.pom.lastUpdated
[WARNING] 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 from aliyunMaven: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-release-plugin/2.5.3/maven-release-plugin-2.5.3.pom
[WARNING] Failed to create parent directories for tracking file C:\Program Files\Java\maven\repository\org\apache\maven\plugins\maven-release-plugin\2.5.3\maven-release-plugin-2.5.3.pom.lastUpdated
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-release-plugin:2.5.3: Plugin org.apache.maven.plugins:maven-release-plugin:2.5.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-release-plugin:jar:2.5.3
Downloading from aliyunMaven: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/mojo/maven-metadata.xml
Downloading from aliyunMaven: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-metadata.xml
[WARNING] Failed to create parent directories for tracking file C:\Program Files\Java\maven\repository\org\codehaus\mojo\resolver-status.properties
[WARNING] Failed to write tracking file C:\Program Files\Java\maven\repository\org\apache\maven\plugins\resolver-status.properties
java.io.FileNotFoundException: C:\Program Files\Java\maven\repository\org\apache\maven\plugins\resolver-status.properties (拒绝访问。)
    at java.io.RandomAccessFile.open0 (Native Method)
    at java.io.RandomAccessFile.open (RandomAccessFile.java:316)
    at java.io.RandomAccessFile.<init> (RandomAccessFile.java:243)
    at org.eclipse.aether.internal.impl.TrackingFileManager.update (TrackingFileManager.java:105)
    at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.write (DefaultUpdateCheckManager.java:615)
    at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.touchMetadata (DefaultUpdateCheckManager.java:582)
    at org.eclipse.aether.internal.impl.DefaultMetadataResolver$ResolveTask.run (DefaultMetadataResolver.java:627)
    at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run (RunnableErrorForwarder.java:75)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
    at java.lang.Thread.run (Thread.java:748)
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to aliyunMaven (http://maven.aliyun.com/nexus/content/groups/public/): C:\Program Files\Java\maven\repository\org\apache\maven\plugins\maven-metadata-aliyunMaven.xml.part.lock (拒绝访问。)
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to aliyunMaven (http://maven.aliyun.com/nexus/content/groups/public/): C:\Program Files\Java\maven\repository\org\codehaus\mojo\maven-metadata-aliyunMaven.xml.part.lock (系统找不到指定的路径。)
Downloading from aliyunMaven: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-metadata.xml
Downloading from aliyunMaven: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/mojo/maven-metadata.xml
[WARNING] Failed to write tracking file C:\Program Files\Java\maven\repository\org\apache\maven\plugins\resolver-status.properties
[java.io.FileNotFoundException: ExceptiCo:n\ Pirno gtrharme aFdi l"eDse\fJaauvlat\Mmeatvaedna\traeRpeossoiltvoerry-\1o-r:g"\ apache\maven\plugins\resoljvaevra-.sltaantgu.sN.upmrboepreFrotrimeast E(x拒c绝e访p问t。i)on
A F o r  inaptut  jsatvrai.nigo:. R"a3n1dmo"m
n       caet javas.slang.FNuimberFormatException.forInputString(NumberFormatExlec.eopption.java:65)e
e       a t( java.lanNga.Itnitveeg eMre.pthaordseInt(In)t
  e r.java:580)
o       at jaavta. ljang.avIan.teger.<init>(Integer.java:867)i
i       Raatn dorg.fusesource.jansi.AnsiPrintStream.filter(AnsiPomAcrcientStrsesam.java:129)F
a       ea.t org.fusesource.janospie.nFilter P(rinRtaSntdroemaAmc.cwersistFei(lFei.ljtaevraP:r3i1n6tS)tre
m . j a va:97a)t
i       at org.fusesource.jansi.FilterPrintStrejaamv.awrite(FilterPrintStream.java:107).
o       .at org.fusesource.jansi.FilterPrintStream.print(FilterPRraintStream.java:156)n
n       at org.fusesouormcAec.cjeasnsi.FilterPsrFintStream.println(FilterPrintStream.javilae:.2<31)i
c       ta>t org.slf4j.impl.SimpleLogge r(.write(SimpRlaenLodgger.java:o3m18)A
c       easts Foirg.sllef.4j.impl.SimpleLogger.log(SimpleLogger.java:295)j
a       vaat: 2org.slf4j.impl.SimpleLogger.warn(SimpleLo4g3ge)r.java:522)

        at org.eclipse . a etheart.internal.impl.slf4j.Slf4jLoggerFactory$Slf4jLogge ro.warn(Slf4jLoggerrFactory.java:14c6.)e
l       iat org.epcslei.paseet.haeert.hienrt.eirnntaelr.niamlp.li.mpTlr.aTcrakcikningFilgeFMainlaegMearn.aupdate(TrackindgeFri.lueManager.java:97)p
c       att eorg.ec l(ipse.aether.internal.impl.DefaultUpdTarteCheckManager.write(DefaultUpdateCheckManager.java:615)a
k       at org.eclipse.aether.inteinrgnFail.ilmepMl.DefaultUpdateCheckManager.touchMetadata(DefaultaUnpdateCheckManager.ajgaevra.:j58a2v)a:
$       0a5t org.eclipse.aether.internal.impl.DefaultMetadataResolv)er
o e s o lveTask.runa(DefatultMetadataResolver.java:627)
e       ga.te corg.eclipse.aether.util.concurrelnicpy.RunnableErrorForwarder$1.run(RunnableErrorForwarder.sjea.va:75)a
l       haet java.util.concurrent.Thrr.eiadPoolExecutor.runWorker(ThreadPoolExecutor.java:1n1t4er9n)a
.       iamtp lj.aDveaf.auutill.ctoUnpdacurtreenCth.eTchkrMeaandaPgoeorl.Executor$Worker.run(ThreadPoolExecutor.java:624w)r
j       taet java.l a(ng.DTehfraeualdt.Urpudna(tTehCrheeacdk.Mjaanvaag:e7r4.8)
ava:615)
    at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.touchMetadata (DefaultUpdateCheckManager.java:582)
    at org.eclipse.aether.internal.impl.DefaultMetadataResolver$ResolveTask.run (DefaultMetadataResolver.java:627)
    at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run (RunnableErrorForwarder.java:75)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
    at java.lang.Thread.run (Thread.java:748)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.235 s
[INFO] Finished at: 2018-09-06T17:25:35+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] For input string: "31m"
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

settings.xml文件的配置(我只改了两处):

<localRepository>C:\Program Files\Java\maven\repository</localRepository>

<mirror>
      <id>aliyun</id>
      <mirrorOf>aliyun</mirrorOf>
      <name>aliyun Maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
     </mirror>

找了很久不知道怎么办,希望能有大神帮我解决一下,拜托,谢谢大家。

所有回答列表(1)
Qearlhuang的gravatar头像
Qearlhuang  LV4 2018年9月7日

解决了,大致的问题应该是因为我系统是win10的然后对C盘有保护,导致无法导入文件,才报错,我的解决办法是在D盘下重新安装maven不受权限限制,配置也一样,就OK了~~~如果是还想在C盘下存那就去更改权限,因为有点复杂自行百度步骤啊哈哈哈哈哈哈哈哈,就这样谢谢大家了

评论(0) 最佳答案
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友