Dealing with "Xerces Hell" in Java/Maven?
Xerces, a widely used XML parser, has long been a source of frustration for Java developers due to its history of unversioned JARs, lack of official Maven releases, and split jars (xml-apis and xercesImpl). This has led to version conflicts and classloader issues.
Problems:
- Conflict Resolution: When using enterprise software with repository proxies, multiple versions of Xerces (e.g., xml-apis) from different organizations can be added as dependencies, leading to conflicts that Maven cannot resolve due to different groupIds.
- Classloader Hell: The JRE includes Xerces as part of the JAXP implementation, but its version may not be compatible with that used by third-party libraries or servlet containers. This can cause classloading issues at runtime.
Solutions:
While marking Xerces dependencies as
Maven Central Resolution:
In February 2013, JARs for Xerces 2.11.0 and its source JARs were released on Maven Central. This eliminates the need for custom builds and simplifies dependency management.
To use the Maven Central version:
<dependency> <groupid>xerces</groupid> <artifactid>xercesImpl</artifactid> <version>2.11.0</version> </dependency>
Future Improvements:
The Apache Xerces team has uploaded patched build scripts that allow for automated Maven Central upload, addressing the root cause of the "Xerces hell." This improvement should resolve the issues permanently.
The above is the detailed content of How to Escape \'Xerces Hell\' in Java/Maven?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Chinese version
Chinese version, very easy to use

WebStorm Mac version
Useful JavaScript development tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.