[Play 2.3.0, scala] Disable sbt-web and related plugins

805 views
Skip to first unread message

Joheinz

unread,
Jul 12, 2014, 10:01:49 AM7/12/14
to play-fr...@googlegroups.com
Hi *,

I would like to slim down play to have a strict server side framework and try to disable the sbtweb related plugins, like this in build.sbt

lazy val root = (project in file("."))
  .disablePlugins(SbtWeb, SbtJsTask, SbtTwirl, SbtWebDriver, SbtJsEngine)
  .enablePlugins(PlayScala)

However this fails miserably (and other combinations as well, in fact trying to disable any plugin results in the same error):

[error] Failed to sort List(play.PlayScala, sbt.plugins.CorePlugin, sbt.plugins.IvyPlugin, play.Play, sbt.plugins.JvmPlugin, sbt.plugins.JUnitXmlReportPlugin) topologically

upon starting sbt.

Has anyone succeeded in disabling some of the plugins?

Thanks Markus


alex s

unread,
Jul 12, 2014, 12:30:19 PM7/12/14
to play-fr...@googlegroups.com

суббота, 12 июля 2014 г., 18:01:49 UTC+4 пользователь Markus Klink написал:

I would like to slim down play to have a strict server side framework and try to disable the sbtweb related plugins, like this in build.sbt

Fun but pointless exercise. You aren't paying anything for this features in production (in terms of cpu/ram/disk usage) and you must still download the entire framework for development.

[error] Failed to sort List(play.PlayScala, sbt.plugins.CorePlugin, sbt.plugins.IvyPlugin, play.Play, sbt.plugins.JvmPlugin, sbt.plugins.JUnitXmlReportPlugin) topologically

Christopher Hunt

unread,
Jul 12, 2014, 6:07:17 PM7/12/14
to play-fr...@googlegroups.com
Simply do not include the sbt-web plugins in your plugins.sbt.

Joheinz

unread,
Jul 12, 2014, 6:40:08 PM7/12/14
to play-fr...@googlegroups.com
Hi Christopher,

I do not understand what you mean. The only thing in my plugins.sbt is the sbt-play plugin and that seems to require all the other plugins, which I can't disable.

Markus


2014-07-13 0:07 GMT+02:00 Christopher Hunt <christop...@typesafe.com>:
Simply do not include the sbt-web plugins in your plugins.sbt.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christopher Hunt

unread,
Jul 13, 2014, 6:17:19 AM7/13/14
to play-fr...@googlegroups.com
Play will bring in sbt-web, webdriver and js-engine in the context of front end dev plugins. There is nothing else and no real overhead in having brought them in. What's your goal? Faster build times?
You received this message because you are subscribed to a topic in the Google Groups "play-framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/play-framework/Ha9XYOp4DZ8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to play-framewor...@googlegroups.com.

Joheinz

unread,
Jul 13, 2014, 8:30:10 AM7/13/14
to play-fr...@googlegroups.com
Actually typesafe had this small repository https://github.com/typesafehub/play2-mini and I resurrected it for educational purposes and adopted it to play 2.3.x
I just wondered if I could disable all the frontend plugins as a bonus if this is not possibe - never mind.
Markus

Rafik Salama

unread,
Nov 11, 2014, 9:52:58 AM11/11/14
to play-fr...@googlegroups.com
I'd like to do this as well. At the very least, I would like to be able to stop sbt-web from automatically creating a `public` and `app/assets` directories in my project when building.

Any guidance?

What's the point of splitting out web components into separate sbt plugins if they can't be disabled?

Rafik Salama

unread,
Nov 11, 2014, 9:58:07 AM11/11/14
to play-fr...@googlegroups.com
I was able to remove the folder generation by adding the following to my build.sbt:

sourceDirectory in Assets := (sourceDirectory in Compile).value

sourceDirectory in TestAssets := (sourceDirectory in Test).value

resourceDirectory in Assets := baseDirectory.value

Victor Mendiluce

unread,
Dec 26, 2014, 7:26:28 PM12/26/14
to play-fr...@googlegroups.com
I want to disable it too, having those empty folders is pointless and generates clutter. Using play in a shared library without the frontend plugins should be easier/cleaner.

naturallog

unread,
Dec 30, 2014, 10:19:55 PM12/30/14
to play-fr...@googlegroups.com
+1 for this.
We are using Play as a REST Server and would like a leaner experience without sbt-web* and twirl

