运行“ MVN测试”失败:无法加载Mojo“测试”(或其必需组件之一)

时间:2019-06-01 15:11:16

标签: maven soapui pom.xml

我尝试运行“ mvn -B -f ./pom.xml测试”之类的命令,但收到如下错误消息:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.676 s
[INFO] Finished at: 2019-06-01T20:27:24+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.smartbear.soapui:soapui-pro-maven-plugin:5.1.2:test (default) on project apitest-hfa: Execution default of goal com.smartbear.soapui:soapui-pro-maven-plugin:5.1.2:test failed: Unable to load the mojo 'test' (or one of its required components) from the plugin 'com.smartbear.soapui:soapui-pro-maven-plugin:5.1.2': java.util.NoSuchElementException
[ERROR] role: org.apache.maven.plugin.Mojo
[ERROR] roleHint: com.smartbear.soapui:soapui-pro-maven-plugin:5.1.2:test
[ERROR] -> [Help 1]
[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.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

但是该命令可以在我的另一台机器上很好地运行,并且在我使用SoapUIPro软件尝试该命令时也可以通过,但是没有通过命令,我无法弄清楚pom.xml的问题,我在pom依赖项中有什么想念的?

真的需要一些帮助,非常感谢。

屏幕截图如下: enter image description here

1 个答案:

答案 0 :(得分:0)

尝试添加以下列表,这些列表从您的依赖项列表中丢失-

<dependencies>
    <dependency>
        <groupId>org.reflections</groupId>
        <artifactId>reflections</artifactId>
        <version>0.9.9-RC1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.10-FINAL</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-all</artifactId>
        <version>2.5.6</version>
        <type>pom</type>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.8.1</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-utils</artifactId>
        <version>3.0.5</version>
    </dependency>
    <dependency>
        <groupId>com.jgoodies</groupId>
        <artifactId>forms</artifactId>
        <version>1.2.1</version>
    </dependency>
</dependencies>

org.codehaus.plexus可以解决问题。

如果可以的话,您可以共享pom文件,这样更容易识别!!