dawesi
1
Is there an official endpoint to get lucee versions?
What is the best way to get the lastest version number as a string, or in json?
Is there a way to get the latest java supported version for each release also ? (if we’re rolling our own builds)
or should i just parse :
lucee-dockerfiles/matrix.yaml at master · lucee/lucee-dockerfiles
#Cheers
for the raw list
https://update.lucee.org/rest/update/provider/list
Version Query
otherwise, you can use a version query, it’s similar to commandbox but a little different, tailored to our versioning approach
- version (
5 / 5.4 / 5.4.5 / 5.4.5.1
)
- type (
rc, snapshot ,stable or all
)
- distribution (
lco, war, zero, light, jar
)
- format (
string, url ,info, filename, redirect
) (redirect is the default)
restpath="latest/{version}/{type}/{distribution}/{format}"
https://luceeserver.atlassian.net/browse/LDEV-4661
Examples
https://update.lucee.org/rest/update/provider/latest/6/stable/lco/url
returns
"https://cdn.lucee.org/6.2.1.122.lco"
https://update.lucee.org/rest/update/provider/latest/6/stable/lco/info
returns
{
version: "6.2.1.122",
filename: "6.2.1.122.lco",
url: "https://cdn.lucee.org/6.2.1.122.lco"
}
Which is what we use for script-runner
for testing on lucee-testlab and for all our extension repos, via -DluceeVersionQuery="5.4/stable/light
there’s no API for supported java versions, but the rule of thumb is pretty basic
javaVersion = ( left( server.lucee.version, 3 ) LT 6.1 ) ? 11 : 21;
1 Like
Thanks mate. Great to have it here for reference also.
Peter
4
I don’t know if this is what you are looking for or if it helps, but there is version number etc in this.
<cfelseif IsDefined("Server.ColdFusion.ProductName") and Server.ColdFusion.ProductName neq "">
#Server.ColdFusion.ProductName#
</cfif>
<cfif IsDefined("Server.Lucee.Version") and Server.Lucee.Version neq "">
#Server.Lucee.Version#
<cfif IsDefined("Server.Lucee['release-date']") and Server.Lucee['release-date'] neq "">
(#DateFormat(Server.Lucee['release-date'], "d-mmm-yyyy")#)
</cfif>
<cfelseif IsDefined("Server.ColdFusion.ProductVersion") and Server.ColdFusion.ProductVersion neq "">
(#Server.ColdFusion.ProductVersion#)
</cfif>
<cfif IsDefined("server.servlet.name")>
- #server.servlet.name#
<cftry>
<cfset tomcatinfo = CreateObject("java","org.apache.catalina.util.ServerInfo")>
<cfset tomcatbuid = tomcatinfo.getServerBuilt()>
(#ListGetAt(variables.tomcatbuid, 2, " ")#-#ListGetAt(variables.tomcatbuid, 1, " ")#-#ListGetAt(variables.tomcatbuid, 3, " ")#)
<cfcatch></cfcatch>
</cftry>
</cfif>
<cfset runtime = CreateObject("java","java.lang.Runtime").getRuntime()>
<cfset freeMemory = runtime.freeMemory() / 1024 / 1024>
<cfset totalMemory = runtime.totalMemory() / 1024 / 1024>
<cfset maxMemory = runtime.maxMemory() / 1024 / 1024>
<cfset jvmsystem = CreateObject("java", "java.lang.System")>
<cfset jvmproperties = jvmsystem.getProperties()>
<cfif StructKeyExists(jvmproperties, "java.vm.vendor")>
#jvmproperties["java.vm.vendor"]#
</cfif>
<cfif StructKeyExists(jvmproperties, "java.runtime.name")>
#jvmproperties["java.runtime.name"]#
</cfif>
<cfif StructKeyExists(jvmproperties, "java.runtime.version")>
#jvmproperties["java.runtime.version"]#
</cfif>
<cfif StructKeyExists(jvmproperties, "java.version.date")>
(#DateFormat(jvmproperties["java.version.date"], "d-mmm-yyyy")#)
</cfif>
JVM allocated memory = #NumberFormat(variables.maxMemory)# MB
JVM in use memory = #NumberFormat(variables.totalMemory)# MB
VM time zone = <cftry>
<cfset javatzfile = "">
<cfif StructKeyExists(jvmproperties, "java.home")>
<cfset javatzfile = jvmproperties["java.home"] & "\lib\tzdb.dat">
<cfif FileExists(variables.javatzfile)>
<cffile action="READ" file="#variables.javatzfile#" variable="filecontent">
<cfset pos = FindNocase("TZDB", variables.filecontent)>
<cfif variables.pos gt 0>
#Mid(variables.filecontent, (variables.pos + 8), 5)# -
</cfif>
</cfif>
</cfif>
<cfif variables.javatzfile eq "">
<cfset javatzfile = CreateObject("java", "java.lang.System").getProperties().java.home & "\lib\zi\ZoneInfoMappings">
<!--- <cfdump var="#CreateObject("java", "java.lang.System").getProperties()#"> --->
<cfif FileExists(variables.javatzfile)>
<cffile action="READ" file="#variables.javatzfile#" variable="filecontent">
<cfset pos = FindNocase("tzdata", variables.filecontent)>
<cfif variables.pos gt 0>
#Mid(variables.filecontent, (variables.pos + 6), 5)# -
</cfif>
<cfelse>
<cfset javatzfile = CreateObject("java", "java.lang.System").getProperties().java.home & "\lib\tzdb.dat">
<cfif FileExists(variables.javatzfile)>
<cffile action="READ" file="#variables.javatzfile#" variable="filecontent">
<cfset pos = FindNocase("TZDB", variables.filecontent)>
<cfif variables.pos gt 0>
#Mid(variables.filecontent, (variables.pos + 8), 5)# -
</cfif>
</cfif>
</cfif>
</cfif>
<cfcatch>
</cfcatch>
</cftry>
<cfset tz = CreateObject("java", "java.util.TimeZone")>
<cfset tz = tz.getDefault()>
#tz.getID()# #tz.getDisplayName()#