heroku / heroku-sbt-plugin

An sbt plugin for deploying Heroku Scala applications
MIT License
0 stars 0 forks source link

sbt-heroku adds jQuery to the classpath #24

Closed vmunier closed 9 years ago

vmunier commented 9 years ago

Hello,

It looks like sbt-heroku adds jQuery to the classpath.

I came across the issue while using Scala.js with jQuery.

How to reproduce:

[error] (compile:scalaJSPreLinkClasspath) org.scalajs.core.tools.classpath.JSLibResolveException: Some references to JS libraries could not be resolved:
[error] - Ambiguous reference to a JS library: jquery.js
[error]   Possible paths found on the classpath:
[error]   - scala/tools/nsc/doc/html/resource/lib/jquery.js
[error]   - META-INF/resources/webjars/jquery/2.1.3/jquery.js
[error]   originating from: root:compile

Ambiguous reference to a JS library: jquery.js because there are two jquery.js, one coming from the scalajs-jquery library (as expected), another one coming from sbt-heroku.

Do you know why sbt-heroku adds jQuery to the classpath?

jkutner commented 9 years ago

I'm not sure what's putting that on the path, but it must be a dependency. Here's the graph:

[info]   +-com.heroku.sdk:heroku-deploy:0.5.3
[info]     +-com.fasterxml.jackson.core:jackson-core:2.3.0
[info]     +-com.fasterxml.jackson.core:jackson-databind:2.3.0
[info]     | +-com.fasterxml.jackson.core:jackson-annotations:2.3.0
[info]     | +-com.fasterxml.jackson.core:jackson-core:2.3.0
[info]     |
[info]     +-commons-io:commons-io:2.4
[info]     +-org.apache.commons:commons-compress:1.5
[info]     | +-org.tukaani:xz:1.2
[info]     |
[info]     +-org.apache.commons:commons-lang3:3.3.2
[info]     +-org.apache.httpcomponents:httpclient:4.4
[info]     | +-commons-codec:commons-codec:1.9
[info]     | +-commons-logging:commons-logging:1.2
[info]     | +-org.apache.httpcomponents:httpcore:4.4
[info]     |
[info]     +-org.eclipse.jgit:org.eclipse.jgit:3.6.2.201501210735-r
[info]       +-com.googlecode.javaewah:JavaEWAH:0.7.9
[info]       +-com.jcraft:jsch:0.1.50
[info]       +-org.apache.httpcomponents:httpclient:4.1.3 (evicted by: 4.4)
[info]       +-org.apache.httpcomponents:httpclient:4.4
[info]         +-commons-codec:commons-codec:1.9
[info]         +-commons-logging:commons-logging:1.2
[info]         +-org.apache.httpcomponents:httpcore:4.4

Mostly likely culprit would be jackson i guess. I'll investigate.

jkutner commented 9 years ago

The problem seems to be here in HerokuPlugin:

libraryDependencies <+= scalaVersion("org.scala-lang" % "scala-compiler" % _ ),

I'm pulling that in to enable the Scala console on Heroku. It would be pretty easy to exclude, but i'm not sure of the best way and it would prevent the console from working on Heroku.

jkutner commented 9 years ago

So this is really annoying. Why does the scala-compiler jar include docs??

$ jar tf scala-compiler-2.11.7.jar | grep jquery
scala/tools/nsc/doc/html/resource/lib/jquery-ui.js
scala/tools/nsc/doc/html/resource/lib/jquery.js
scala/tools/nsc/doc/html/resource/lib/jquery.layout.js
vmunier commented 9 years ago

:+1: Thank you.

jkutner commented 9 years ago

@vmunier i just need to run CI and few integration tests and i'll push out 0.5.3.1 with the fix. thanks for reporting!

jkutner commented 9 years ago

https://bintray.com/heroku/sbt-plugins/sbt-heroku/0.5.3.1/view