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