424598 switch on JRE version in module download

This commit is contained in:
Greg Wilkins 2013-12-23 15:53:12 +11:00
parent e5b85055bd
commit 858b737be1
2 changed files with 69 additions and 17 deletions

View File

@ -3,24 +3,42 @@
#
[files]
http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar:lib/npn/npn-boot-1.1.6.v20130911.jar
${switch java.version
1.7.0_4: http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar:lib/npn/npn-boot-1.1.0.v20120525.jar
1.7.0_5: http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar:lib/npn/npn-boot-1.1.0.v20120525.jar
1.7.0_6: http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar:lib/npn/npn-boot-1.1.1.v20121030.jar
1.7.0_7: http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar:lib/npn/npn-boot-1.1.1.v20121030.jar
1.7.0_9: http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar:lib/npn/npn-boot-1.1.3.v20130313.jar
1.7.0_10: http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar:lib/npn/npn-boot-1.1.3.v20130313.jar
1.7.0_11: http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar:lib/npn/npn-boot-1.1.3.v20130313.jar
1.7.0_13: http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar:lib/npn/npn-boot-1.1.4.v20130313.jar
1.7.0_15: http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
1.7.0_17: http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
1.7.0_21: http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
1.7.0_25: http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
1.7.0_40: http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar:lib/npn/npn-boot-1.1.6.v20130911.jar
1.7.0_45: http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar:lib/npn/npn-boot-1.1.6.v20130911.jar
}
[ini-template]
# NPN Configuration
# NPN boot jar for JRE 1.7.0_45
--exec
-Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
${switch java.version
1.7.0_4: -Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar
1.7.0_5: -Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar
1.7.0_6: -Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar
1.7.0_7: -Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar
1.7.0_9: -Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
1.7.0_10: -Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
1.7.0_11: -Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
1.7.0_13: -Xbootclasspath/p:lib/npn/npn-boot-1.1.4.v20130313.jar
1.7.0_15: -Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
1.7.0_17: -Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
1.7.0_21: -Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
1.7.0_25: -Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
1.7.0_40: -Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
1.7.0_45: -Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
}
# For other versions of JRE, an appropriate npn-boot jar must be downloaded
#
# 1.7.0 - 1.7.0u2 - 1.7.0u3 http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.0.0.v20120402/npn-boot-1.0.0.v20120402.jar
# 1.7.0u4 - 1.7.0u5 http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar
# 1.7.0u6 - 1.7.0u7 http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar
# 1.7.0u9 - 1.7.0u10 - 1.7.0u11 http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar
# 1.7.0u13 http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar
# 1.7.0u15 - 1.7.0u17 - 1.7.0u21 - 1.7.0u25 http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar
# 1.7.0u40 http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar
# 1.7.0u45 http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar
#
# Then edit the -Xbootclasspath line above with the correct version
# For other versions of JRE, an appropriate npn-boot jar must be downloaded from http://repo1.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/
# and then edit the -Xbootclasspath line above with the correct version

View File

@ -261,9 +261,43 @@ public class Module
{
String line;
String sectionType = "";
String switchProperty = null;
String caseTag = null;
String caseTagColon = null;
boolean switched = false;
while ((line = buf.readLine()) != null)
{
line = line.trim();
if (caseTag!=null)
{
if ("}".equals(line))
{
if (!switched)
StartLog.warn("WARN: No matching case in %s for ${switch %s=%s ...}",basehome.toShortForm(file),switchProperty,caseTag);
caseTag=null;
caseTagColon=null;
switchProperty=null;
continue;
}
if (switched)
continue;
if (!line.startsWith(caseTagColon) && !line.startsWith("*:"))
continue;
switched=true;
line=line.substring(line.indexOf(':')+1).trim();
}
else if (line.startsWith("${switch "))
{
switched=false;
switchProperty=line.substring(9).trim();
caseTag=System.getProperty(switchProperty);
caseTagColon=caseTag+":";
continue;
}
Matcher sectionMatcher = section.matcher(line);
@ -273,7 +307,7 @@ public class Module
}
else
{
// blank lines and comments are valid for initialise section
// blank lines and comments are valid for initialize section
if (line.length() == 0 || line.startsWith("#"))
{
if ("INI-TEMPLATE".equals(sectionType))