小编rdi*_*nko的帖子

maven插件的测试与maven 3.0.4不兼容

我有一个简单的maven插件测试:

public class SimpleMavenTest extends AbstractMojoTestCase {

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        // code
    }

    public void testCase() throws Exception {
        // test case
    }

    @Override
    protected void tearDown() throws Exception {
        // code
        super.tearDown();
    }
}
Run Code Online (Sandbox Code Playgroud)

使用这样的maven-surefire-plugin配置:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-surefire-plugin</artifactId>
      <configuration>
        <forkMode>never</forkMode>
      </configuration>
    </plugin>
  </plugins>
</build>
Run Code Online (Sandbox Code Playgroud)

在maven 3.0.4发布之前,我的SimpleMavenTest成功运行.但是当我使用maven 3.0.4运行测试时,发生了下一个错误:

java.lang.IllegalStateException: The internal default plexus-bootstrap.xml is missing. This is highly irregular, your plexus JAR is most likely corrupt.
    at org.codehaus.plexus.DefaultPlexusContainer.initializeConfiguration(DefaultPlexusContainer.java:1052)
    at org.codehaus.plexus.DefaultPlexusContainer.initialize(DefaultPlexusContainer.java:627)
    at …
Run Code Online (Sandbox Code Playgroud)

java unit-testing maven-plugin maven

5
推荐指数
1
解决办法
1038
查看次数

标签 统计

java ×1

maven ×1

maven-plugin ×1

unit-testing ×1