virtualeyes

unread,
Oct 31, 2017, 7:30:06 PM10/31/17
to Play Framework
Is there really no way as of Play 2.6.6 to completely disable sbt-web? I don't care about production, it's more "death by a thousand cuts" in development with `web-assets:webJars` X number of subprojects pointlessly wasting time on every `compile`.

There should be a way to disable sbt-web entirely (or at least provide an option to opt-in disable it on `compile`).

Marcos Pereira

unread,
Nov 2, 2017, 6:49:50 PM11/2/17
to play-fr...@googlegroups.com
Take a look at https://github.com/futurice/minimal-play2

You can also explicitly disable plugins using sbt:


And you can disable `SbtJsTask` and `SbtWeb`.

Best.

--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/928f0c53-a48c-4de2-933f-5f90d8578a6d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Marcos Pereira
Software Engineer, Lightbend.com

virtualeyes

unread,
Nov 2, 2017, 7:00:35 PM11/2/17
to Play Framework
> And you can disable `SbtJsTask` and `SbtWeb`.

Thanks, apparently one cannot disable web plugins, that's the whole point of this 3+ year old thread.

Any attempt to disable an sbt-web related plugin results in the following exception (on 2.6.6) :
Failed to sort List(....)
[error]     at sbt.AutoPluginException.withPrefix(Plugins.scala:131)
[error]     at sbt.internal.Load$.translateAutoPluginException(Load.scala:974)
[error]     at sbt.internal.Load$.finalizeProject$1(Load.scala:863)
[error]     at sbt.internal.Load$.$anonfun$loadTransitive$10(Load.scala:915)
[error]     at sbt.internal.Load$.timed(Load.scala:1343)
[error]     at sbt.internal.Load$.loadTransitive(Load.scala:915)
[error]     at sbt.internal.Load$.loadProjects$1(Load.scala:714)
[error]     at sbt.internal.Load$.$anonfun$loadUnit$10(Load.scala:717)
[error]     at sbt.internal.Load$.timed(Load.scala:1343)
[error]     at sbt.internal.Load$.$anonfun$loadUnit$1(Load.scala:717)
[error]     at sbt.internal.Load$.timed(Load.scala:1343)
[error]     at sbt.internal.Load$.loadUnit(Load.scala:677)
[error]     at sbt.internal.Load$.$anonfun$builtinLoader$4(Load.scala:477)
[error]     at sbt.internal.BuildLoader$.$anonfun$componentLoader$5(BuildLoader.scala:154)
[error]     at sbt.internal.BuildLoader.apply(BuildLoader.scala:219)
....



On Thursday, November 2, 2017 at 6:49:50 PM UTC-4, Marcos Pereira wrote:
Take a look at https://github.com/futurice/minimal-play2

You can also explicitly disable plugins using sbt:


And you can disable `SbtJsTask` and `SbtWeb`.

Best.
On Tue, Oct 31, 2017 at 7:30 PM, virtualeyes <sit...@gmail.com> wrote:
Is there really no way as of Play 2.6.6 to completely disable sbt-web? I don't care about production, it's more "death by a thousand cuts" in development with `web-assets:webJars` X number of subprojects pointlessly wasting time on every `compile`.

There should be a way to disable sbt-web entirely (or at least provide an option to opt-in disable it on `compile`).


On Saturday, July 12, 2014 at 10:01:49 AM UTC-4, Markus Klink wrote:
Hi *,

I would like to slim down play to have a strict server side framework and try to disable the sbtweb related plugins, like this in build.sbt

lazy val root = (project in file("."))
  .disablePlugins(SbtWeb, SbtJsTask, SbtTwirl, SbtWebDriver, SbtJsEngine)
  .enablePlugins(PlayScala)

However this fails miserably (and other combinations as well, in fact trying to disable any plugin results in the same error):

[error] Failed to sort List(play.PlayScala, sbt.plugins.CorePlugin, sbt.plugins.IvyPlugin, play.Play, sbt.plugins.JvmPlugin, sbt.plugins.JUnitXmlReportPlugin) topologically

upon starting sbt.

Has anyone succeeded in disabling some of the plugins?

Thanks Markus


--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.

virtualeyes

unread,
Nov 2, 2017, 7:06:00 PM11/2/17
to Play Framework
Also, `minimal-play2` does nothing wrt to stripping out modules, just provides a base giter8-style template to work off of, there's nothing "minimal" about it.



