1 package org.apache.maven.plugin.eclipse;
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.net.URL;
24
25 import org.apache.maven.artifact.repository.ArtifactRepository;
26 import org.apache.maven.plugin.ide.IdeDependency;
27
28 public class WorkspaceConfiguration
29 {
30 private File workspaceDirectory;
31
32 private URL codeStylesURL;
33
34 private String activeCodeStyleProfileName;
35
36 private ArtifactRepository localRepository;
37
38 private String defaultClasspathContainer;
39
40 private IdeDependency[] workspaceArtefacts;
41
42 private String defaultDeployServerId;
43
44 private String defaultDeployServerName;
45
46 public File getWorkspaceDirectory()
47 {
48 return this.workspaceDirectory;
49 }
50
51 public void setWorkspaceDirectory( File dir )
52 {
53 this.workspaceDirectory = dir;
54 }
55
56 public URL getCodeStylesURL()
57 {
58 return this.codeStylesURL;
59 }
60
61 public void setCodeStylesURL( URL url )
62 {
63 this.codeStylesURL = url;
64 }
65
66 public String getActiveStyleProfileName()
67 {
68 return this.activeCodeStyleProfileName;
69 }
70
71 public void setActiveStyleProfileName( String name )
72 {
73 this.activeCodeStyleProfileName = name;
74 }
75
76 public ArtifactRepository getLocalRepository()
77 {
78 return localRepository;
79 }
80
81 public void setLocalRepository( ArtifactRepository localRepository )
82 {
83 this.localRepository = localRepository;
84 }
85
86 public String getDefaultClasspathContainer()
87 {
88 return defaultClasspathContainer;
89 }
90
91 public void setDefaultClasspathContainer( String defaultClasspathContainer )
92 {
93 this.defaultClasspathContainer = defaultClasspathContainer;
94 }
95
96 public IdeDependency[] getWorkspaceArtefacts()
97 {
98 return workspaceArtefacts;
99 }
100
101 public void setWorkspaceArtefacts( IdeDependency[] workspaceArtefacts )
102 {
103 this.workspaceArtefacts = workspaceArtefacts;
104 }
105
106 public String getDefaultDeployServerId()
107 {
108 return defaultDeployServerId;
109 }
110
111 public void setDefaultDeployServerId( String defaultDeployServerId )
112 {
113 this.defaultDeployServerId = defaultDeployServerId;
114 }
115
116 public String getDefaultDeployServerName()
117 {
118 return defaultDeployServerName;
119 }
120
121 public void setDefaultDeployServerName( String defaultDeployServerName )
122 {
123 this.defaultDeployServerName = defaultDeployServerName;
124 }
125
126
127
128
129 public String getWebsphereVersion()
130 {
131 if ( getDefaultDeployServerId() != null && getDefaultDeployServerId().startsWith( "was." ) )
132 {
133 if (getDefaultDeployServerId().contains("v7"))
134 {
135 return "7.0";
136 }
137 if (getDefaultDeployServerId().contains("v61"))
138 {
139 return "6.1";
140 }
141 if (getDefaultDeployServerId().contains("v6"))
142 {
143 return "6.0";
144 }
145 if (getDefaultDeployServerId().contains("v51"))
146 {
147 return "5.1";
148 }
149 if (getDefaultDeployServerId().contains("v5"))
150 {
151 return "5.0";
152 }
153 }
154 return null;
155 }
156
157 }