Author: akazakov
Date: 2012-01-19 17:28:05 -0500 (Thu, 19 Jan 2012)
New Revision: 37976
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamUtil.java
Log:
https://issues.jboss.org/browse/JBIDE-10679 Support Seam 2.3
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamUtil.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamUtil.java 2012-01-19
21:24:54 UTC (rev 37975)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamUtil.java 2012-01-19
22:28:05 UTC (rev 37976)
@@ -91,8 +91,9 @@
return getSeamVersionFromManifest(runtime);
}
- private final static String seamJarName = "jboss-seam.jar";
- private final static String seamVersionAttributeName = "Seam-Version";
+ private final static String SEAM_JAR_NAME = "jboss-seam.jar";
+ private final static String SEAM_VERSION_ATTRIBUTE_NAME = "Seam-Version";
+ private final static String IMPLEMENTATION_VERSION_ATTRIBUTE_NAME =
"Implementation-Version";
/**
* Returns Seam version from <Seam
Runtime>/lib/jboss-seam.jar/META-INF/MANIFEST.MF
@@ -140,9 +141,9 @@
* @return
*/
public static String getSeamVersionFromManifest(String seamHome) {
- File jarFile = new File(seamHome, "lib/" + seamJarName);
+ File jarFile = new File(seamHome, "lib/" + SEAM_JAR_NAME);
if(!jarFile.isFile()) {
- jarFile = new File(seamHome, seamJarName);
+ jarFile = new File(seamHome, SEAM_JAR_NAME);
if(!jarFile.isFile()) {
// Don't log this. See
https://jira.jboss.org/browse/JBIDE-7038
// SeamCorePlugin.getPluginLog().logWarning(jarFile.getAbsolutePath() + " as well
as " + new File(seamHome, "lib/" + seamJarName).getAbsolutePath() + "
don't exist.");
@@ -152,9 +153,13 @@
try {
JarFile jar = new JarFile(jarFile);
Attributes attributes = jar.getManifest().getMainAttributes();
- String version = attributes.getValue(seamVersionAttributeName);
+ String version = attributes.getValue(SEAM_VERSION_ATTRIBUTE_NAME);
if(version==null) {
SeamCorePlugin.getPluginLog().logWarning("Can't get Seam-Version from "
+ jar.getName() + " MANIFEST.");
+ version = attributes.getValue(IMPLEMENTATION_VERSION_ATTRIBUTE_NAME);
+ if(version==null) {
+ SeamCorePlugin.getPluginLog().logWarning("Can't get Implementation-Version
from " + jar.getName() + " MANIFEST.");
+ }
}
return version;
} catch (IOException e) {