On Thursday, November 2, 2017 at 6:49:50 PM UTC-4, Marcos Pereira wrote:
Take a look at https://github.com/futurice/minimal-play2

You can also explicitly disable plugins using sbt:


And you can disable `SbtJsTask` and `SbtWeb`.

Best.
On Tue, Oct 31, 2017 at 7:30 PM, virtualeyes <sit...@gmail.com> wrote:
Is there really no way as of Play 2.6.6 to completely disable sbt-web? I don't care about production, it's more "death by a thousand cuts" in development with `web-assets:webJars` X number of subprojects pointlessly wasting time on every `compile`.

There should be a way to disable sbt-web entirely (or at least provide an option to opt-in disable it on `compile`).


On Saturday, July 12, 2014 at 10:01:49 AM UTC-4, Markus Klink wrote:
Hi *,

I would like to slim down play to have a strict server side framework and try to disable the sbtweb related plugins, like this in build.sbt

lazy val root = (project in file("."))
  .disablePlugins(SbtWeb, SbtJsTask, SbtTwirl, SbtWebDriver, SbtJsEngine)
  .enablePlugins(PlayScala)

However this fails miserably (and other combinations as well, in fact trying to disable any plugin results in the same error):

[error] Failed to sort List(play.PlayScala, sbt.plugins.CorePlugin, sbt.plugins.IvyPlugin, play.Play, sbt.plugins.JvmPlugin, sbt.plugins.JUnitXmlReportPlugin) topologically

upon starting sbt.

Has anyone succeeded in disabling some of the plugins?

Thanks Markus


--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.

Greg Methvin

unread,
Nov 2, 2017, 7:32:55 PM11/2/17
to play-framework
The main problem is that PlaySettings.defaultSettings uses keys from WebKeys: https://github.com/playframework/playframework/blob/f014439ee696a56baa14b75591e5c96cc3500718/framework/src/sbt-plugin/src/main/scala/play/sbt/PlaySettings.scala#L151

If we can separate the sbt-web components out, we could create a separate sbt plugin that uses different settings. I totally agree this should be possible.


To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/f4b59ba8-a5c8-40b9-bc11-bbceac5ea18f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Greg Methvin
Tech Lead - Play Framework

virtualeyes

unread,
Nov 2, 2017, 9:39:37 PM11/2/17
to Play Framework
> If we can separate the sbt-web components out, we could create a separate sbt plugin that uses different settings. I totally agree this should be possible.

That would be fantastic, it's "death by a thousand cuts" right now with multi-subproject builds incurring overhead of sbt-web for each subproject.

Anything that can be done to improve the iterative development experience is a big win for the framework.

Marcos Pereira

unread,
Nov 2, 2017, 10:23:55 PM11/2/17
to play-fr...@googlegroups.com
Hum, okay, just saw the whole thread now.

Well, I think what you can do right now is to enable very specific plugins without enabling PlayScala or PlayJava, something like:

lazy val root = (project in file("."))
  .enablePlugins(SbtTwirl, RoutesCompiler)
  .settings(
    ...
  )

Of course, because of that, you lose PlayLayoutPlugin, but you can either use the default sbt project layout or just copy the configurations from here:


HTH.

To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/b1088092-1819-441f-929f-947a6f8f217a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

virtualeyes

unread,
Nov 3, 2017, 9:22:48 AM11/3/17
to Play Framework
As an exercise, sure, that might work, but wouldn't be suitable for real world use since you would have to also copy *defaultSettings*, omitting the sbt-entries

Providing a PlayMinimal autoplugin would a nice enhancement. Maybe there could be a bare minimum plugin (no sbt-web, no twirl, no forms) on top of which one could *enablePlugin(...)*

I suspect many play users are shuffling around JSON and have no need for the UI features play provides.

Marcos Pereira

unread,
Nov 3, 2017, 11:27:35 AM11/3/17
to play-fr...@googlegroups.com
Yes, I agree.

On top of that, we can also review the requirements between plugins. I can't see why `PlayLayoutPlugin` depends on `Play` plugin.

Do you mind opening an issue?

Best.

To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/625d3bec-1850-4175-a87b-71d35250291f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

virtualeyes

unread,
Nov 3, 2017, 12:55:09 PM11/3/17
to Play Framework
> Do you mind opening an issue?

Done.
Reply all
Reply to author
Forward
0 new messages