安装maven后运行:mvn help:system报错,No plugin found for prefix 'help' ...

运行命令:mvn help:system

错误信息:

[ERROR] No plugin found for prefix ‘help’ in the current project and in the plug
in groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repos
itories [local (C:\xxx\maven\repo), central (https://repo.maven.apache.org/
maven2)] -> [Help 1]

出错背景:当我在家里安装maven并运行mvn 后build success,当在公司运行后build failure. 并且从运行失败的错误输出中可以看到下载失败,所以可能和代理有关系。

报错信息如下:

C:\Users\xxxx>mvn help:system
[INFO] 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
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or on
e 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
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-install-plugin:2.4: Plugin org.apache.maven.plugins:maven-install-plugin:2.4 o
r one of its dependencies could not be resolved: Failed to read artifact descrip
tor 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
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-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 descripto
r 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
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-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 fo
r 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
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-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 descripto
r 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
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plu
gin: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-b
eta-5
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-dependency-plugin/2.8/maven-dependency-plugin-2.8.pom
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-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 d
escriptor 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
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
n-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 des
criptor for org.apache.maven.plugins:maven-release-plugin:jar:2.3.2
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metada
ta.xml
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven
-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xm
l from/to central (https://repo.maven.apache.org/maven2): sun.security.validator
.ValidatorException: PKIX path building failed: sun.security.provider.certpath.S
unCertPathBuilderException: unable to find valid certification path to requested
 target
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/
to central (https://repo.maven.apache.org/maven2): sun.security.validator.Valida
torException: PKIX path building failed: sun.security.provider.certpath.SunCertP
athBuilderException: unable to find valid certification path to requested target

[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from h
ttps://repo.maven.apache.org/maven2 was cached in the local repository, resoluti
on will not be reattempted until the update interval of central has elapsed or u
pdates 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.sec
urity.provider.certpath.SunCertPathBuilderException: unable to find valid certif
ication path to requested target
[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): sun.securit
y.validator.ValidatorException: PKIX path building failed: sun.security.provider
.certpath.SunCertPathBuilderException: unable to find valid certification path t
o requested target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.211 s
[INFO] Finished at: 2017-07-17T11:27:16+08:00
[INFO] Final Memory: 12M/191M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'help' in the current project and in the plug
in groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repos
itories [local (C:\Software\maven\repo), central (https://repo.maven.apache.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

分析:由于公司网络上网需要有代理设置,所以修改了maven安装目录中conf的settings.xml文件中

<proxies>
    <!-- 这是我的代理设置-->
    <proxy>
      <id>optional</id>
      <active>true</active>active的值为true表示激活该代理
      <protocol>http</protocol>protocol表示使用的代理协议,这里是http
      <host>proxy.host.net</host>
      <port>80</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>

<!-- prox
     | Specification for one proxy, to be used in connecting to the network
     |
    <!--代理-->

    <proxy>
      <id>代理标识</id>(名字随便起)
      <active>true</active>
      <protocol>http</protocol>
      <username>代理:用户名</username> (不是必须)
      <password>代理:密码</password> (不是必须)
      <host>代理:服务器地址</host>
      <port>代理:端口</port>
      <!--nonProxyHosts>local.net|some.host.com</nonProxyHosts-->
    </proxy>
 -->
  </proxies>

 其他参考: http://love2157dream.iteye.com/blog/2100337
          http://blog.csdn.net/u010974598/article/details/66742912

再次执行后,build success


......
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/xpp3/xpp3_min/1.
1.4c/xpp3_min-1.1.4c.jar (25 kB at 1.2 kB/s)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/ple
xus/plexus-utils/1.5.7/plexus-utils-1.5.7.jar (266 kB at 13 kB/s)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/thoughtworks
/xstream/xstream/1.4.3/xstream-1.4.3.jar (482 kB at 22 kB/s)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/commons-lang/com
mons-lang/2.4/commons-lang-2.4.jar (262 kB at 11 kB/s)
[INFO]
===============================================================================
========================= Platform Properties Details =========================
===============================================================================

===============================================================================
System Properties
===============================================================================

java.runtime.name=OpenJDK Runtime Environment
sun.boot.library.path=C:\Software\JDK\zulu-jdk8.0.72-win_x64\jre\bin
java.vm.version=25.72-b15
maven.multiModuleProjectDirectory=C:\Users\xxx
java.vm.vendor=Azul Systems, Inc.
java.vendor.url=http://www.azulsystems.com/
guice.disable.misplaced.annotation.check=true
path.separator=;
java.vm.name=OpenJDK 64-Bit Server VM
file.encoding.pkg=sun.io
user.country=US
user.script=
sun.java.launcher=SUN_STANDARD
sun.os.patch.level=Service Pack 1
java.vm.specification.name=Java Virtual Machine Specification
user.dir=C:\Users\xxx
java.runtime.version=1.8.0_72-b15
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs=C:\Software\JDK\zulu-jdk8.0.72-win_x64\jre\lib\endorsed
os.arch=amd64
java.io.tmpdir=C:\Users\bayu\AppData\Local\Temp\
line.separator=

java.vm.specification.vendor=Oracle Corporation
user.variant=
os.name=Windows 7
classworlds.conf=C:\Software\maven\apache-maven-3.5.0\bin\..\bin\m2.conf
sun.jnu.encoding=Cp1252
java.library.path=C:\Software\xxx;.
maven.conf=C:\Software\maven\apache-maven-3.5.0\bin\../conf
java.specification.name=Java Platform API Specification
java.class.version=52.0
sun.management.compiler=HotSpot 64-Bit Tiered Compilers
os.version=6.1
library.jansi.path=C:\Software\maven\apache-maven-3.5.0\bin\..\lib\jansi-native\
windows64
user.home=C:\Users\xxx
user.timezone=Asia/Shanghai
java.awt.printerjob=sun.awt.windows.WPrinterJob
file.encoding=Cp1252
java.specification.version=1.8
java.class.path=C:\Software\maven\axxx
user.name=xxx
java.vm.specification.version=1.8
sun.java.command=org.codehaus.plexus.classworlds.launcher.Launcher help:system
java.home=C:\Software\JDK\zulu-jdk8.0.72-win_x64\jre
sun.arch.data.model=64
user.language=en
java.specification.vendor=Oracle Corporation
awt.toolkit=sun.awt.windows.WToolkit
java.vm.info=mixed mode
java.version=1.8.0_72
java.ext.dirs=C:\Software\JDK\zulu-jdk8.0.72-win_x64\jre\lib\ext;C:\windows\Sun\
Java\lib\ext
sun.boot.class.path=C:\Software\JDK\zulu-jdk8.0.72-win_x64\jre\lib\resources.jar
;C:\Software\JDK\zulu-xxx
sun.stderr.encoding=cp437
maven.home=C:\Software\maven\apache-maven-3.5.0\bin\..
file.separator=\
java.vendor.url.bug=http://www.azulsystems.com/support/
sun.io.unicode.encoding=UnicodeLittle
sun.cpu.endian=little
sun.stdout.encoding=cp437
sun.desktop=windows
sun.cpu.isalist=amd64

===============================================================================
Environment Variables
===============================================================================

CLASSWORLDS_JAR="C:\Software\maven\apache-maven-3.5.0\bin\..\boot\plexus-classwo
rlds-2.5.2.jar"
PSMODULEPATH=C:\windows\system32\WindowsPowerShell\v1.0\Modules\
PROGRAMW6432=C:\Program Files
COMMONPROGRAMW6432=C:\Program Files\xxx
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
PROGRAMDATA=C:\ProgramData
FP_NO_HOST_CHECK=NO
PATH=C:\ProgramData\Oracle\Java\xxx
WDIR=C:\
SYSTEMROOT=C:\windows
JAVACMD=C:\Software\JDK\zulu-jdk8.0.72-win_x64\bin\java.exe
TMP=C:\Users\bayu\AppData\Local\Temp
PROGRAMFILES(X86)=C:\Program Files (x86)
EXEC_DIR=C:\Users\xxx
COMPUTERNAME=BAYU1
OS=Windows_NT
PROMPT=$P$G
WINDIR=C:\windows
SYSTEMDRIVE=C:
MAVEN_HOME=C:\Software\maven\apache-maven-3.5.0\bin\..
#ENVKKPRBC_CMDILNE=
COMSPEC=C:\windows\system32\cmd.exe
HOMEDRIVE=C:
LOGONSERVER=\\S81W0060
PROCESSOR_IDENTIFIER=AMD64 Family 21 Model 48 Stepping 1, AuthenticAMD
PROGRAMFILES=C:\Program Files
COMMONPROGRAMFILES=C:\Program Files\Common Files
COMMONPROGRAMFILES(X86)=C:\Program Files (x86)\Common Files
TEMP=C:\Users\bayu\AppData\Local\Temp
NUMBER_OF_PROCESSORS=4
USERDOMAIN=ASIAPACIFIC
M2_HOME=C:\Software\maven\apache-maven-3.5.0
PROCESSOR_LEVEL=21
VSEDEFLOGDIR=C:\ProgramData\McAfee\DesktopProtection
USERDNSDOMAIN=ASIAPACIFIC.CPQCORP.NET
ERROR_CODE=0
VBOX_MSI_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\
SESSIONNAME=Console
USERNAME=bayu
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
WINDOWS_TRACING_FLAGS=3
DEFLOGDIR=C:\ProgramData\McAfee\DesktopProtection
JVMCONFIG=\.mvn\jvm.config
USERDOMAIN_ROAMINGPROFILE=ASIAPACIFIC
PUBLIC=C:\xxx
ONEDRIVE=C:\xxx
PROCESSOR_REVISION=3001
USERPROFILE=C:\xxx
APPDATA=C:\Users\xxx
HOMEPATH=\Users\xxx
LOCALAPPDATA=C:\Users\xxxx
JAVA_HOME=C:\Software\JDK\zulu-jdk8.0.72-win_x64
CLASSPATH=.;C:\Software\JDK\zulu-jdk8.0.72-win_x64\lib
MAVEN_CMD_LINE_ARGS=help:system
ALLUSERSPROFILE=C:\ProgramData
MAVEN_PROJECTBASEDIR=C:\Users\xxx

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:26 min
[INFO] Finished at: 2017-07-17T12:48:10+08:00
[INFO] Final Memory: 9M/96M
[INFO] ------------------------------------------------------------------------
  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值