What's New in 5.4.0
When you start an Adobe or Lucee CF Engine, the WAR CommandBox uses has a stock web.xml baked into it. Sometimes you may want to add custom servlets, servlet mappings, etc into your server. You can override the stock web.xml in part or in total with a file of your own which you specify in the server.json like so:
{
"app" : {
"webXMLOverride" : "path/to/web-override.xml"
}
}
More info here:
In addition to quoting parameter values, parameter names can also be quoted. This is useful when setting keys into settings or JSON files that have spaces, hyphens or special characters. Each of these examples are now supported:
# quoted string
package set foo."bar.baz"=bum
# bracketed string
package set foo[bar.baz]=bum
# quoted, bracketed string
package set foo["bar.baz"]=bum
More info here:
Lucee Server has been updated to 5.3.8.201 and JBoss Undertow has been updated to 2.2.10.Final. The Lucee update, as usual, applies to the CLI as well as the default server you get when you run server start.
When you install a Jar via HTTP URL and the version number is baked into the URL, the jar endpoint now makes more assumptions about what the version of the package is that allows it to optimize the update checks and eliminate unnecessary downloads.
More info here:
Here are some fun commands for user interactivity in the shell. You can use these as part of a recipe or a nice "one-liner".
The ask command is similar to the ask() method in Task Runners. It requires an interactive terminal and will ask the user a question and return their answer. It is meant to be changed with other commands.
set color=`ask "favorite Color? "`
echo "you said ${Setting: color not found}"
or with default values
ask question="Who is cool? " defaultResponse="Balbino!"
or with masked input
ask question="What is your password? " mask=*
Or fun stuff like this
ask "Secret phrase: " | assertEqual "mockingbird" || echo "access denied!" && exit 1
The confirm command will ask the user a yes/no question and return a passing or failing exit code from the command based on the answer.
confirm "do you want to update your packages? " && update
Remember the && operator will only execute the second command if the first command returns an exit code of 0.
More info here:
You can easily forget all servers which have not been started for a certain period of time with the server prune command. It accepts the number of days that need to have passed since a server was last started in order to prune it.
server prune days=30
# Skip the confirmation check
server prune --force
More info here:
Here are the full release notes for CommandBox 5.4.0
Last modified 4mo ago