scriptdef not working in ant build.xml for latest DITAOT 4.2.3

62 views
Skip to first unread message

Ganapathy P

unread,
Aug 26, 2024, 2:55:10 AM8/26/24
to DITA-OT Users
Hi All,

Build.xml
  <basename property="job.language.upper" file="${basedir}${file.separator}..${file.separator}"/>
  <scriptdef language="javascript" name="lower">
    <attribute name="string"/>
    <attribute name="to"/>
    project.setProperty(attributes.get("to"),attributes.get("string").toLowerCase());
  </scriptdef>


ERROR:
[lower] ScriptEngineManager providers.next(): javax.script.ScriptEngineFactory: Provider com.oracle.truffle.js.scriptengine.GraalJSEngineFactory could not be instantiated
Java 15 has removed Nashorn, you must provide an engine for running JavaScript yourself. GraalVM JavaScript currently is the preferred option.

Note: No issue while running using DITAOT 1.8.

Please share any ideas, if you have solved them before.

Regards
Ganapathy 

kendalldita

unread,
Aug 26, 2024, 3:15:25 AM8/26/24
to Ganapathy P, DITA-OT Users
It seems to be pointing out that Nashorn javascript engine was removed, so you need to supply a script engine for java script. The one graalvm javascript and rhino are mentioned as implementations https://ant.apache.org/manual/install.html#librarydependencies

--
You received this message because you are subscribed to the Google Groups "DITA-OT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dita-ot-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/dita-ot-users/CABZNbqTBsLxWGY1MnaDd8WaoXiXL5y797WebLuLhNNnpAs0tLQ%40mail.gmail.com.

Ganapathy P

unread,
Aug 26, 2024, 3:20:19 AM8/26/24
to kendalldita, DITA-OT Users
Thanks, I'll check it out. 

Radu Coravu

unread,
Aug 26, 2024, 4:25:29 AM8/26/24
to Ganapathy P, kendalldita, DITA-OT Users
Here is a link to the Ant <script> documentation:


there is this part there:

Starting with Java 15 Nashorn has been removed again.....
In my opinion to avoid third party dependencies, ideally you should attempt to remove all the Javascript content from the ANT build file and create custom Ant tasks implemented in Java for those parts.

Stefan Jung

unread,
Aug 26, 2024, 12:38:31 PM8/26/24
to Ganapathy P, kendalldita, DITA-OT Users
Hello,
 
you can try installing my plugin org.jung.graal. I made it for exactly this purpose. You can also install it from the DITA-OT registry, see dita-ot.org/plugins/org.jung.graal.
 
Best regards,
Stefan
Ganapathy P <ganapa...@gmail.com> hat am 26.08.2024 09:20 CEST geschrieben:
To view this discussion on the web, visit https://groups.google.com/d/msgid/dita-ot-users/CABZNbqTVdGgMFn6BD-pk0%3DMJctOAzOK_zfBAf1SySCSY5tMavg%40mail.gmail.com.
 
Stefan Jung Consulting
Philipp-Manz-Straße 54
48268 Greven
 
Phone : +49 163 7431585
Reply all
Reply to author
Forward
0 new messages