Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sbt-fork-run-plugin breaks SBT #4839

Closed
jkutner opened this issue Jul 12, 2015 · 15 comments
Closed

sbt-fork-run-plugin breaks SBT #4839

jkutner opened this issue Jul 12, 2015 · 15 comments

Comments

@jkutner
Copy link
Contributor

jkutner commented Jul 12, 2015

Including sbt-fork-run-plugin in a project results in this error:

$ sbt update
....

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.typesafe.sbtrc#client-2-11;0.3.1: not found
[warn]  :: com.typesafe.sbtrc#actor-client-2-11;0.3.1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Unresolved dependencies path:
[warn]      com.typesafe.sbtrc:client-2-11:0.3.1
[warn]        +- com.typesafe.play:fork-run-protocol_2.11:2.3.9 ((play.sbt.forkrun.PlayForkRun) PlayForkRun.scala#L49)
[warn]        +- com.typesafe.play:fork-run_2.11:2.3.9 ((play.sbt.forkrun.PlayForkRun) PlayForkRun.scala#L49)
[warn]        +- computer-database-scala:computer-database-scala_2.11:0.0.1-SNAPSHOT
[warn]      com.typesafe.sbtrc:actor-client-2-11:0.3.1
[warn]        +- com.typesafe.play:fork-run_2.11:2.3.9 ((play.sbt.forkrun.PlayForkRun) PlayForkRun.scala#L49)
[warn]        +- computer-database-scala:computer-database-scala_2.11:0.0.1-SNAPSHOT
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.sbtrc#client-2-11;0.3.1: not found
[error] unresolved dependency: com.typesafe.sbtrc#actor-client-2-11;0.3.1: not found
[error] Total time: 31 s, completed Jun 23, 2015 1:25:12 AM
[computer-database-scala] $ show fullResolvers
[info] ArrayBuffer(Raw(ProjectResolver(inter-project, mapped: )), FileRepository(local,FileConfiguration(true,None),Patterns(ivyPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), artifactPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]), isMavenCompatible=false, descriptorOptional=false, skipConsistencyCheck=false)), public: https://repo1.maven.org/maven2/, Typesafe Releases Repository: https://repo.typesafe.com/typesafe/releases/)
[success] Total time: 0 s, completed Jun 23, 2015 1:26:26 AM
[computer-database-scala] $ exit

Here's a project that reproduces. Running sbt stage against this application has a different result than activator stage:
https://github.com/gifman009/Licenta

More information in this thread:
https://groups.google.com/forum/#!topic/play-framework/RLSPwvOqBIE

Other related issues:
sbt/sbt#2054
https://github.com/typesafehub/activator/issues/979

I would like to see sbt-fork-run-plugin completely disable itself if not running under Activator. But I'm not sure how to code this up. Could it check for the "development" env?

Aside from the dependency resolution, I have some big concerns that stuff like this will break CI, PaaS, and even Production deployment, where sbt and Activator are used in intended to run in the foreground.

@cchantep
Copy link
Member

Hi @jkutner, please first ask such question on the MailingList, rather than on this issue tracker (dedicated to confirmed issue). Best regards.

@jkutner
Copy link
Contributor Author

jkutner commented Jul 13, 2015

@cchantep I brought this up already: https://groups.google.com/d/topic/play-framework/RLSPwvOqBIE/discussion

Why did you close this?

@cchantep
Copy link
Member

According the contribution guidelines, until there is a confirmed issue, there is no need to have ticket on this issue tracker. Best regards.

@jkutner
Copy link
Contributor Author

jkutner commented Jul 13, 2015

@cchantep I've created another thread: https://groups.google.com/forum/#!topic/play-framework/XOGhUpZIDFw. The reproducible example is linked above.

@richdougherty
Copy link
Member

@jkutner, Here's something to try.

Activator sometimes creates .sbt files with extra build settings. I noticed some of these files in the project directory of https://github.com/gifman009/Licenta. Maybe the settings are out of date. Can you try removing them?

Activator shims to remove: play-fork-run.sbt, sbt-ui.sbt.

I also noticed some lock files that you can probably remove too: .sbtserver, .sbtserver.lock.

@richdougherty
Copy link
Member

I'm going to open this issue because it has been confirmed.

@richdougherty richdougherty reopened this Jul 13, 2015
@jkutner
Copy link
Contributor Author

jkutner commented Jul 14, 2015

@richdougherty Yes, this file is created by Activator, and it works fine with Activator. But when it is used with SBT it fails with the error above.

Here is where it's added:
https://github.com/typesafehub/activator/blob/7618e81feb658eb0904ae471d06c08edf269753f/ui/app/assets/services/sbt/configuration.js#L26

I work for Heroku and we have had numerous reports from users that generate an app with Activator, and deploy it to Heroku. Heroku only uses SBT, and this causes the failure. The people that are encountering the error have no idea what has caused the problem because they never added the file.

Is there a particular resolver that could be added to the template for the play-fork-run.sbt file that would ensure it works with SBT?

Thanks!

@richdougherty
Copy link
Member

@jkutner, I've pinged the Activator team to ask for some help on this one.

To answer your question about resolvers, it looks like the JARs can be found here: https://dl.bintray.com/typesafe/ivy-releases/com.typesafe.sbtrc/. Maybe the following resolver would work:

resolvers += "Typesafe Bintray Ivy releases" at "https://dl.bintray.com/typesafe/ivy-releases"

@dwijnand
Copy link
Member

I think the sbt team would rather the typesafe.com URL be used, rather than the underlying Bintray URL:

resolvers += "Typesafe Ivy releases" at "https://repo.typesafe.com/typesafe/ivy-releases"

@jkutner
Copy link
Contributor Author

jkutner commented Jul 14, 2015

Neither of those resolvers solves the problem. The com.typesafe.sbtrc:client-2-11:0.3.1 and com.typesafe.sbtrc:actor-client-2-11:0.3.1 are still unresolved.

I think there is something deeper going on here. Unless...is there another resolver that Activator uses to get these dependencies and SBT does not have by default?

@jkutner
Copy link
Contributor Author

jkutner commented Jul 14, 2015

I've found that adding this resolve to the project's build.sbt fixes the problem:

resolvers += Resolver.url("Typesafe Ivy releases", url("https://repo.typesafe.com/typesafe/ivy-releases"))(Resolver.ivyStylePatterns)

So what is going on here? Shouldn't that be unnecessary? It seems that when including the sbt-fork-run-plugin in the Play app, it should not be necessary to add resolvers.

watawuwu pushed a commit to watawuwu/seien-backend that referenced this issue Aug 12, 2015
watawuwu pushed a commit to watawuwu/seien-backend that referenced this issue Aug 12, 2015
cmacher pushed a commit to openforce/spark-mllib-scala-play that referenced this issue Nov 27, 2015
raytong82 added a commit to raytong82/play-scala-intro that referenced this issue Feb 9, 2016
raytong82 added a commit to raytong82/play-scala-intro that referenced this issue Feb 9, 2016
@alonsoir
Copy link

alonsoir commented Mar 9, 2016

Hi, i have the same problem, i just added this line as jkutner said:

resolvers += Resolver.url("Typesafe Ivy releases", url("https://repo.typesafe.com/typesafe/ivy-releases"))(Resolver.ivyStylePatterns)

to build.sbt file and it works!

I guess that this is an activator issue, isn't ?

@wsargent
Copy link
Member

wsargent commented Aug 6, 2016

Yeah, this is activator. Closing.

@wsargent wsargent closed this as completed Aug 6, 2016
@jkutner
Copy link
Contributor Author

jkutner commented Aug 7, 2016

You can punt this, but it still affects adoption of Play Framework because so many people run into it.
https://github.com/typesafehub/activator/issues/1036
https://github.com/typesafehub/activator/issues/1057

@wsargent
Copy link
Member

wsargent commented Aug 8, 2016

@jkutner I'm aware. It's not something the Play team can fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants