Plugins to disable when only accessing databases?

26 views
Skip to first unread message

Koen De Groote

unread,
Jul 16, 2017, 8:29:45 AM7/16/17
to Play Framework
I'm working on a project where I'm really only accessing databases.

During compilation, I saw sbt resolved htmlunit and other stuff that made me think "I don't need this in this project"

Is there a comprehensive list somewhere with things I could disable?

I've only found 
.disablePlugins(plugins.JUnitXmlReportPlugin)

And I don't really know what the others are called. I'm only using the framework to access an SQL database, so I'm using Ebean, cache, jdbc, WS and filters, but that's it really.
I wonder what I could disable and if it would result in a lighter application?

Marcos Pereira

unread,
Jul 21, 2017, 4:07:04 PM7/21/17
to play-fr...@googlegroups.com
sbt-dependency-graph can help you here:

https://github.com/jrudolph/sbt-dependency-graph

You can better see your dependency tree and then exclude what you don't need.

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/8861a8a0-54e0-4dbd-a0d4-35036c3a288f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Marcos Pereira
Software Engineer, Lightbend.com

Will Sargent

unread,
Jul 21, 2017, 4:38:18 PM7/21/17
to play-fr...@googlegroups.com
You can also use proguard to cut down the size of your deployable artifact:


Adam Lane

unread,
Jul 21, 2017, 8:38:08 PM7/21/17
to Play Framework
Wow...proguard looks like an amazing suggestion for obtaining a lighter application!   If it really does what it says it does, this suggestion seems like it could provide real value to all production users of play and perhaps should even have a play documentation section in the "deploy to production" area.

I tried out sbt-proguard (https://github.com/sbt/sbt-proguard) and it is not obvious how to set it up for play.
Would anyone be able to provide default merge settings for out of the box play 2.6.x (i see some apache and ws errors I am not sure the right way to deal with). And then how do we get the output result of proguard back into the dist zip?

Here is what I tried to use to just get "sbt proguard:proguard" working (based on this https://github.com/sbt/sbt-proguard/issues/12) but I suspect some of the discards are wrong and I have no idea what to do with the output files to get something like "dist zip" would do but "optimized".
proguardSettings

ProguardKeys.options in Proguard ++= Seq("-dontnote", "-dontwarn", "-ignorewarnings", "-dontobfuscate")

ProguardKeys.proguardVersion in Proguard := "5.3.3"

inConfig(Proguard)(javaOptions in ProguardKeys.proguard := Seq("-Xmx2g"))

ProguardKeys.merge in Proguard := true

ProguardKeys.options in Proguard += ProguardOptions.keepMain("play.core.server.ProdServerStart")

ProguardKeys.mergeStrategies in Proguard += ProguardMerge.append("reference.conf")

ProguardKeys.mergeStrategies in Proguard += ProguardMerge.append("play/reference-overrides.conf")

ProguardKeys.mergeStrategies in Proguard += ProguardMerge.discard("LICENSE")

ProguardKeys.mergeStrategies in Proguard += ProguardMerge.discard("logback-test.xml")

ProguardKeys.mergeStrategies in Proguard += ProguardMerge.discard("logback.xml")

ProguardKeys.mergeStrategies in Proguard += ProguardMerge.discard("META-INF/*".r)


ProguardKeys.mergeStrategies in Proguard += ProguardMerge.discard("org/apache/commons/logging/*".r)

ProguardKeys.mergeStrategies in Proguard += ProguardMerge.discard("org/slf4j/impl/*".r)

ProguardKeys.mergeStrategies in Proguard += ProguardMerge.discard("play/api/libs/ws/package.class")

ProguardKeys.mergeStrategies in Proguard += ProguardMerge.discard("play/api/libs/ws/package$.class")



On Friday, July 21, 2017 at 1:38:18 PM UTC-7, Will Sargent wrote:
You can also use proguard to cut down the size of your deployable artifact:

On Fri, Jul 21, 2017 at 1:06 PM, Marcos Pereira <marcos....@lightbend.com> wrote:
sbt-dependency-graph can help you here:

https://github.com/jrudolph/sbt-dependency-graph

You can better see your dependency tree and then exclude what you don't need.

Best.
On Sun, Jul 16, 2017 at 9:29 AM, Koen De Groote <kdg...@gmail.com> wrote:
I'm working on a project where I'm really only accessing databases.

During compilation, I saw sbt resolved htmlunit and other stuff that made me think "I don't need this in this project"

Is there a comprehensive list somewhere with things I could disable?

I've only found 
.disablePlugins(plugins.JUnitXmlReportPlugin)

And I don't really know what the others are called. I'm only using the framework to access an SQL database, so I'm using Ebean, cache, jdbc, WS and filters, but that's it really.
I wonder what I could disable and if it would result in a lighter application?

--
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.
--
Marcos Pereira
Software Engineer, Lightbend.com

--
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.
Reply all
Reply to author
Forward
0 new messages