use of org.sonatype.plexus.build.incremental.DefaultBuildContext in project querydsl by querydsl.
the class CompileMojoTest method test.
@Test
public void test() throws Exception {
new File("target/compile-mojo").mkdir();
MavenProject mavenProject = new MavenProject();
mavenProject.getBuild().setOutputDirectory("target/compile-mojo");
CompileMojo mojo = new CompileMojo();
mojo.setBuildContext(new DefaultBuildContext());
mojo.setProject(mavenProject);
mojo.setSourceFolder(new File("src/test/java"));
mojo.execute();
}
use of org.sonatype.plexus.build.incremental.DefaultBuildContext in project sling by apache.
the class ValidateMojoTest method getMojo.
private ValidateMojo getMojo(File baseDir, String pomFile) throws Exception {
SilentLog log = new SilentLog();
DefaultBuildContext buildContext = new DefaultBuildContext();
File pom = new File(baseDir, pomFile);
ValidateMojo validateMojo = new ValidateMojo();
mojoRule.configureMojo(validateMojo, mojoRule.extractPluginConfiguration("htl-maven-plugin", pom));
MavenProject mavenProject = new ProjectStub(pom);
mojoRule.setVariableValueToObject(validateMojo, "project", mavenProject);
validateMojo.setLog(log);
buildContext.enableLogging(log);
validateMojo.setBuildContext(buildContext);
return validateMojo;
}
use of org.sonatype.plexus.build.incremental.DefaultBuildContext in project hibernate-orm by hibernate.
the class MavenEnhancePluginTest method testEnhancePlugin.
@Test
public void testEnhancePlugin() throws Exception {
File baseDir = new File("target/classes/test");
URL[] baseURLs = { baseDir.toURI().toURL() };
MavenEnhancePlugin plugin = new MavenEnhancePlugin();
Map<String, Object> pluginContext = new HashMap<>();
pluginContext.put("project", new MavenProject());
setVariableValueToObject(plugin, "pluginContext", pluginContext);
setVariableValueToObject(plugin, "buildContext", new DefaultBuildContext());
setVariableValueToObject(plugin, "base", baseDir.getAbsolutePath());
setVariableValueToObject(plugin, "dir", baseDir.getAbsolutePath());
setVariableValueToObject(plugin, "failOnError", true);
setVariableValueToObject(plugin, "enableLazyInitialization", true);
setVariableValueToObject(plugin, "enableDirtyTracking", true);
setVariableValueToObject(plugin, "enableAssociationManagement", true);
setVariableValueToObject(plugin, "enableExtendedEnhancement", false);
plugin.execute();
try (URLClassLoader classLoader = new URLClassLoader(baseURLs, getClass().getClassLoader())) {
Assert.assertTrue(declaresManaged(classLoader.loadClass(ParentEntity.class.getName())));
Assert.assertTrue(declaresManaged(classLoader.loadClass(ChildEntity.class.getName())));
Assert.assertTrue(declaresManaged(classLoader.loadClass(TestEntity.class.getName())));
}
}
Aggregations