Skip to content

Commit 4b167f5

Browse files
committed
Fix OSGi Export-Package for shaded Guava packages (#1688)
Add _exportcontents instruction to stack-core's maven-bundle-plugin configuration to export org.eclipse.milo.shaded.com.google.common.* packages. The maven-bundle-plugin runs before maven-shade-plugin, so it doesn't see the relocated packages. Using _exportcontents allows declaring exports for packages that will be created by shading.
1 parent 18d137c commit 4b167f5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

opc-ua-stack/stack-core/pom.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,21 @@
9494
<argLine>-Dio.netty.noReflectiveAccessible=false</argLine>
9595
</configuration>
9696
</plugin>
97+
<plugin>
98+
<groupId>org.apache.felix</groupId>
99+
<artifactId>maven-bundle-plugin</artifactId>
100+
<configuration>
101+
<instructions>
102+
<!-- Export the shaded Guava packages for OSGi.
103+
The maven-bundle-plugin runs before maven-shade-plugin, so it doesn't
104+
see the relocated packages. We explicitly declare them here using
105+
_exportcontents which adds exports without copying classes. -->
106+
<_exportcontents>
107+
org.eclipse.milo.shaded.com.google.common.*;version="${project.version}"
108+
</_exportcontents>
109+
</instructions>
110+
</configuration>
111+
</plugin>
97112
<plugin>
98113
<groupId>org.apache.maven.plugins</groupId>
99114
<artifactId>maven-shade-plugin</artifactId>

0 commit comments

Comments
 (0)