Ignore dependency jars on dist task

256 views Asked by At

I have a Play 2.3.x app that consists of some subprojects, and I use dist to generate a zip package of the full application.

The problem is that this package is too big, because it includes every dependency needed for the app to run (ex: scala, play libs, db driver(s), etc), and takes a lot of time to upload to the server.

I was wondering: it is possible to tell dist task to ignore some of those jars and don't include them in the generated zip file? The idea was to have those dependencies on the server and a custom start script to add all those deps to the classpath, and only deploy a smaller zip with only my code/assets jars.

Is this possible?

1

There are 1 answers

3
Lykathia On BEST ANSWER

The dist task comes from sbt-native-packager. Version 0.7.4 is used in the Play 2.3 lineage.

If you run sbt show universal:mappings you will get output of all the currently included things in your project. So by modifying the mappings key you can start to (carefully) filter away whatever you desire.

EDIT: As Muki points out in the comments, here is a direct link to the relevant documentation.