@Test public void testCreateArchiver_ShouldCreateWarArchiverWithIgnoreWebxmlSetToFalse() throws NoSuchArchiverException, ArchiverException { final EasyMockSupport mm = new EasyMockSupport(); final TestWarArchiver twArchiver = new TestWarArchiver(); final MockAndControlForAssemblyArchiver macArchiverManager = new MockAndControlForAssemblyArchiver( mm ); macArchiverManager.expectGetArchiver( "war", twArchiver ); final AssemblerConfigurationSource configSource = mm.createMock( AssemblerConfigurationSource.class ); expect( configSource.isDryRun() ).andReturn( false ).anyTimes(); expect( configSource.getArchiverConfig() ).andReturn( null ).anyTimes(); expect( configSource.getMavenSession() ).andReturn( null ).anyTimes(); final DefaultAssemblyArchiver subject = setupStdExpectations( mm, macArchiverManager, configSource ); subject.createArchiver( "war", false, null, configSource, null, false, null ); assertFalse( twArchiver.ignoreWebxml ); }
protected Archiver createArchiver( final String format, final boolean includeBaseDir, final String finalName, final AssemblerConfigurationSource configSource, final List<ContainerDescriptorHandler> containerHandlers, boolean recompressZippedFiles, String mergeManifestMode ) throws NoSuchArchiverException { Archiver archiver; if ( "txz".equals( format ) || "tgz".equals( format ) || "tbz2".equals( format ) || format.startsWith( "tar" ) ) { archiver = createTarArchiver( format, TarLongFileMode.valueOf( configSource.getTarLongFileMode() ) ); } else if ( "war".equals( format ) ) { archiver = createWarArchiver(); } else { archiver = archiverManager.getArchiver( format ); } if ( archiver instanceof AbstractZipArchiver ) { ( (AbstractZipArchiver) archiver ).setRecompressAddedZips( recompressZippedFiles ); } final List<FileSelector> extraSelectors = new ArrayList<FileSelector>(); final List<ArchiveFinalizer> extraFinalizers = new ArrayList<ArchiveFinalizer>(); if ( archiver instanceof JarArchiver ) { if ( mergeManifestMode != null ) { ( (JarArchiver) archiver ).setFilesetmanifest( JarArchiver.FilesetManifestConfig.valueOf( mergeManifestMode ) ); } extraSelectors.add( new JarSecurityFileSelector() ); extraFinalizers.add( new ManifestCreationFinalizer( configSource.getMavenSession(), configSource.getProject(), configSource.getJarArchiveConfiguration() ) ); } if ( configSource.getArchiverConfig() != null ) { configureArchiver( archiver, configSource ); } String prefix = ""; if ( includeBaseDir ) { prefix = finalName; } archiver = new AssemblyProxyArchiver( prefix, archiver, containerHandlers, extraSelectors, extraFinalizers, configSource.getWorkingDirectory(), getLogger() ); if ( configSource.isDryRun() ) { archiver = new DryRunArchiver( archiver, getLogger() ); } archiver.setUseJvmChmod( configSource.isUpdateOnly() ); archiver.setIgnorePermissions( configSource.isIgnorePermissions() ); archiver.setForced( !configSource.isUpdateOnly() ); return archiver; }
DefaultAssemblyArchiver extends AbstractLogEnabled implements AssemblyArchiver, Contextualizable { protected Archiver createArchiver( final String format, final boolean includeBaseDir, final String finalName, final AssemblerConfigurationSource configSource, final List<ContainerDescriptorHandler> containerHandlers, boolean recompressZippedFiles, String mergeManifestMode ) throws NoSuchArchiverException { Archiver archiver; if ( "txz".equals( format ) || "tgz".equals( format ) || "tbz2".equals( format ) || format.startsWith( "tar" ) ) { archiver = createTarArchiver( format, TarLongFileMode.valueOf( configSource.getTarLongFileMode() ) ); } else if ( "war".equals( format ) ) { archiver = createWarArchiver(); } else { archiver = archiverManager.getArchiver( format ); } if ( archiver instanceof AbstractZipArchiver ) { ( (AbstractZipArchiver) archiver ).setRecompressAddedZips( recompressZippedFiles ); } final List<FileSelector> extraSelectors = new ArrayList<FileSelector>(); final List<ArchiveFinalizer> extraFinalizers = new ArrayList<ArchiveFinalizer>(); if ( archiver instanceof JarArchiver ) { if ( mergeManifestMode != null ) { ( (JarArchiver) archiver ).setFilesetmanifest( JarArchiver.FilesetManifestConfig.valueOf( mergeManifestMode ) ); } extraSelectors.add( new JarSecurityFileSelector() ); extraFinalizers.add( new ManifestCreationFinalizer( configSource.getMavenSession(), configSource.getProject(), configSource.getJarArchiveConfiguration() ) ); } if ( configSource.getArchiverConfig() != null ) { configureArchiver( archiver, configSource ); } String prefix = ""; if ( includeBaseDir ) { prefix = finalName; } archiver = new AssemblyProxyArchiver( prefix, archiver, containerHandlers, extraSelectors, extraFinalizers, configSource.getWorkingDirectory(), getLogger() ); if ( configSource.isDryRun() ) { archiver = new DryRunArchiver( archiver, getLogger() ); } archiver.setUseJvmChmod( configSource.isUpdateOnly() ); archiver.setIgnorePermissions( configSource.isIgnorePermissions() ); archiver.setForced( !configSource.isUpdateOnly() ); return archiver; } }
DefaultAssemblyArchiver extends AbstractLogEnabled implements AssemblyArchiver, Contextualizable { protected Archiver createArchiver( final String format, final boolean includeBaseDir, final String finalName, final AssemblerConfigurationSource configSource, final List<ContainerDescriptorHandler> containerHandlers, boolean recompressZippedFiles, String mergeManifestMode ) throws NoSuchArchiverException { Archiver archiver; if ( "txz".equals( format ) || "tgz".equals( format ) || "tbz2".equals( format ) || format.startsWith( "tar" ) ) { archiver = createTarArchiver( format, TarLongFileMode.valueOf( configSource.getTarLongFileMode() ) ); } else if ( "war".equals( format ) ) { archiver = createWarArchiver(); } else { archiver = archiverManager.getArchiver( format ); } if ( archiver instanceof AbstractZipArchiver ) { ( (AbstractZipArchiver) archiver ).setRecompressAddedZips( recompressZippedFiles ); } final List<FileSelector> extraSelectors = new ArrayList<FileSelector>(); final List<ArchiveFinalizer> extraFinalizers = new ArrayList<ArchiveFinalizer>(); if ( archiver instanceof JarArchiver ) { if ( mergeManifestMode != null ) { ( (JarArchiver) archiver ).setFilesetmanifest( JarArchiver.FilesetManifestConfig.valueOf( mergeManifestMode ) ); } extraSelectors.add( new JarSecurityFileSelector() ); extraFinalizers.add( new ManifestCreationFinalizer( configSource.getMavenSession(), configSource.getProject(), configSource.getJarArchiveConfiguration() ) ); } if ( configSource.getArchiverConfig() != null ) { configureArchiver( archiver, configSource ); } String prefix = ""; if ( includeBaseDir ) { prefix = finalName; } archiver = new AssemblyProxyArchiver( prefix, archiver, containerHandlers, extraSelectors, extraFinalizers, configSource.getWorkingDirectory(), getLogger() ); if ( configSource.isDryRun() ) { archiver = new DryRunArchiver( archiver, getLogger() ); } archiver.setUseJvmChmod( configSource.isUpdateOnly() ); archiver.setIgnorePermissions( configSource.isIgnorePermissions() ); archiver.setForced( !configSource.isUpdateOnly() ); return archiver; } @SuppressWarnings( "UnusedDeclaration" )  DefaultAssemblyArchiver(); protected  DefaultAssemblyArchiver( final ArchiverManager archiverManager,
                                       final List<AssemblyArchiverPhase> assemblyPhases ); }
