Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude unnecessary unmanaged dependencies from packaging?

I want to create a standalone version of my application and was wondering how i could exclude an unmanaged *.jar file to be packaged. It's the "mariaDB4j-2.0-SNAPSHOT.jar" file I solely use in tests which is about 56MB huge.

I tried to put the jar file into a custom directory 'test/lib'. Unfortunately, this did not exclude mariaDB4j from packaging.

unmanagedBase <<= baseDirectory { base => base / "test/lib" }

unmanagedJars in Test <<= unmanagedBase  map { base => (base ** "mariaDB4j-2.0-SNAPSHOT.jar").classpath }

Any thoughts on this?

Cheers Oliver

like image 660
OliverKK Avatar asked Mar 06 '14 16:03

OliverKK


1 Answers

I think you want to add to the testing classpath.

Two things:

  1. You can check out what's on the classpath using show test:fullClasspath to make sure your jar is on there. Using inspect test:fullClasspath will show you what the dependencies used for testing are.
  2. I think you can directly add your jar to the classpath via:

    fullClasspath in Test += Attributed.blank(baseDirectory.value / "test/lib/mariaDB4j-2.0-SNAPSHOT")

Hope that helps!

like image 176
jsuereth Avatar answered Sep 30 '22 17:09

jsuereth