You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2012/10/05 06:57:06 UTC

svn commit: r1394359 - /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/

Author: gawor
Date: Fri Oct  5 04:57:06 2012
New Revision: 1394359

URL: http://svn.apache.org/viewvc?rev=1394359&view=rev
Log:
GERONIMODEVTOOLS-804: Removed some unused code for 3.0 servers

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoRuntimeDelegate.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerRuntimeTargetHandler.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoRuntimeDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoRuntimeDelegate.java?rev=1394359&r1=1394358&r2=1394359&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoRuntimeDelegate.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoRuntimeDelegate.java Fri Oct  5 04:57:06 2012
@@ -97,46 +97,33 @@ public class GeronimoRuntimeDelegate ext
             return status;
         }
 
-        if (getVMInstall() == null)
+        if (getVMInstall() == null) {
             return new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, Messages.errorJRE, null);
-
+        }
+        
         IPath runtimeLoc = getRuntime().getLocation();
 
         // check for server file structure
-        String version = getRuntime().getRuntimeType().getVersion();
+        int limit = 2;
         int count = 0;
-        int limit = 4;
-        if (version.startsWith("3")){
-        	//for version 3.0+
-        	
-	        count = runtimeLoc.append("lib").toFile().exists() ? ++count : count;
-	        count = runtimeLoc.append("repository").toFile().exists() ? ++count : count;
-	        
-	        limit = 2;
-	        
-        }else{
-        	//for version before 3.0
-	        count = runtimeLoc.append("bin/server.jar").toFile().exists() ? ++count : count;
-	        count = runtimeLoc.append("bin/deployer.jar").toFile().exists() ? ++count : count;
-	        count = runtimeLoc.append("lib").toFile().exists() ? ++count : count;
-	        count = runtimeLoc.append("repository").toFile().exists() ? ++count : count;
-	
+        if (runtimeLoc.append("lib").toFile().exists()) {
+            count++;
         }
-        
+        if (runtimeLoc.append("repository").toFile().exists()) {
+            count++;
+        }
+	              
         if (count == 0) {
             return new Status(IStatus.ERROR, Activator.PLUGIN_ID, NO_IMAGE, "", null);
         }
         
-        if (count < limit) {
-        	
+        if (count < limit) {        	
 			// part of a server image was found, don't let install happen
 			return new Status(IStatus.ERROR, Activator.PLUGIN_ID,
 					PARTIAL_IMAGE, Messages.bind(Messages.missingContent,
 							getRuntime().getName()), null);
         }
-
         
-
         String detectedVersion = detectVersion();
         if (detectedVersion == null) {
 			return new Status(IStatus.WARNING, Activator.PLUGIN_ID,
@@ -144,8 +131,7 @@ public class GeronimoRuntimeDelegate ext
 							getRuntime().getName()), null);
 		}
 
-        if (!detectedVersion.startsWith(getRuntime().getRuntimeType()
-				.getVersion())) {
+        if (!detectedVersion.startsWith(getRuntime().getRuntimeType().getVersion())) {
         	String runtimeVersion = getRuntime().getRuntimeType().getVersion();
 			String message = NLS.bind(Messages.incorrectVersion,
 					new String[] { getRuntime().getName(),

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java?rev=1394359&r1=1394358&r2=1394359&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerBehaviourDelegate.java Fri Oct  5 04:57:06 2012
@@ -1177,21 +1177,13 @@ public class GeronimoServerBehaviourDele
     protected void setupLaunchClasspath(ILaunchConfigurationWorkingCopy wc, IVMInstall vmInstall) throws CoreException {
         List<IRuntimeClasspathEntry> cp = new ArrayList<IRuntimeClasspathEntry>();
         
-        String version = getServer().getRuntime().getRuntimeType().getVersion();
-        
-        if (version.startsWith("3")) {
-            //get required jar file
-            IPath libPath = getServer().getRuntime().getLocation().append("/lib");
-            for (String jarFile: libPath.toFile().list()){
-                IPath serverJar = libPath.append("/"+jarFile);
-                cp.add(JavaRuntime.newArchiveRuntimeClasspathEntry(serverJar));
-            }
-            
-        }else{
-             //for 1.1,2.0,2.1,2.2 
-             IPath serverJar = getServer().getRuntime().getLocation().append("/bin/server.jar");
-             cp.add(JavaRuntime.newArchiveRuntimeClasspathEntry(serverJar));
+        //get required jar file
+        IPath libPath = getServer().getRuntime().getLocation().append("/lib");
+        for (String jarFile: libPath.toFile().list()){
+            IPath serverJar = libPath.append("/"+jarFile);
+            cp.add(JavaRuntime.newArchiveRuntimeClasspathEntry(serverJar));
         }
+
         // merge existing classpath with server classpath
         IRuntimeClasspathEntry[] existingCps = JavaRuntime.computeUnresolvedRuntimeClasspath(wc);
 

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerRuntimeTargetHandler.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerRuntimeTargetHandler.java?rev=1394359&r1=1394358&r2=1394359&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerRuntimeTargetHandler.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerRuntimeTargetHandler.java Fri Oct  5 04:57:06 2012
@@ -22,7 +22,6 @@ import java.util.List;
 import org.apache.geronimo.st.v30.core.internal.Messages;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate;
 import org.eclipse.wst.server.core.IRuntime;
 
@@ -35,17 +34,6 @@ public class GeronimoServerRuntimeTarget
      * @see org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate#getClasspathContainerLabel(org.eclipse.wst.server.core.IRuntime)
      */
     public String getClasspathContainerLabel(IRuntime runtime) {
-        String version = runtime.getRuntimeType().getVersion();
-        if (version.equals("1.1")) {
-            return Messages.target11runtime;
-        }else  if (version.equals("2.0")) {
-            return Messages.target20runtime;
-        }
-        else if (version.equals("2.1")) {
-            return Messages.target21runtime;
-        }if (version.equals("2.2")) {
-            return Messages.target22runtime;
-        }
         return Messages.target30runtime;
     }
 
@@ -62,100 +50,23 @@ public class GeronimoServerRuntimeTarget
         IPath path = runtime.getLocation().append("lib");
         addLibraryEntries(list, path.toFile(), true);
 
-        String version = runtime.getRuntimeType().getVersion();
-
-        if (version.equals("1.0")) {
-            IPath specPath = runtime.getLocation().append("repository/org.apache.geronimo.specs/jars/");
-            addLibraryEntries(list, specPath.toFile(), false);
-        }
-        else if (version.equals("1.1")) {
-            IPath specPath = runtime.getLocation().append("repository/org/apache/geronimo/specs/geronimo-j2ee_1.4_spec/1.1/geronimo-j2ee_1.4_spec-1.1.jar");
-            //hack to add servlet/jsp spec jars to little G
-            if (!specPath.toFile().exists()) {
-                IPath servletSpec =runtime.getLocation().append("repository/org/apache/geronimo/specs/geronimo-servlet_2.4_spec/1.0.1/geronimo-servlet_2.4_spec-1.0.1.jar");
-                IPath jspSpec = runtime.getLocation().append("repository/org/apache/geronimo/specs/geronimo-jsp_2.0_spec/1.0.1/geronimo-jsp_2.0_spec-1.0.1.jar");
-                list.add(JavaCore.newLibraryEntry(servletSpec, null, null));
-                list.add(JavaCore.newLibraryEntry(jspSpec, null, null));
-            }
-            else {
-                list.add(JavaCore.newLibraryEntry(specPath, null, null));
-            }
-        }
-        else {
-            IPath specPath = runtime.getLocation().append("repository/org/apache/geronimo/specs/");
-            addLibraryEntries(list, specPath.toFile(), true);
-
-            //
-            // Add spec jars that are not in the specs directory (per Geronimo configs jee-specs)
-            //
-            if (version.startsWith("2.0")) {
-                IPath javaMailSpec = runtime.getLocation().append("repository/org/apache/geronimo/javamail/geronimo-javamail_1.4_mail/");
-                IPath jaxbApiSpec  = runtime.getLocation().append("repository/javax/xml/bind/jaxb-api/");
-                IPath jabxImplSpec = runtime.getLocation().append("repository/com/sun/xml/bind/jaxb-impl/");
-                IPath jaxwsApiSpec = runtime.getLocation().append("repository/org/apache/axis2/axis2-jaxws-api/");
-                IPath saajApiSpec  = runtime.getLocation().append("repository/org/apache/axis2/axis2-saaj-api/");
-                IPath jstlSpec     = runtime.getLocation().append("repository/jstl/jstl/");
-                IPath myfacesSpec  = runtime.getLocation().append("repository/org/apache/myfaces/core/myfaces-api/");
-                IPath jdbcSpec     = runtime.getLocation().append("repository/org/apache/geronimo/modules/geronimo-jdbc/");
-                addLibraryEntries(list, javaMailSpec.toFile(), true);
-                addLibraryEntries(list, jaxbApiSpec.toFile(),  true);
-                addLibraryEntries(list, jabxImplSpec.toFile(), true);
-                addLibraryEntries(list, jaxwsApiSpec.toFile(), true);
-                addLibraryEntries(list, saajApiSpec.toFile(),  true);
-                addLibraryEntries(list, jstlSpec.toFile(),     true);
-                addLibraryEntries(list, myfacesSpec.toFile(),  true);
-                addLibraryEntries(list, jdbcSpec.toFile(),     true);
-            }
-            if (version.startsWith("2.1")) {
-                IPath javaMailSpec = runtime.getLocation().append("repository/org/apache/geronimo/javamail/geronimo-javamail_1.4_mail/");
-                IPath jaxbApiSpec  = runtime.getLocation().append("repository/javax/xml/bind/jaxb-api/");
-                IPath jabxImplSpec = runtime.getLocation().append("repository/com/sun/xml/bind/jaxb-impl/");
-                IPath jaxwsApiSpec = runtime.getLocation().append("repository/org/apache/axis2/axis2-jaxws-api/");
-                IPath jstlSpec     = runtime.getLocation().append("repository/jstl/jstl/");
-                IPath myfacesSpec  = runtime.getLocation().append("repository/org/apache/myfaces/core/myfaces-api/");
-                IPath myfacesImplSpec  = runtime.getLocation().append("repository/org/apache/myfaces/core/myfaces-impl/");
-                IPath jdbcSpec     = runtime.getLocation().append("repository/org/apache/geronimo/framework/geronimo-jdbc/");
-                addLibraryEntries(list, javaMailSpec.toFile(), true);
-                addLibraryEntries(list, jaxbApiSpec.toFile(),  true);
-                addLibraryEntries(list, jabxImplSpec.toFile(), true);
-                addLibraryEntries(list, jaxwsApiSpec.toFile(), true);
-                addLibraryEntries(list, jstlSpec.toFile(),     true);
-                addLibraryEntries(list, myfacesSpec.toFile(),  true);
-                addLibraryEntries(list, myfacesImplSpec.toFile(),  true);
-                addLibraryEntries(list, jdbcSpec.toFile(),     true);
-            }
-            if (version.startsWith("2.2")) {
-                 //TODO: review list here when server 2.2 is ready
-                 IPath javaMailSpec = runtime.getLocation().append("repository/org/apache/geronimo/javamail/geronimo-javamail_1.4_mail/");
-                 IPath jabxImplSpec = runtime.getLocation().append("repository/com/sun/xml/bind/jaxb-impl/");
-                 IPath jstlSpec     = runtime.getLocation().append("repository/javax/servlet/jstl");
-                 IPath myfacesSpec  = runtime.getLocation().append("repository/org/apache/myfaces/core/myfaces-api/");
-                 IPath myfacesImplSpec  = runtime.getLocation().append("repository/org/apache/myfaces/core/myfaces-impl/");
-                 IPath jdbcSpec     = runtime.getLocation().append("repository/org/apache/geronimo/framework/geronimo-jdbc/");
-                 addLibraryEntries(list, javaMailSpec.toFile(), true);               
-                 addLibraryEntries(list, jabxImplSpec.toFile(), true);
-                 addLibraryEntries(list, jstlSpec.toFile(),     true);
-                 addLibraryEntries(list, myfacesSpec.toFile(),  true);
-                 addLibraryEntries(list, myfacesImplSpec.toFile(),  true);
-                 addLibraryEntries(list, jdbcSpec.toFile(),     true);
-            }
-            if (version.startsWith("3.0")) {
-                 //TODO: review list here when server 3.0 is ready
-                 IPath javaMailSpec = runtime.getLocation().append("repository/org/apache/geronimo/javamail/geronimo-javamail_1.4_mail/");
-                 IPath jabxImplSpec = runtime.getLocation().append("repository/org/apache/geronimo/bundles/jaxb-impl");
-                 IPath jstlSpec     = runtime.getLocation().append("repository/org/apache/geronimo/bundles/jstl");
-                 IPath myfacesSpec  = runtime.getLocation().append("repository/org/apache/geronimo/bundles/myfaces-bundle/");
-                 IPath jdbcSpec     = runtime.getLocation().append("repository/org/apache/geronimo/framework/geronimo-jdbc/");
-                 IPath osgiSpecs    = runtime.getLocation().append("repository/org/osgi/");
+        IPath specPath = runtime.getLocation().append("repository/org/apache/geronimo/specs/");
+        addLibraryEntries(list, specPath.toFile(), true);
+            
+        //TODO: review list here when server 3.0 is ready
+        IPath javaMailSpec = runtime.getLocation().append("repository/org/apache/geronimo/javamail/geronimo-javamail_1.4_mail/");
+        IPath jabxImplSpec = runtime.getLocation().append("repository/org/apache/geronimo/bundles/jaxb-impl");
+        IPath jstlSpec     = runtime.getLocation().append("repository/org/apache/geronimo/bundles/jstl");
+        IPath myfacesSpec  = runtime.getLocation().append("repository/org/apache/geronimo/bundles/myfaces-bundle/");
+        IPath jdbcSpec     = runtime.getLocation().append("repository/org/apache/geronimo/framework/geronimo-jdbc/");
+        IPath osgiSpecs    = runtime.getLocation().append("repository/org/osgi/");
                 
-                 addLibraryEntries(list, javaMailSpec.toFile(), true);               
-                 addLibraryEntries(list, jabxImplSpec.toFile(), true);
-                 addLibraryEntries(list, jstlSpec.toFile(),     true);
-                 addLibraryEntries(list, myfacesSpec.toFile(),  true);
-                 addLibraryEntries(list, jdbcSpec.toFile(),     true);
-                 addLibraryEntries(list, osgiSpecs.toFile(),    true);
-            }
-        }
+        addLibraryEntries(list, javaMailSpec.toFile(), true);               
+        addLibraryEntries(list, jabxImplSpec.toFile(), true);
+        addLibraryEntries(list, jstlSpec.toFile(),     true);
+        addLibraryEntries(list, myfacesSpec.toFile(),  true);
+        addLibraryEntries(list, jdbcSpec.toFile(),     true);
+        addLibraryEntries(list, osgiSpecs.toFile(),    true);
 
         return(IClasspathEntry[])list.toArray(new IClasspathEntry[list.size()]);
     }