Dan Gravell
Dan Gravell

Reputation: 8275

Is it acceptable to use optional package resolution for build time only dependencies?

I have a build time dependency on the package javax.annotation[2.0,3). That's because I use Guava and the @Nullable annotation in some Predicate implementations.

These, being annotations, are just build time dependencies, so is it acceptable to mark them as optional, and not include them in my run time distribution (to save space where possible)?

Import-Package: javax.annotation;resolution:=optional;version="[2.0,3)"

Upvotes: 1

Views: 106

Answers (1)

Christian Schneider
Christian Schneider

Reputation: 19626

That should work fine. You can alternatively completely omit the import.

Upvotes: 2

Related Questions