Maven build error

Was attempting to follow the docs at https://docs.lucee.org/guides/working-with-source/build-from-source.html, and I get the following error after running mvn test:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  04:01 min
[INFO] Finished at: 2019-09-09T19:53:36-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (ant-magic) on project lucee: An Ant BuildException has occured: The following error occurred while executing this line:
[ERROR] /home/michael/server/opensource/Lucee/ant/build-core.xml:905: Unable to create javax script engine for javascript
[ERROR] around Ant part ...<ant antfile="../ant/build-core.xml" target="buildLoaderMaven"/>... @ 15:67 in /home/michael/server/opensource/Lucee/loader/target/antrun/build-main.xml
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

I’m using OpenJDK 1.8.0_222, by the way, on Ubuntu 18.04.

Now, I was able to build using ant fast, but I wanted to put this out there. Do we need to update the Lucee build documentation?

Did you try this?

I ran it with the -X flag this morning. Here’s the full stack trace from that:

build-error.txt (12.8 KB)

This article gives a decent explanation of what is going on:
https://www.links.org/?p=1290

It would seem I need the BSG library as well as as Mozilla’s Rhino library or some other JS implementation.

are you on the 5.3 branch?

Just ran into the same error on branch 6.0

mvn test -X gives the following:

[WARNING] [echo] build-core.xml before readRequiredExtensions
[DEBUG] Couldn’t load Resource org/apache/bsf/BSFManager.class
[DEBUG] Class javax.script.ScriptEngineManager loaded from parent loader (parentFirst)
[DEBUG] Class org.apache.tools.ant.util.optional.JavaxScriptRunner loaded from parent loader (parentFirst)
[DEBUG] [ant] Exiting …/Lucee/ant/build-core.xml.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.001 s
[INFO] Finished at: 2022-02-12T10:06:53-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:3.0.0:run (ant-magic) on project lucee: An Ant BuildException has occured: The following error occurred while executing this line:
[ERROR] …/Lucee/ant/build-core.xml:95: Unable to create javax script engine for javascript
[ERROR] around Ant part …… @ 17:70 in …/Lucee/loader/target/antrun/build-main.xml

However, after reading the “Building Lucee 5 & 6 from source” docs more closely I read these lines:

  • Java 11 is recommended, Java 15 is not yet supported due the removal of the Nashorn Javascript engine which is used in the build process
  • Java 17 isn’t yet fully supported due to some Apache Felix issues (fixed in 5.3.9, but some extensions need updating)

So, sure enough, when I checked $JAVA_HOME I was using jdk 17 and not 11. Once I switched versions the build ran successfully.

2 Likes

thanks for sharing! I’m glad my efforts updating the build docs have helped someone :muscle: :dancing_women:

2 Likes

while on the topic, there’s bug which anyone trying to build lucee might hit, unless you have an existing maven cache ( the .m2 dir )

#helpwanted

https://luceeserver.atlassian.net/browse/LDEV-3691