chrisdchristo / capsule-maven-plugin

Capsule Maven Plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could we exclude optional dependencies from a fat jar?

gitblit opened this issue · comments

Now that we have #28 working from the perspective of Maven packaging I've discovered that setting all my app dependencies as <scope>provided</scope> breaks runtime development within IntelliJ. :(

Would it be possible to have a setting to exclude <optional>true</optional> dependencies from the fat jar? Or maybe just automatically exclude those too? The <provided> scope works for Capsule generation but otherwise breaks development.

I suppose an alternative could be setting up Maven profiles. At best that would be double-maintenance of dependencies. Did you have any thoughts on excluding optionals?

ok done, see readme and v1.0.3

Hey, I assume this satisfies your needs? so I'll go ahead and close it.

@chrischristo your implementation is exactly what I asked for but it turns out that I didn't think it through.

I was trying to use optional instead of provided to make my IDE happy and achieve the lean fat jar that downloads it's non-module dependencies while embedding it's module dependencies. In your latest version, the optional=true jars are properly excluded from the Capsule but sadly they are not added to the dependencies-to-download list (which I did not specify, hence the I didn't think it through).

I was going to setup a new module in my project solely for building the Capsule and experiment with all the settings you've recently implemented to see if I could find some combination that suited my needs, but I have gotten side-tracked by work.

Did you try version 1.0.4? There was a bug related to that.