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 | 6 | 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 | 8 | return this.workspaceDirectory; |
49 | |
} |
50 | |
|
51 | |
public void setWorkspaceDirectory( File dir ) |
52 | |
{ |
53 | 4 | this.workspaceDirectory = dir; |
54 | 4 | } |
55 | |
|
56 | |
public URL getCodeStylesURL() |
57 | |
{ |
58 | 0 | return this.codeStylesURL; |
59 | |
} |
60 | |
|
61 | |
public void setCodeStylesURL( URL url ) |
62 | |
{ |
63 | 0 | this.codeStylesURL = url; |
64 | 0 | } |
65 | |
|
66 | |
public String getActiveStyleProfileName() |
67 | |
{ |
68 | 0 | return this.activeCodeStyleProfileName; |
69 | |
} |
70 | |
|
71 | |
public void setActiveStyleProfileName( String name ) |
72 | |
{ |
73 | 0 | this.activeCodeStyleProfileName = name; |
74 | 0 | } |
75 | |
|
76 | |
public ArtifactRepository getLocalRepository() |
77 | |
{ |
78 | 0 | return localRepository; |
79 | |
} |
80 | |
|
81 | |
public void setLocalRepository( ArtifactRepository localRepository ) |
82 | |
{ |
83 | 0 | this.localRepository = localRepository; |
84 | 0 | } |
85 | |
|
86 | |
public String getDefaultClasspathContainer() |
87 | |
{ |
88 | 0 | return defaultClasspathContainer; |
89 | |
} |
90 | |
|
91 | |
public void setDefaultClasspathContainer( String defaultClasspathContainer ) |
92 | |
{ |
93 | 0 | this.defaultClasspathContainer = defaultClasspathContainer; |
94 | 0 | } |
95 | |
|
96 | |
public IdeDependency[] getWorkspaceArtefacts() |
97 | |
{ |
98 | 0 | return workspaceArtefacts; |
99 | |
} |
100 | |
|
101 | |
public void setWorkspaceArtefacts( IdeDependency[] workspaceArtefacts ) |
102 | |
{ |
103 | 0 | this.workspaceArtefacts = workspaceArtefacts; |
104 | 0 | } |
105 | |
|
106 | |
public String getDefaultDeployServerId() |
107 | |
{ |
108 | 48 | return defaultDeployServerId; |
109 | |
} |
110 | |
|
111 | |
public void setDefaultDeployServerId( String defaultDeployServerId ) |
112 | |
{ |
113 | 10 | this.defaultDeployServerId = defaultDeployServerId; |
114 | 10 | } |
115 | |
|
116 | |
public String getDefaultDeployServerName() |
117 | |
{ |
118 | 0 | return defaultDeployServerName; |
119 | |
} |
120 | |
|
121 | |
public void setDefaultDeployServerName( String defaultDeployServerName ) |
122 | |
{ |
123 | 0 | this.defaultDeployServerName = defaultDeployServerName; |
124 | 0 | } |
125 | |
|
126 | |
|
127 | |
|
128 | |
|
129 | |
public String getWebsphereVersion() |
130 | |
{ |
131 | 10 | if ( getDefaultDeployServerId() != null && getDefaultDeployServerId().startsWith( "was." ) ) |
132 | |
{ |
133 | 10 | if ( getDefaultDeployServerId().indexOf( "v7" ) >= 0 ) |
134 | |
{ |
135 | 2 | return "7.0"; |
136 | |
} |
137 | 8 | if ( getDefaultDeployServerId().indexOf( "v61" ) >= 0 ) |
138 | |
{ |
139 | 2 | return "6.1"; |
140 | |
} |
141 | 6 | if ( getDefaultDeployServerId().indexOf( "v6" ) >= 0 ) |
142 | |
{ |
143 | 2 | return "6.0"; |
144 | |
} |
145 | 4 | if ( getDefaultDeployServerId().indexOf( "v51" ) >= 0 ) |
146 | |
{ |
147 | 4 | return "5.1"; |
148 | |
} |
149 | 0 | if ( getDefaultDeployServerId().indexOf( "v5" ) >= 0 ) |
150 | |
{ |
151 | 0 | return "5.0"; |
152 | |
} |
153 | |
} |
154 | 0 | return null; |
155 | |
} |
156 | |
|
157 | |
} |