GrammarExtensionMojo extends AbstractMojo { @Override public void execute() throws MojoExecutionException { base = new File(base).getAbsolutePath(); gbase = resolvePath(gbase); gextension = resolvePath(gextension); output = resolvePath(output); getLog().info("Base dir: " + base); getLog().info("Grammar-base: " + gbase); getLog().info("Grammar-extension: " + gextension); getLog().info("Output: " + output); processBase(); processExtension(); generateOutput(); }  @Override void execute();  }
@Test public void testMojoGoal() throws Exception { File testPom = new File(getBasedir(), "src" + File.separator + "test" + File.separator + "resources" + File.separator + "unit" + File.separator + "basic-test" + File.separator + "basic-test-plugin-config.xml"); GrammarExtensionMojo mojo = (GrammarExtensionMojo) lookupMojo("grammarix", testPom); assertNotNull(mojo); mojo.execute(); }