Search in sources :

Example 26 with ConsoleLogger

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

the class ModuleSetAssemblyPhaseTest method testIsDeprecatedModuleSourcesConfigPresent_ShouldNotCatchFileMode.

public void testIsDeprecatedModuleSourcesConfigPresent_ShouldNotCatchFileMode() {
    final ModuleSources sources = new ModuleSources();
    sources.setFileMode("777");
    final ModuleSetAssemblyPhase phase = createPhase(new ConsoleLogger(Logger.LEVEL_DEBUG, "test"), null);
    assertFalse(phase.isDeprecatedModuleSourcesConfigPresent(sources));
}
Also used : ConsoleLogger(org.codehaus.plexus.logging.console.ConsoleLogger) ModuleSources(org.apache.maven.plugins.assembly.model.ModuleSources)

Example 27 with ConsoleLogger

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

the class ModuleSetAssemblyPhaseTest method testIsDeprecatedModuleSourcesConfigPresent_ShouldCatchExclude.

public void testIsDeprecatedModuleSourcesConfigPresent_ShouldCatchExclude() {
    final ModuleSources sources = new ModuleSources();
    sources.addExclude("**/excluded.txt");
    final ModuleSetAssemblyPhase phase = createPhase(new ConsoleLogger(Logger.LEVEL_DEBUG, "test"), null);
    assertTrue(phase.isDeprecatedModuleSourcesConfigPresent(sources));
}
Also used : ConsoleLogger(org.codehaus.plexus.logging.console.ConsoleLogger) ModuleSources(org.apache.maven.plugins.assembly.model.ModuleSources)

Example 28 with ConsoleLogger

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

the class DefaultShaderTest method newShader.

private static DefaultShader newShader() {
    DefaultShader s = new DefaultShader();
    s.enableLogging(new ConsoleLogger(Logger.LEVEL_INFO, "TEST"));
    return s;
}
Also used : ConsoleLogger(org.codehaus.plexus.logging.console.ConsoleLogger)

Example 29 with ConsoleLogger

use of org.codehaus.plexus.logging.console.ConsoleLogger in project xwiki-platform by xwiki.

the class PackageMojo method unzip.

private void unzip(File source, File targetDirectory) throws MojoExecutionException {
    createDirectory(targetDirectory);
    try {
        ZipUnArchiver unArchiver = new ZipUnArchiver();
        unArchiver.enableLogging(new ConsoleLogger(Logger.LEVEL_ERROR, "Package"));
        unArchiver.setSourceFile(source);
        unArchiver.setDestDirectory(targetDirectory);
        unArchiver.setOverwrite(true);
        unArchiver.extract();
    } catch (Exception e) {
        throw new MojoExecutionException(String.format("Error unpacking file [%s] into [%s]", source, targetDirectory), e);
    }
}
Also used : MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) ConsoleLogger(org.codehaus.plexus.logging.console.ConsoleLogger) ZipUnArchiver(org.codehaus.plexus.archiver.zip.ZipUnArchiver) IOException(java.io.IOException) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) MojoFailureException(org.apache.maven.plugin.MojoFailureException)

Example 30 with ConsoleLogger

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

the class ModuleSetAssemblyPhaseTest method testAddModuleBinaries_ShouldFilterPomModule.

public void testAddModuleBinaries_ShouldFilterPomModule() throws ArchiveCreationException, AssemblyFormattingException, IOException, InvalidAssemblerConfigurationException, DependencyResolutionException {
    final EasyMockSupport mm = new EasyMockSupport();
    final MockAndControlForAddArtifactTask macTask = new MockAndControlForAddArtifactTask(mm);
    final ModuleBinaries binaries = new ModuleBinaries();
    binaries.setUnpack(false);
    binaries.setFileMode("777");
    binaries.setOutputDirectory("out");
    binaries.setOutputFileNameMapping("artifact");
    final MavenProject project = createProject("group", "artifact", "version", null);
    project.setPackaging("pom");
    final ArtifactMock artifactMock = new ArtifactMock(mm, "group", "artifact", "version", "pom", false);
    project.setArtifact(artifactMock.getArtifact());
    final Set<MavenProject> projects = singleton(project);
    mm.replayAll();
    createPhase(new ConsoleLogger(Logger.LEVEL_DEBUG, "test"), null).addModuleBinaries(null, null, binaries, projects, macTask.archiver, macTask.configSource);
    mm.verifyAll();
}
Also used : MockAndControlForAddArtifactTask(org.apache.maven.plugins.assembly.archive.task.testutils.MockAndControlForAddArtifactTask) EasyMockSupport(org.easymock.classextension.EasyMockSupport) ModuleBinaries(org.apache.maven.plugins.assembly.model.ModuleBinaries) MavenProject(org.apache.maven.project.MavenProject) ConsoleLogger(org.codehaus.plexus.logging.console.ConsoleLogger) ArtifactMock(org.apache.maven.plugins.assembly.archive.task.testutils.ArtifactMock)

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