Another m2eclipse tip
December 30th, 2008 | Published in tip
Came across another small bug with m2eclipse yesterday when editing an XML schema in a project that used the Maven plugin for JAXB (jaxb2-maven-plugin). You may find Eclipse complaining that it cannot build your project because of this error:
An internal error occurred during: “Building workspace”.
Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
The underlying problem may be due to classloader funkiness with the embedded version of Maven (since command-line Maven works fine) or some transitive dependency not being handled correctly.
Anyway, the workaround mentioned in this bug on the Codehaus JIRA solved the problem. The solution is to explicitly add Xerces as a dependency to your POM:
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.1</version>
</dependency>
Once you’ve done that, right-click on your project in the Package Explorer and select Maven > Update Dependencies. Eclipse should then be able to rebuild the project.
