Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use maven bundle plugin to exclude package out of bundle

i have a bundle that uses maven-jaxb2-plugin to generate all classes to target/generated/src/main/java. Then i use maven bundle plugin to create a bundle. It simply works.

Now, i want to exclude (remove) a generated package com.xxx.yyyy.common out of this bundle. So i use:

<Export-Package>
     !com.xxx.yyyy.common,com.xxx.*
</Export-Package>

But after having a bundle, that package is still there inside the bundle.

like image 944
David Avatar asked Oct 20 '25 14:10

David


1 Answers

I have made it works. Basically, we need to use a combination between <Export-Package> and <Private-Package>. Tell maven bundle plugin to not export this package and this package is not a private package --> that means we dont need to keep this package in the bundle

<Export-Package>!com.xxx.yyyy.common</Export-Package>
<Private-Package>!com.xxx.yyyy.common</Private-Package>
like image 156
David Avatar answered Oct 23 '25 07:10

David



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!