JSR223 ScriptEngineManager cannot find both jython and jruby ScriptEngines when 
using maven assembly plugin
-----------------------------------------------------------------------------------------------------------

                 Key: JRUBY-4057
                 URL: http://jira.codehaus.org/browse/JRUBY-4057
             Project: JRuby
          Issue Type: Bug
          Components: Embedding
    Affects Versions: JRuby 1.4.0RC1
         Environment: $ java -version
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)

$ mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 14:16:01-0500)
            Reporter: Michael Heuer
         Attachments: jruby-jsr223.tar.gz

See attached example maven project.

If both jruby and jython are enabled using runtime dependencies*

pom.xml:
  <dependencies>
    <dependency>
      <groupId>org.jruby</groupId>
      <artifactId>jruby</artifactId>
      <version>1.4.0RC1</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.python</groupId>
      <artifactId>jython</artifactId>
      <version>2.5.1</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>

then the jar-with-dependencies assembly jar will fail to register both 
ScriptEngine implementations

$ mvn assembly:assembly
$ java -jar target/example-1.0-SNAPSHOT-jar-with-dependencies.jar
could not find jruby engine

whereas creating an explicit classpath works fine

$ java -classpath 
"jython-2.5.1.jar;jruby-1.4.0RC1.jar;target/example-1.0-SNAPSHOT.jar" 
example.Jsr223Example
ok

It appears the JSR223 mechanism cannot handle multiple copies of its metadata 
in example-1.0-SNAPSHOT-jar-with-dependencies.jar.

$ jar tvf target/example-1.0-SNAPSHOT-jar-with-dependencies.jar | grep 
javax.script.ScriptEngineFactory
    42 Wed Sep 16 13:39:46 CDT 2009 
META-INF/services/javax.script.ScriptEngineFactory
    40 Sat Sep 26 13:48:04 CDT 2009 
META-INF/services/javax.script.ScriptEngineFactory


* - please note a jython-2.5.1.jar artifact is not yet available on maven 
central repo, will have to be installed manually

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to