首页 > 解决方案 > mvnw 令人困惑的错误消息 NoPluginFoundForPrefixException

问题描述

为什么:

./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指向错误文档

但这也无济于事。

标签: maven

解决方案


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

感谢这个错误报告,它开始变得有意义

如果这恰好指向一个本地 Windows 文件(前面没有 -config),maven 将尝试将其解析为插件:

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


推荐阅读