1 package org.apache.maven.artifact.repository.metadata;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.artifact.repository.ArtifactRepository;
23
24 import java.util.Iterator;
25 import java.util.List;
26
27
28
29
30
31
32
33 public class GroupRepositoryMetadata
34 extends AbstractRepositoryMetadata
35 {
36 private final String groupId;
37
38 public GroupRepositoryMetadata( String groupId )
39 {
40 super( new Metadata() );
41 this.groupId = groupId;
42 }
43
44 public boolean storedInGroupDirectory()
45 {
46 return true;
47 }
48
49 public boolean storedInArtifactVersionDirectory()
50 {
51 return false;
52 }
53
54 public String getGroupId()
55 {
56 return groupId;
57 }
58
59 public String getArtifactId()
60 {
61 return null;
62 }
63
64 public String getBaseVersion()
65 {
66 return null;
67 }
68
69 public void addPluginMapping( String goalPrefix,
70 String artifactId )
71 {
72 addPluginMapping( goalPrefix, artifactId, artifactId );
73 }
74
75 public void addPluginMapping( String goalPrefix,
76 String artifactId,
77 String name )
78 {
79 List plugins = getMetadata().getPlugins();
80 boolean found = false;
81 for ( Iterator i = plugins.iterator(); i.hasNext() && !found; )
82 {
83 Plugin plugin = (Plugin) i.next();
84 if ( plugin.getPrefix().equals( goalPrefix ) )
85 {
86 found = true;
87 }
88 }
89 if ( !found )
90 {
91 Plugin plugin = new Plugin();
92 plugin.setPrefix( goalPrefix );
93 plugin.setArtifactId( artifactId );
94 plugin.setName( name );
95
96
97 getMetadata().addPlugin( plugin );
98 }
99 }
100
101 public Object getKey()
102 {
103 return groupId;
104 }
105
106 public boolean isSnapshot()
107 {
108 return false;
109 }
110
111 public ArtifactRepository getRepository()
112 {
113 return null;
114 }
115
116 public void setRepository( ArtifactRepository remoteRepository )
117 {
118
119 }
120 }