Duplicate jars in Java 11 causing below error
We are upgrading project from Java 8 to Java 11, and facing the below error:
The package javax.xml.namespace is accessible from more than one module: <unnamed>, java.xml
Apparently, this is due to same package which is existing in another jar file is creating a problem. In order to fix this issue, we have excluded the jar time temporarily and it is working fine.
Is there a way that we can ignore this error without removing the transient dependencies. Since we have 200+ services and excluding from each service is a mammoth effort.
My pom.xml as below:
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.xyz</groupId> <artifactId>test</artifactId> <version>1.0.0</version> <packaging>jar</packaging> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.3.3.RELEASE</version> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <mule.version>3.9.0</mule.version> <mule.tools.version>1.2</mule.tools.version> <apikit.version>3.9.0</apikit.version> <munit.version>1.1.0</munit.version> <mule.munit.support.version>3.7.1</mule.munit.support.version> <java.version>11</java.version> <junit.version>4.9</junit.version> <jackson.version>2.8.5</jackson.version> <httpcore.version>4.4.5</httpcore.version> <spring.version>4.3.2.RELEASE</spring.version> </properties> <build> <finalName>somename</finalName> </build> </project>