mvnw令人困惑的错误消息NoPluginFoundForPrefixException

时间:2020-02-06 17:51:01

标签: maven

为什么这样做

./mvnw -X versions:set -DnewVersion=${VERSION_TO_DEPLOY}

给出此错误:

org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found for prefix 'C' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\tools\mvnrepo), nexus (https://nexus.corporate.net/repository/maven-public/)]

Maven指向error documentation

但这也无济于事。

1 个答案:

答案 0 :(得分:0)

借助一些跟踪(在mvnw中设置-x),看来mvnw在我们的构建服务器上使用了环境变量$ MAVEN_CONFIG,该变量也恰好被其他软件用于不同的目的。

感谢this bug report变得很有意义

如果碰巧指向本地Windows文件(在其前面没有-config),maven将尝试将其解析为插件:

C:\ tools \ apache-maven-2.2.1 \ conf \ settings.xml