@Test public void testBasic() throws Exception { File basedir = resources.getBasedir("exportpackage/basic"); mkfile(basedir, "target/classes/exported/Exported.class"); mkfile(basedir, "target/classes/internal/Internal.class"); mojos.executeMojo(basedir, "export-package"); mojos.assertBuildOutputs(basedir, "target/classes/" + ExportPackageMojo.PATH_EXPORT_PACKAGE); assertExportedPackages(basedir, "exported"); mojos.executeMojo(basedir, "export-package"); mojos.assertCarriedOverOutputs(basedir, "target/classes/" + ExportPackageMojo.PATH_EXPORT_PACKAGE); assertExportedPackages(basedir, "exported"); touch(basedir, "target/classes/exported/Exported.class"); touch(basedir, "target/classes/internal/Internal.class"); mojos.executeMojo(basedir, "export-package"); mojos.assertCarriedOverOutputs(basedir, "target/classes/" + ExportPackageMojo.PATH_EXPORT_PACKAGE); assertExportedPackages(basedir, "exported"); rm(basedir, "target/classes/internal/Internal.class"); mojos.executeMojo(basedir, "export-package"); mojos.assertCarriedOverOutputs(basedir, "target/classes/" + ExportPackageMojo.PATH_EXPORT_PACKAGE); assertExportedPackages(basedir, "exported"); mkfile(basedir, "target/classes/exported/another/Exported.class"); mojos.executeMojo(basedir, "export-package"); mojos.assertBuildOutputs(basedir, "target/classes/" + ExportPackageMojo.PATH_EXPORT_PACKAGE); assertExportedPackages(basedir, "exported", "exported.another"); rm(basedir, "target/classes/exported/another/Exported.class"); mojos.executeMojo(basedir, "export-package"); mojos.assertBuildOutputs(basedir, "target/classes/" + ExportPackageMojo.PATH_EXPORT_PACKAGE); assertExportedPackages(basedir, "exported"); rm(basedir, "target/classes/exported/Exported.class"); mojos.executeMojo(basedir, "export-package"); mojos.assertBuildOutputs(basedir, "target/classes/" + ExportPackageMojo.PATH_EXPORT_PACKAGE); assertExportedPackages(basedir, new String[0]); }
@Override protected void executeMojo() throws MojoExecutionException { try { classesDirectory = classesDirectory.getCanonicalFile(); generateOutput(); } catch (IOException e) { throw new MojoExecutionException("Could not generate export-package file", e); } }
ExportPackageMojo extends TakariLifecycleMojo { @Override protected void executeMojo() throws MojoExecutionException { try { classesDirectory = classesDirectory.getCanonicalFile(); generateOutput(); } catch (IOException e) { throw new MojoExecutionException("Could not generate export-package file", e); } } }
ExportPackageMojo extends TakariLifecycleMojo { @Override protected void executeMojo() throws MojoExecutionException { try { classesDirectory = classesDirectory.getCanonicalFile(); generateOutput(); } catch (IOException e) { throw new MojoExecutionException("Could not generate export-package file", e); } }  }
ExportPackageMojo extends TakariLifecycleMojo { @Override protected void executeMojo() throws MojoExecutionException { try { classesDirectory = classesDirectory.getCanonicalFile(); generateOutput(); } catch (IOException e) { throw new MojoExecutionException("Could not generate export-package file", e); } }   }
ExportPackageMojo extends TakariLifecycleMojo { @Override protected void executeMojo() throws MojoExecutionException { try { classesDirectory = classesDirectory.getCanonicalFile(); generateOutput(); } catch (IOException e) { throw new MojoExecutionException("Could not generate export-package file", e); } }   static final String PATH_EXPORT_PACKAGE; static final char EOL; }