[ 
https://issues.apache.org/jira/browse/FELIX-6830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18109115#comment-18109115
 ] 

Paul Rütter commented on FELIX-6830:
------------------------------------

[~pzygielo] 

This isn't intentional. Your {{module-info.class}} sits in the default (root) 
package, which maven-bundle-plugin adds to {{{}Private-Package{}}}; bnd then 
copies the root package of every dependency on the classpath, and cdi-api / 
validation-api ship those XSDs at their jar root. That's what the {{copy … p=}} 
(empty package) lines show. Without {{module-info}} there's no root-package 
class, so it doesn't happen.

Workarounds until the fix ships:
 * *{{-donotcopy}} won't work* — bnd only applies it to {{-includeresource}} 
copies, not to {{{}Private-Package{}}}/{{{}Export-Package{}}} expansion, which 
is how these XSDs get in.
 * *Recommended:* don't commit {{{}module-info.java{}}}; let bnd generate the 
descriptor via {{-jpms-module-info}} ({{{}<_jpms-module-info/>{}}}). No class 
lands in the root package, so nothing alien is copied.
 * *Or* pin the packages explicitly so the default package is never auto-added, 
re-adding the descriptor as a resource:
<Private-Package>jakarta.mvc.*</Private-Package> 
<Export-Package>jakarta.mvc.*</Export-Package> 
<Include-Resource>\{maven-resources}, 
module-info.class=${project.build.outputDirectory}/module-info.class</Include-Resource>
 

A proper fix is in progress under FELIX-6830.

> m-b-p includes alien resources from dependencies when module-info is used
> -------------------------------------------------------------------------
>
>                 Key: FELIX-6830
>                 URL: https://issues.apache.org/jira/browse/FELIX-6830
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-6.0.0, maven-bundle-plugin-6.0.2
>            Reporter: Piotr Zygielo
>            Priority: Major
>
> [https://github.com/jakartaee/mvc/pull/73#issuecomment-2934163673]
> After module-info.java is added to the project, additional alien XSD files
> {{beans_1_0.xsd}}
> {{beans_1_1.xsd}}
> {{beans_2_0.xsd}}
> {{beans_3_0.xsd}}
> {{beans_4_0.xsd}}
> {{validation-configuration-1.0.xsd}}
> {{validation-configuration-1.1.xsd}}
> {{validation-configuration-2.0.xsd}}
> {{validation-configuration-3.0.xsd}}
> {{validation-configuration-3.1.xsd}}
> {{validation-mapping-1.0.xsd}}
> {{validation-mapping-1.1.xsd}}
> {{validation-mapping-2.0.xsd}}
> {{validation-mapping-3.0.xsd}}
> {{validation-mapping-3.1.xsd}}
> are being placed in final archive.
> Build difference
> - with {{module-info}} (additional copy-s):
> {{[DEBUG] copy d=Jar:dot s=Jar:. p=jakarta/mvc}}
> {{[DEBUG] copy d=Jar:dot s=Jar:. p=jakarta/mvc/binding}}
> {{[DEBUG] copy d=Jar:dot s=Jar:. p=jakarta/mvc/engine}}
> {{[DEBUG] copy d=Jar:dot s=Jar:. p=jakarta/mvc/event}}
> {{[DEBUG] copy d=Jar:dot s=Jar:. p=jakarta/mvc/form}}
> {{[DEBUG] copy d=Jar:dot s=Jar:. p=jakarta/mvc/locale}}
> {{[DEBUG] copy d=Jar:dot s=Jar:. p=jakarta/mvc/security}}
> {{[DEBUG] copy d=Jar:dot s=Jar:. p=}}
> {{[DEBUG] copy d=Jar:dot s=Jar:jakarta.ws.rs-api p=}}
> {{[DEBUG] copy d=Jar:dot s=Jar:jakarta.enterprise.cdi-api p=}}
> {{[DEBUG] copy d=Jar:dot s=Jar:jakarta.enterprise.lang-model p=}}
> {{[DEBUG] copy d=Jar:dot s=Jar:jakarta.el-api p=}}
> {{[DEBUG] copy d=Jar:dot s=Jar:jakarta.interceptor-api p=}}
> {{[DEBUG] copy d=Jar:dot s=Jar:jakarta.inject-api p=}}
> {{[DEBUG] copy d=Jar:dot s=Jar:jakarta.validation-api p=}}
> {{[DEBUG] copy d=Jar:dot s=Jar:jakarta.annotation-api p=}}
> - and without module-info:
> {{[DEBUG] copy d=Jar:dot s=Jar:. p=jakarta/mvc}}
> {{[DEBUG] copy d=Jar:dot s=Jar:. p=jakarta/mvc/binding}}
> {{[DEBUG] copy d=Jar:dot s=Jar:. p=jakarta/mvc/engine}}
> {{[DEBUG] copy d=Jar:dot s=Jar:. p=jakarta/mvc/event}}
> {{[DEBUG] copy d=Jar:dot s=Jar:. p=jakarta/mvc/form}}
> {{[DEBUG] copy d=Jar:dot s=Jar:. p=jakarta/mvc/locale}}
> {{[DEBUG] copy d=Jar:dot s=Jar:. p=jakarta/mvc/security}}
> I assume those resources are not wanted in {{mvc-api.jar}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to