Best practice for compiling `*.cfc,*.cfm` via mave...
# lucee
m
Best practice for compiling
*.cfc,*.cfm
via maven? I am looking into script runner which also pulls ant into the mix. Anyone doing this via maven when building your applications?
b
Pete Freitag has a little CommandBox module to help do this
Lucee never made any official tooling outside of a pre-compiled mapping, so it's a bit of a pain'
also, depends on exactly what you mean. Do you want to • compile in-place so the .cfm file actually is a class file on disk • or just seed the classes folder with the class files
The latter bullet sometimes can be easily done by just starting the server and warming up our app by hitting a URL that runs a test suite or something that hits most files to get them compiled
Here's that module Pete made https://forgebox.io/view/cfml-compiler
m
Much appreciated @bdw429s... I want to rid my "war" build of any CFC and CFM and point to the compiled version and disable the option to be most performant in lucee admin to avoid having any cfm being compiled once deployed. So this is all pre deployment, I have the the application during "initialization" compiling the mappings via the native lucee admin, yet I want to get in front of that in my build process before it even gets deployed and make it part of my maven build. I will scope out the cfml-compiler mentioned above šŸ‘
z
always compile you code with the version you are deploying with, with 6.1 + and java 21, you'll get java 21 bytecode which is better compiling mappings is pretty easy
Copy code
admin
	action="getMappings"
	type="web"
	password="#request.adminPassword#"
	returnVariable="mappings";

loop query="mappings" {
	admin
		action="compileMapping"
		type="web"
		password=#request.adminPassword#
		virtual="#mappings.virtual#"
		stoponerror="false";
}
šŸ‘ 1