@@ -25,6 +25,7 @@ component {
2525 list = arguments .specType ;
2626 if ( ! isNull ( data [ arguments .specType ] ) ) return ; // already built
2727 } else {
28+ // zero is built by the build process and not handled here
2829 list = " lco,war,light,express" ;
2930 if (includingForgeBox )
3031 list & = " ,forgebox,forgebox-light" ;
@@ -132,6 +133,7 @@ component {
132133 }
133134 catch ( e ){
134135 logger (text = e .message , type = " error" , exception = e );
136+ trg = e .message ;
135137 }
136138 finally {
137139 if (! isNull (temp ) && directoryExists (temp )) directoryDelete (temp ,true );
@@ -163,8 +165,13 @@ component {
163165 var build = {};
164166 loop list = " extensions,common,website,war" item = " local.name" {
165167 var tmp = curr & " build/" & name & " /" ;
166- if ( name == " extensions" && ! directoryExists ( tmp ) )
167- directoryCreate ( tmp , true );
168+ if ( ! directoryExists ( tmp ) ){
169+ if ( name == " extensions" ){
170+ directoryCreate ( tmp , true );
171+ } else {
172+ throw ( message = " Required build directory missing: " & tmp );
173+ }
174+ }
168175 if ( name == " war" ){
169176 tmp = curr & " build/" & warTemplateFolder & " /" ;
170177 }
@@ -186,6 +193,7 @@ component {
186193 }
187194 catch ( e ){
188195 logger (text = e .message , type = " error" , exception = e );
196+ trg = e .message ;
189197 }
190198 finally {
191199 if (! isNull (temp ) && directoryExists (temp )) directoryDelete (temp ,true );
@@ -235,7 +243,7 @@ component {
235243
236244 // unzip core
237245 var lcoFile = tmpLoader & sep & " core" & sep & " core.lco" ;
238- local . tmpCore = temp & " lucee-core-" & createUniqueId (); // the jar
246+ var tmpCore = temp & " lucee-core-" & createUniqueId (); // the jar
239247 directoryCreate (tmpCore );
240248 zip action = " unzip" file = lcoFile destination = tmpCore ;
241249
@@ -258,7 +266,7 @@ component {
258266 if ( fileExists ( lcoFile ) ) fileDelete ( lcoFile );
259267 zip action = " zip" source = tmpCore file = lcoFile ;
260268 // zip loader
261- local . tmpLoaderFile = temp & " lucee-loader-" & createUniqueId ()& " .jar" ;
269+ var tmpLoaderFile = temp & " lucee-loader-" & createUniqueId ()& " .jar" ;
262270 zip action = " zip" source = tmpLoader file = tmpLoaderFile ;
263271
264272 // if(fileExists(light)) fileDelete(light);
@@ -273,6 +281,7 @@ component {
273281 }
274282 catch ( e ){
275283 logger (text = e .message , type = " error" , exception = e );
284+ trg = e .message ;
276285 }
277286 finally {
278287 if (! isNull (temp ) && directoryExists (temp )) directoryDelete (temp ,true );
@@ -316,12 +325,18 @@ component {
316325 var local_tomcat_templates = curr & " build/servers"
317326 if ( checkVersionGTE ( arguments .version , 6 , 2 , 1 ) ) {
318327 logger (" Using Tomcat 11" );
328+ if ( ! structKeyExists ( expressTemplates , ' tomcat-11' ) )
329+ throw ( message = " No Tomcat 11 express template found for version #arguments .version #" );
319330 zip action = " unzip" file = " #local_tomcat_templates #/#expressTemplates [' tomcat-11' ] #" destination = tmpTom ;
320331 } else if ( checkVersionGTE ( arguments .version , 6 , 2 ) ) {
321332 logger (" Using Tomcat 10" );
333+ if ( ! structKeyExists ( expressTemplates , ' tomcat-10' ) )
334+ throw ( message = " No Tomcat 10 express template found for version #arguments .version #" );
322335 zip action = " unzip" file = " #local_tomcat_templates #/#expressTemplates [' tomcat-10' ] #" destination = tmpTom ;
323336 } else {
324337 logger (" Using Tomcat 9" );
338+ if ( ! structKeyExists ( expressTemplates , ' tomcat-9' ) )
339+ throw ( message = " No Tomcat 9 express template found for version #arguments .version #" );
325340 zip action = " unzip" file = " #local_tomcat_templates #/#expressTemplates [' tomcat-9' ] #" destination = tmpTom ;
326341 }
327342
@@ -342,6 +357,7 @@ component {
342357 }
343358 catch ( e ){
344359 logger (text = e .message , type = " error" , exception = e );
360+ trg = e .message ;
345361 }
346362 finally {
347363 if (! isNull (temp ) && directoryExists (temp )) directoryDelete (temp ,true );
@@ -378,9 +394,9 @@ component {
378394 // create the war
379395 var war = temp & " /engine.war" ;
380396 if ( arguments .light ) {
381- local . lightJar = createLight (jar , version , false , temp );
382- if ( ! fileExists ( local . lightJar ) )
383- throw " ERROR: forgebox light, createLight didn't produce a jar [#local . lightJar #]" ;
397+ var lightJar = createLight (jar , version , false , temp );
398+ if ( ! fileExists ( lightJar ) )
399+ throw " ERROR: forgebox light, createLight didn't produce a jar [#lightJar #]" ;
384400 }
385401
386402 zip action = " zip" file = war overwrite = true {
@@ -419,6 +435,7 @@ component {
419435 }
420436 catch ( e ){
421437 logger (text = e .message , type = " error" , exception = e );
438+ trg = e .message ;
422439 }
423440 finally {
424441 if (! isNull (temp ) && directoryExists (temp )) directoryDelete (temp ,true );
0 commit comments