Message6605

Author j13r
Recipients heuermh, j13r, zyasoft
Date 2011-08-17.01:42:28
SpamBayes Score 4.3127136e-07
Marked as misclassified No
Message-id <1313545349.15.0.976504325324.issue1485@psf.upfronthosting.co.za>
In-reply-to
Content
It actually does work. Let me explain.
Both the jruby and the jython dependencies put a javax.script.ScriptEngineFactory file in the META-INF directory. Jar/Zip allows multiple files with the same name (they are just named records, one after another). But when java reads the jar, it only reads the first (or last) of those records/files. So it will only read one of the ScriptEngineFactories.

What is needed is that the ScriptEngineFactory is merged. You can do it manually by putting this file (with both lines) into your project. Possibly, you have to check the final jar that only your ScriptEngineFactory is there. 

With maven, you can tell it to not forbid this file from the dependencies (so your file is used only). A proper solution would be a mojo that merges the javax.script.ScriptEngineFactory entries.
An even better solution would be if the JSR223 read files from a directory in the jar (e.g. META-INF/services/javax.script.ScriptEngineFactory/*)

Hope this helps,
Johannes
History
Date User Action Args
2011-08-17 01:42:29j13rsetmessageid: <1313545349.15.0.976504325324.issue1485@psf.upfronthosting.co.za>
2011-08-17 01:42:29j13rsetrecipients: + j13r, zyasoft, heuermh
2011-08-17 01:42:29j13rlinkissue1485 messages
2011-08-17 01:42:28j13rcreate