0

I want to deploy a Java program to AWS Lambda.

Unfortunately my packaged app with all dependencies is over the limit (50 MB).

My build and dependencies are managed by Maven.

Is there a way to configure a Maven build so that packing of the dependencies is deferred, and dependencies are automatically downloaded at application start-up time in the run-time JVM?

Alex R
  • 10,320
  • 12
  • 76
  • 145
  • 2
    Your question makes no sense. When you have the final JAR, Maven doesn't exist anymore. A JAR could have been build by whatever build tool there is, even by hand. You should reduce the number of libraries you have, that's the only solution. – Tunaki Jan 26 '16 at 13:52
  • 1
    Never used AWS Lambda, but they might have some protection against downloading random runnable things from the internet. Easier solution might be run proguard (http://proguard.sourceforge.net/) on your application, removing unneeded classes and methods (do not enable obfuscation, just configure it to produce minimal jar) and upload resulting, stripped jar with all dependencies embedded. – Artur Biesiadowski Jan 26 '16 at 13:58
  • Maven is a **build** automation tool, maybe you should review your dependencies and see if there isn't things that already are in the server or if there are repeated things – Diogo Calazans Jan 26 '16 at 13:59

1 Answers1

0

I would suggest you go look at this question here it will allow you to analyse your dependencies for those that are unused, you should be able to trim the size of your file package that way. In short the answers point you to the Maven Analysis tool

Community
  • 1
  • 1
Kevin D
  • 3,484
  • 1
  • 17
  • 37