Annotation Type Basedir


@Retention(RUNTIME) @Inherited @Target(METHOD) public @interface Basedir
Specifies the base directory for test resources in Maven plugin tests. This annotation can be applied to test methods to define where test resources are located.

Example usage:


@MojoTest
class MyMojoTest {
    @Test
    @Basedir("src/test/resources/specific-test-case")
    @InjectMojo(goal = "compile")
    void testSpecificCase(MyMojo mojo) {
        // Test resources will be loaded from src/test/resources/specific-test-case
        mojo.execute();
    }
}

Since:
3.4.0
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Element Details

    • value

      String value
      Default:
      ""