1 package org.apache.maven.plugin.eclipse;
2
3 import java.io.File;
4 import java.net.URL;
5
6 import org.apache.maven.artifact.repository.ArtifactRepository;
7 import org.apache.maven.plugin.ide.IdeDependency;
8
9 public class WorkspaceConfiguration
10 {
11 private File workspaceDirectory;
12
13 private URL codeStylesURL;
14
15 private String activeCodeStyleProfileName;
16
17 private ArtifactRepository localRepository;
18
19 private String defaultClasspathContainer;
20
21 private IdeDependency[] workspaceArtefacts;
22
23 private String defaultDeployServerId;
24
25 private String defaultDeployServerName;
26
27 public File getWorkspaceDirectory()
28 {
29 return this.workspaceDirectory;
30 }
31
32 public void setWorkspaceDirectory( File dir )
33 {
34 this.workspaceDirectory = dir;
35 }
36
37 public URL getCodeStylesURL()
38 {
39 return this.codeStylesURL;
40 }
41
42 public void setCodeStylesURL( URL url )
43 {
44 this.codeStylesURL = url;
45 }
46
47 public String getActiveStyleProfileName()
48 {
49 return this.activeCodeStyleProfileName;
50 }
51
52 public void setActiveStyleProfileName( String name )
53 {
54 this.activeCodeStyleProfileName = name;
55 }
56
57 public ArtifactRepository getLocalRepository()
58 {
59 return localRepository;
60 }
61
62 public void setLocalRepository( ArtifactRepository localRepository )
63 {
64 this.localRepository = localRepository;
65 }
66
67 public String getDefaultClasspathContainer()
68 {
69 return defaultClasspathContainer;
70 }
71
72 public void setDefaultClasspathContainer( String defaultClasspathContainer )
73 {
74 this.defaultClasspathContainer = defaultClasspathContainer;
75 }
76
77 public IdeDependency[] getWorkspaceArtefacts()
78 {
79 return workspaceArtefacts;
80 }
81
82 public void setWorkspaceArtefacts( IdeDependency[] workspaceArtefacts )
83 {
84 this.workspaceArtefacts = workspaceArtefacts;
85 }
86
87 public String getDefaultDeployServerId()
88 {
89 return defaultDeployServerId;
90 }
91
92 public void setDefaultDeployServerId( String defaultDeployServerId )
93 {
94 this.defaultDeployServerId = defaultDeployServerId;
95 }
96
97 public String getDefaultDeployServerName()
98 {
99 return defaultDeployServerName;
100 }
101
102 public void setDefaultDeployServerName( String defaultDeployServerName )
103 {
104 this.defaultDeployServerName = defaultDeployServerName;
105 }
106
107
108
109
110 public String getWebsphereVersion()
111 {
112 if ( getDefaultDeployServerId() != null && getDefaultDeployServerId().startsWith( "was." ) )
113 {
114 if ( getDefaultDeployServerId().indexOf( "v61" ) >= 0 )
115 {
116 return "6.1";
117 }
118 if ( getDefaultDeployServerId().indexOf( "v6" ) >= 0 )
119 {
120 return "6.0";
121 }
122 if ( getDefaultDeployServerId().indexOf( "v51" ) >= 0 )
123 {
124 return "5.1";
125 }
126 if ( getDefaultDeployServerId().indexOf( "v5" ) >= 0 )
127 {
128 return "5.0";
129 }
130 }
131 return null;
132 }
133
134 }