Skip to content

yuicompressor depends on a modified version of Rhino, which causes dependency confusion #161

@timothykim

Description

@timothykim

Steps to produce:

  1. Create a java project that depends on yuicompressor AND Rhino
  2. Write any code that depends on any of the modified classes in this package: https://github.com/yui/yuicompressor/tree/master/src/org/mozilla/javascript
  3. You'll either get a java.lang.StringIndexOutOfBoundsException or MethodNothFoundException or something simliar.

Core of the problem is that yuicompressor leverages on a modified version of Rhino but keeps the namespace the same. So if you have a project that depends on yuicompressor AND Rhino, you are going to have namespace collision.

A crude fix would be to embed the entire Rhino library into the project and change the namespace so that it no longer conflicts with any other packages that depend on Rhino.

Here's a fork of yuicompressor that has the crude fix: https://github.com/timothy-kim/yuicompressor

However, more elegant solution would be desirable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions