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 public class GroupRepositoryMetadata
33 extends AbstractRepositoryMetadata
34 {
35 private final String groupId;
36
37 public GroupRepositoryMetadata( String groupId )
38 {
39 super( new Metadata() );
40 this.groupId = groupId;
41 }
42
43 public boolean storedInGroupDirectory()
44 {
45 return true;
46 }
47
48 public boolean storedInArtifactVersionDirectory()
49 {
50 return false;
51 }
52
53 public String getGroupId()
54 {
55 return groupId;
56 }
57
58 public String getArtifactId()
59 {
60 return null;
61 }
62
63 public String getBaseVersion()
64 {
65 return null;
66 }
67
68 public void addPluginMapping( String goalPrefix,
69 String artifactId )
70 {
71 addPluginMapping( goalPrefix, artifactId, artifactId );
72 }
73
74 public void addPluginMapping( String goalPrefix,
75 String artifactId,
76 String name )
77 {
78 List plugins = getMetadata().getPlugins();
79 boolean found = false;
80 for ( Iterator i = plugins.iterator(); i.hasNext() && !found; )
81 {
82 Plugin plugin = (Plugin) i.next();
83 if ( plugin.getPrefix().equals( goalPrefix ) )
84 {
85 found = true;
86 }
87 }
88 if ( !found )
89 {
90 Plugin plugin = new Plugin();
91 plugin.setPrefix( goalPrefix );
92 plugin.setArtifactId( artifactId );
93 plugin.setName( name );
94
95
96 getMetadata().addPlugin( plugin );
97 }
98 }
99
100 public Object getKey()
101 {
102 return groupId;
103 }
104
105 public boolean isSnapshot()
106 {
107 return false;
108 }
109
110 public ArtifactRepository getRepository()
111 {
112 return null;
113 }
114
115 public void setRepository( ArtifactRepository remoteRepository )
116 {
117
118 }
119 }