1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.plugins.assembly.archive.phase;
20
21 import javax.inject.Named;
22 import javax.inject.Singleton;
23
24 import java.util.List;
25
26 import org.apache.maven.plugins.assembly.AssemblerConfigurationSource;
27 import org.apache.maven.plugins.assembly.archive.ArchiveCreationException;
28 import org.apache.maven.plugins.assembly.archive.task.AddFileSetsTask;
29 import org.apache.maven.plugins.assembly.format.AssemblyFormattingException;
30 import org.apache.maven.plugins.assembly.model.Assembly;
31 import org.apache.maven.plugins.assembly.model.FileSet;
32 import org.codehaus.plexus.archiver.Archiver;
33
34
35
36
37
38
39 @Singleton
40 @Named("file-sets")
41 public class FileSetAssemblyPhase implements AssemblyArchiverPhase, PhaseOrder {
42
43
44
45
46 @Override
47 public void execute(
48 final Assembly assembly, final Archiver archiver, final AssemblerConfigurationSource configSource)
49 throws ArchiveCreationException, AssemblyFormattingException {
50 final List<FileSet> fileSets = assembly.getFileSets();
51
52 if ((fileSets != null) && !fileSets.isEmpty()) {
53 final AddFileSetsTask task = new AddFileSetsTask(fileSets);
54 task.execute(archiver, configSource);
55 }
56 }
57
58 @Override
59 public int order() {
60
61 return 20;
62
63 }
64 }