1 package org.apache.maven.artifact.ant;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23 import java.util.Iterator;
24 import java.util.List;
25 import java.util.ArrayList;
26
27 import org.apache.maven.artifact.repository.ArtifactRepository;
28
29
30
31
32
33
34
35 public abstract class InstallDeployTaskSupport
36 extends AbstractArtifactTask
37 {
38 protected File file;
39
40 protected List attachedArtifacts;
41
42 public File getFile()
43 {
44 return file;
45 }
46
47 public void setFile( File file )
48 {
49 this.file = file;
50 }
51
52 public Pom buildPom( ArtifactRepository localArtifactRepository )
53 {
54 Pom pom = super.buildPom( localArtifactRepository );
55
56
57 if ( attachedArtifacts != null )
58 {
59 Iterator iter = attachedArtifacts.iterator();
60
61 while ( iter.hasNext() )
62 {
63 AttachedArtifact attached = (AttachedArtifact) iter.next();
64 pom.attach( attached );
65 }
66 }
67
68 return pom;
69 }
70
71 public AttachedArtifact createAttach()
72 {
73 if ( attachedArtifacts == null )
74 {
75 attachedArtifacts = new ArrayList();
76 }
77
78 AttachedArtifact attach = new AttachedArtifact();
79 attachedArtifacts.add( attach );
80
81 return attach;
82 }
83 }