1 package org.apache.maven.continuum.xmlrpc.server;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.HashMap;
23 import java.util.Map;
24
25 public class AddingResultUtil
26 {
27 private static final Map<String, String> errorMap;
28
29 static
30 {
31 errorMap = new HashMap<String, String>();
32 errorMap.put( "add.project.unknown.host.error", "The specified host is either unknown or inaccessible." );
33 errorMap.put( "add.project.connect.error", "Unable to connect to remote server." );
34 errorMap.put( "add.project.malformed.url.error", "The URL provided is malformed." );
35 errorMap.put( "add.project.field.required.error", "Either POM URL or Upload POM is required." );
36 errorMap.put( "add.project.xml.parse.error", "The XML content of the POM can not be parsed." );
37 errorMap.put( "add.project.extend.error", "Cannot use a POM with an ''extend'' element." );
38 errorMap.put( "add.project.missing.pom.error",
39 "POM file does not exist. Either the POM you specified or one of its modules does not exist." );
40 errorMap.put( "add.project.missing.groupid.error", "Missing 'groupId' element in the POM." );
41 errorMap.put( "add.project.missing.artifactid.error", "Missing 'artifactId' element in the POM." );
42 errorMap.put( "add.project.missing.version.error", "Missing 'version' element in the POM." );
43 errorMap.put( "add.project.missing.name.error", "Missing 'name' element in the POM." );
44 errorMap.put( "add.project.missing.repository.error", "Missing 'repository' element in the POM." );
45 errorMap.put( "add.project.missing.scm.error", "Missing 'scm' element in the POM project." );
46 errorMap.put( "add.project.missing.scm.connection.error",
47 "Missing 'connection' sub-element in the 'scm' element in the POM." );
48 errorMap.put( "add.project.missing.notifier.type.error",
49 "Missing 'type' sub-element in the 'notifier' element in the POM." );
50 errorMap.put( "add.project.missing.notifier.configuration.error",
51 "Missing 'configuration' sub-element in the 'notifier' element in the POM." );
52 errorMap.put( "add.project.metadata.transfer.error", "Transfer of Metadata has failed." );
53 errorMap.put( "add.project.validation.protocol.not_allowed",
54 "The specified resource isn't a file or the protocol used isn't allowed." );
55 errorMap.put( "add.project.unauthorized.error",
56 "You are not authorized to access the requested URL. Please verify that the correct username and password are provided." );
57 errorMap.put( "add.project.artifact.not.found.error",
58 "Missing artifact trying to build the POM. Check that its parent POM is available or add it first in Continuum." );
59 errorMap.put( "add.project.project.building.error", "Unknown error trying to build POM." );
60 errorMap.put( "add.project.unknown.error",
61 "The specified resource cannot be accessed. Please try again later or contact your administrator." );
62 errorMap.put( "add.project.nogroup.error", "No project group specified." );
63 errorMap.put( "add.project.duplicate.error", "Trying to add duplicate projects in the same project group." );
64 }
65
66 public static String getErrorMessage( String error )
67 {
68 String message = errorMap.get( error );
69
70 return message == null ? error : message;
71 }
72 }