DefaultAssemblyArchiver extends AbstractLogEnabled implements AssemblyArchiver, Contextualizable { protected Archiver createArchiver( final String format, final boolean includeBaseDir, final String finalName, final AssemblerConfigurationSource configSource, final List<ContainerDescriptorHandler> containerHandlers, boolean recompressZippedFiles, String mergeManifestMode ) throws NoSuchArchiverException { Archiver archiver; if ( "txz".equals( format ) || "tgz".equals( format ) || "tbz2".equals( format ) || format.startsWith( "tar" ) ) { archiver = createTarArchiver( format, TarLongFileMode.valueOf( configSource.getTarLongFileMode() ) ); } else if ( "war".equals( format ) ) { archiver = createWarArchiver(); } else { archiver = archiverManager.getArchiver( format ); } if ( archiver instanceof AbstractZipArchiver ) { ( (AbstractZipArchiver) archiver ).setRecompressAddedZips( recompressZippedFiles ); } final List<FileSelector> extraSelectors = new ArrayList<FileSelector>(); final List<ArchiveFinalizer> extraFinalizers = new ArrayList<ArchiveFinalizer>(); if ( archiver instanceof JarArchiver ) { if ( mergeManifestMode != null ) { ( (JarArchiver) archiver ).setFilesetmanifest( JarArchiver.FilesetManifestConfig.valueOf( mergeManifestMode ) ); } extraSelectors.add( new JarSecurityFileSelector() ); extraFinalizers.add( new ManifestCreationFinalizer( configSource.getMavenSession(), configSource.getProject(), configSource.getJarArchiveConfiguration() ) ); } if ( configSource.getArchiverConfig() != null ) { configureArchiver( archiver, configSource ); } String prefix = ""; if ( includeBaseDir ) { prefix = finalName; } archiver = new AssemblyProxyArchiver( prefix, archiver, containerHandlers, extraSelectors, extraFinalizers, configSource.getWorkingDirectory(), getLogger() ); if ( configSource.isDryRun() ) { archiver = new DryRunArchiver( archiver, getLogger() ); } archiver.setUseJvmChmod( configSource.isUpdateOnly() ); archiver.setIgnorePermissions( configSource.isIgnorePermissions() ); archiver.setForced( !configSource.isUpdateOnly() ); return archiver; } @SuppressWarnings( "UnusedDeclaration" )  DefaultAssemblyArchiver(); protected  DefaultAssemblyArchiver( final ArchiverManager archiverManager,
                                       final List<AssemblyArchiverPhase> assemblyPhases ); @Override File createArchive( final Assembly assembly, final String fullName, final String format,
                               final AssemblerConfigurationSource configSource, boolean recompressZippedFiles,
                               String mergeManifestMode ); @Override void contextualize( final Context context ); }
DefaultAssemblyArchiver extends AbstractLogEnabled implements AssemblyArchiver, Contextualizable { protected Archiver createArchiver( final String format, final boolean includeBaseDir, final String finalName, final AssemblerConfigurationSource configSource, final List<ContainerDescriptorHandler> containerHandlers, boolean recompressZippedFiles, String mergeManifestMode ) throws NoSuchArchiverException { Archiver archiver; if ( "txz".equals( format ) || "tgz".equals( format ) || "tbz2".equals( format ) || format.startsWith( "tar" ) ) { archiver = createTarArchiver( format, TarLongFileMode.valueOf( configSource.getTarLongFileMode() ) ); } else if ( "war".equals( format ) ) { archiver = createWarArchiver(); } else { archiver = archiverManager.getArchiver( format ); } if ( archiver instanceof AbstractZipArchiver ) { ( (AbstractZipArchiver) archiver ).setRecompressAddedZips( recompressZippedFiles ); } final List<FileSelector> extraSelectors = new ArrayList<FileSelector>(); final List<ArchiveFinalizer> extraFinalizers = new ArrayList<ArchiveFinalizer>(); if ( archiver instanceof JarArchiver ) { if ( mergeManifestMode != null ) { ( (JarArchiver) archiver ).setFilesetmanifest( JarArchiver.FilesetManifestConfig.valueOf( mergeManifestMode ) ); } extraSelectors.add( new JarSecurityFileSelector() ); extraFinalizers.add( new ManifestCreationFinalizer( configSource.getMavenSession(), configSource.getProject(), configSource.getJarArchiveConfiguration() ) ); } if ( configSource.getArchiverConfig() != null ) { configureArchiver( archiver, configSource ); } String prefix = ""; if ( includeBaseDir ) { prefix = finalName; } archiver = new AssemblyProxyArchiver( prefix, archiver, containerHandlers, extraSelectors, extraFinalizers, configSource.getWorkingDirectory(), getLogger() ); if ( configSource.isDryRun() ) { archiver = new DryRunArchiver( archiver, getLogger() ); } archiver.setUseJvmChmod( configSource.isUpdateOnly() ); archiver.setIgnorePermissions( configSource.isIgnorePermissions() ); archiver.setForced( !configSource.isUpdateOnly() ); return archiver; } @SuppressWarnings( "UnusedDeclaration" )  DefaultAssemblyArchiver(); protected  DefaultAssemblyArchiver( final ArchiverManager archiverManager,
                                       final List<AssemblyArchiverPhase> assemblyPhases ); @Override File createArchive( final Assembly assembly, final String fullName, final String format,
                               final AssemblerConfigurationSource configSource, boolean recompressZippedFiles,
                               String mergeManifestMode ); @Override void contextualize( final Context context );  }