'Not able to exclude com.sun.xml.bind (jaxb-core, jaxb-impl) from apache camel
I need to use JAXB but cannot use the EDL or CDDL licensed libraries. Is there any solution for this?
I am currently using apache camel (maven dependency) in my project where internally it uses EDL licensed jaxb-core and jaxb-impl but we should not have EDL licensed libraries. Could anyone please help me with it? If I exclude jaxb-core and jaxb-impl in pom.xml, Apache Camel is not able to load its library where it looks like Apache Camel is using these libraries internally while loading camel-dependent libraries.
Thanks in advance.
Solution 1:[1]
There is similar topic with removing Xerces out of dependencies Dealing with "Xerces hell" in Java/Maven?
long story short in gradle it would be
configurations {
all*.exclude group: 'com.sun.xml.bind.jaxb-core'
}
for maven - it would be
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>enforce-banned-dependencies</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<excludes>
<exclude>com.sun.xml.bind.jaxb-core</exclude>
</excludes>
</bannedDependencies>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Pavlonator |
