Coverage Report - org.apache.maven.plugin.assembly.archive.phase.FileSetAssemblyPhase
 
Classes in this File Line Coverage Branch Coverage Complexity
FileSetAssemblyPhase
100%
7/7
75%
3/4
0
 
 1  
 package org.apache.maven.plugin.assembly.archive.phase;
 2  
 
 3  
 /*
 4  
  * Licensed to the Apache Software Foundation (ASF) under one
 5  
  * or more contributor license agreements.  See the NOTICE file
 6  
  * distributed with this work for additional information
 7  
  * regarding copyright ownership.  The ASF licenses this file
 8  
  * to you under the Apache License, Version 2.0 (the
 9  
  * "License"); you may not use this file except in compliance
 10  
  * with the License.  You may obtain a copy of the License at
 11  
  *
 12  
  *   http://www.apache.org/licenses/LICENSE-2.0
 13  
  *
 14  
  * Unless required by applicable law or agreed to in writing,
 15  
  * software distributed under the License is distributed on an
 16  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 17  
  * KIND, either express or implied.  See the License for the
 18  
  * specific language governing permissions and limitations
 19  
  * under the License.
 20  
  */
 21  
 
 22  
 import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
 23  
 import org.apache.maven.plugin.assembly.AssemblyContext;
 24  
 import org.apache.maven.plugin.assembly.archive.ArchiveCreationException;
 25  
 import org.apache.maven.plugin.assembly.archive.task.AddFileSetsTask;
 26  
 import org.apache.maven.plugin.assembly.format.AssemblyFormattingException;
 27  
 import org.apache.maven.plugin.assembly.model.Assembly;
 28  
 import org.apache.maven.plugin.assembly.model.FileSet;
 29  
 import org.codehaus.plexus.archiver.Archiver;
 30  
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 31  
 
 32  
 import java.util.List;
 33  
 
 34  
 /**
 35  
  * Handles the <fileSets/> top-level section of the assembly descriptor.
 36  
  * 
 37  
  * @version $Id: FileSetAssemblyPhase.java 1002307 2010-09-28 18:13:44Z jdcasey $
 38  
  * @plexus.component role="org.apache.maven.plugin.assembly.archive.phase.AssemblyArchiverPhase" role-hint="file-sets"
 39  
  */
 40  2
 public class FileSetAssemblyPhase
 41  
     extends AbstractLogEnabled
 42  
     implements AssemblyArchiverPhase
 43  
 {
 44  
 
 45  
     /**
 46  
      * {@inheritDoc}
 47  
      */
 48  
     public void execute( final Assembly assembly, final Archiver archiver,
 49  
                          final AssemblerConfigurationSource configSource, final AssemblyContext context )
 50  
         throws ArchiveCreationException, AssemblyFormattingException
 51  
     {
 52  2
         final List<FileSet> fileSets = assembly.getFileSets();
 53  
 
 54  2
         if ( ( fileSets != null ) && !fileSets.isEmpty() )
 55  
         {
 56  1
             final AddFileSetsTask task = new AddFileSetsTask( fileSets );
 57  
 
 58  1
             task.setLogger( getLogger() );
 59  1
             task.execute( archiver, configSource );
 60  
         }
 61  2
     }
 62  
 
 63  
 }