heroku / heroku-sbt-plugin

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

imported `HerokuPlugin' is permanently hidden by definition of object HerokuPlugin #17

Closed jgrape closed 9 years ago

jgrape commented 9 years ago

Recently I have started to get warnings from the normal git deploy that refers to the HerokuPlugin.

luftmackan:~/Projects/signup> git push heroku master
Fetching repository, done.
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 414 bytes | 0 bytes/s, done.
Total 4 (delta 2), reused 0 (delta 0)

-----> Play 2.x - Scala app detected
-----> Installing OpenJDK 1.7... done
-----> Running: sbt compile stage
       Picked up JAVA_TOOL_OPTIONS: -Djava.net.preferIPv4Stack=true
       [info] Loading global plugins from /tmp/scala_buildpack_build_dir/.sbt_home/plugins
       [info] Loading project definition from /tmp/scala_buildpack_build_dir/project
       /tmp/scala_buildpack_build_dir/build.sbt:0: warning: imported `HerokuPlugin' is permanently hidden by definition of object HerokuPlugin
       import _root_.sbt.plugins.IvyPlugin, _root_.sbt.plugins.JvmPlugin, _root_.sbt.plugins.CorePlugin, _root_.sbt.plugins.JUnitXmlReportPlugin, _root_.play.Play, _root_.play.PlayJava, _root_.play.PlayScala, _root_.play.twirl.sbt.SbtTwirl, _root_.com.typesafe.sbt.jse.SbtJsEngine, _root_.com.typesafe.sbt.jse.SbtJsTask, _root_.com.typesafe.sbt.web.SbtWeb, _root_.com.typesafe.sbt.webdriver.SbtWebDriver, _root_.com.typesafe.sbt.less.SbtLess, _root_.com.typesafe.sbt.rjs.SbtRjs, _root_.com.heroku.sbt.HerokuPlugin                                                                                                                                                                        

The warning is repeated multiple times. The app is built and deployed and seems to work alright, but the warnings don't look good at all.

I'm using the HerokuPlugin to deploy to a staging environment from Jenkins and there the logs look just fine:

Started by an SCM change
Building in workspace /var/lib/jenkins/jobs/SignUp/workspace
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository

[... lots of stuff removed...]

[info] Packaging /var/lib/jenkins/jobs/SignUp/workspace/target/scala-2.11/signup_2.11-1.0-SNAPSHOT.jar ...
[info] Done packaging.
[info] Packaging /var/lib/jenkins/jobs/SignUp/workspace/target/signup-1.0-SNAPSHOT-assets.jar ...
[info] Done packaging.
[success] Total time: 22 s, completed Mar 19, 2015 9:38:59 AM
[info] ---> Packaging application...
[info]      - app: signup-ci-test
[info]      - including: target/universal/stage/
[info]      - installing: OpenJDK 1.8
[info] ---> Creating slug...
[info]      - file: target/heroku/slug.tgz
[info]      - size: 115MB
[info] ---> Uploading slug...
[info]      - stack: cedar-14
[info]      - process types: [web]
[info] ---> Releasing...
[info]      - version: 55
[success] Total time: 41 s, completed Mar 19, 2015 9:39:40 AM
Build step 'Build using sbt' changed build result to SUCCESS
Recording test results
Finished: SUCCESS

My plugins.sbt:

// Comment to get more information during initialization
logLevel := Level.Warn

// The Play plugin
resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releases/"

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.7")

// web plugins
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.4")

addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.7")

// Heroku plugin
resolvers += Resolver.url("heroku-sbt-plugin-heroku", url("http://dl.bintray.com/heroku/sbt-plugins"))(Resolver.ivyStylePatterns)

addSbtPlugin("com.heroku" % "sbt-heroku" % "0.3.5")
jgrape commented 9 years ago

Project source: https://github.com/crispab/signup

jgrape commented 9 years ago

The resolvers addition for the HerokuPlugin looked a bit old fashioned so I removed it from plugins.sbt, but that didn't change anything about the warnings.

jgrape commented 9 years ago

BTW, I get no such warnings when building locally. Never had.

jkutner commented 9 years ago

It looks like the class name of the sbt-heroku plugin (HerokuPlugin) is colliding with the buildpack's HerokuPlugin class (used when running git push). The two methods of deployment, sbt and git push, are not really intended to work together -- but there's not reason they can't.

I'll have to investigate if it will be better to fix this by renaming the sbt-heroku class or the buildpack's class.

In the meantime, the warnings when using git push and the buildpack should be safe to ignore. The only consequence may be a slightly slower build.

Thanks for reporting this.

jkutner commented 9 years ago

FYI https://github.com/heroku/heroku-buildpack-scala/commit/aced3007797d6d9ecd9ddd70ba3649f63a0bed6b

jgrape commented 9 years ago

+1