Search in sources :

Example 56 with ConsoleLogger

use of org.codehaus.plexus.logging.console.ConsoleLogger in project maven-plugins by apache.

the class DefaultAssemblyArchiverTest method createSubject.

private DefaultAssemblyArchiver createSubject(final MockAndControlForAssemblyArchiver macMgr, final List<AssemblyArchiverPhase> phases, Logger logger) {
    final DefaultAssemblyArchiver subject = new DefaultAssemblyArchiver(macMgr.archiverManager, phases);
    subject.setContainer(container);
    if (logger == null) {
        logger = new ConsoleLogger(Logger.LEVEL_DEBUG, "test");
    }
    subject.enableLogging(logger);
    return subject;
}
Also used : ConsoleLogger(org.codehaus.plexus.logging.console.ConsoleLogger)

Example 57 with ConsoleLogger

use of org.codehaus.plexus.logging.console.ConsoleLogger in project maven-plugins by apache.

the class ProjectUtilsTest method testGetProjectModules_ShouldExcludeInDirectModuleOfMasterWhenIncludeSubModulesIsFalse.

public void testGetProjectModules_ShouldExcludeInDirectModuleOfMasterWhenIncludeSubModulesIsFalse() throws IOException {
    final MavenProject master = createTestProject("test", "testGroup", "1.0");
    master.setFile(new File("project/pom.xml"));
    master.getModel().addModule("module");
    final MavenProject module = createTestProject("module", "testGroup", "1.0");
    module.getModel().addModule("submodule");
    module.setFile(new File("project/module/pom.xml"));
    final MavenProject subModule = createTestProject("sub-module", "testGroup", "1.0");
    subModule.setFile(new File("project/module/submodule/pom.xml"));
    final List<MavenProject> projects = new ArrayList<MavenProject>(3);
    projects.add(master);
    projects.add(module);
    projects.add(subModule);
    final Set<MavenProject> result = ProjectUtils.getProjectModules(master, projects, false, new ConsoleLogger(Logger.LEVEL_INFO, "test"));
    assertNotNull(result);
    assertEquals(1, result.size());
    final List<MavenProject> verify = new ArrayList<MavenProject>(projects);
    verify.remove(master);
    verify.remove(subModule);
    verifyProjectsPresent(verify, result);
}
Also used : MavenProject(org.apache.maven.project.MavenProject) ConsoleLogger(org.codehaus.plexus.logging.console.ConsoleLogger) ArrayList(java.util.ArrayList) File(java.io.File)

Example 58 with ConsoleLogger

use of org.codehaus.plexus.logging.console.ConsoleLogger in project maven-plugins by apache.

the class ProjectUtilsTest method testGetProjectModules_ShouldNotIncludeMasterProject.

public void testGetProjectModules_ShouldNotIncludeMasterProject() throws IOException {
    final MavenProject master = createTestProject("test", "testGroup", "1.0");
    final Set<MavenProject> result = ProjectUtils.getProjectModules(master, Collections.singletonList(master), true, new ConsoleLogger(Logger.LEVEL_INFO, "test"));
    assertNotNull(result);
    assertTrue(result.isEmpty());
}
Also used : MavenProject(org.apache.maven.project.MavenProject) ConsoleLogger(org.codehaus.plexus.logging.console.ConsoleLogger)

Example 59 with ConsoleLogger

use of org.codehaus.plexus.logging.console.ConsoleLogger in project maven-plugins by apache.

the class ProjectUtilsTest method testGetProjectModules_ShouldExcludeNonModuleOfMasterProject.

public void testGetProjectModules_ShouldExcludeNonModuleOfMasterProject() throws IOException {
    final MavenProject master = createTestProject("test", "testGroup", "1.0");
    master.setFile(new File("project/pom.xml"));
    final MavenProject other = createTestProject("other", "testGroup", "1.0");
    other.setFile(new File("other/pom.xml"));
    final List<MavenProject> projects = new ArrayList<MavenProject>(3);
    projects.add(master);
    projects.add(other);
    final Set<MavenProject> result = ProjectUtils.getProjectModules(master, projects, true, new ConsoleLogger(Logger.LEVEL_INFO, "test"));
    assertNotNull(result);
    assertTrue(result.isEmpty());
}
Also used : MavenProject(org.apache.maven.project.MavenProject) ConsoleLogger(org.codehaus.plexus.logging.console.ConsoleLogger) ArrayList(java.util.ArrayList) File(java.io.File)

Aggregations

ConsoleLogger (org.codehaus.plexus.logging.console.ConsoleLogger)59 MavenProject (org.apache.maven.project.MavenProject)36 File (java.io.File)32 EasyMockSupport (org.easymock.classextension.EasyMockSupport)21 Model (org.apache.maven.model.Model)20 ArtifactMock (org.apache.maven.plugins.assembly.archive.task.testutils.ArtifactMock)20 Logger (org.codehaus.plexus.logging.Logger)16 MockAndControlForAddArtifactTask (org.apache.maven.plugins.assembly.archive.task.testutils.MockAndControlForAddArtifactTask)12 Assembly (org.apache.maven.plugins.assembly.model.Assembly)12 DependencySet (org.apache.maven.plugins.assembly.model.DependencySet)10 MockAndControlForAddDependencySetsTask (org.apache.maven.plugins.assembly.archive.task.testutils.MockAndControlForAddDependencySetsTask)9 ModuleSources (org.apache.maven.plugins.assembly.model.ModuleSources)9 ArrayList (java.util.ArrayList)8 FileSet (org.apache.maven.plugins.assembly.model.FileSet)8 ModuleBinaries (org.apache.maven.plugins.assembly.model.ModuleBinaries)7 FileItem (org.apache.maven.plugins.assembly.model.FileItem)5 MockAndControlForAddFileSetsTask (org.apache.maven.plugins.assembly.archive.task.testutils.MockAndControlForAddFileSetsTask)4 HashSet (java.util.HashSet)3 Artifact (org.apache.maven.artifact.Artifact)3 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)2