New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem running schemagen with JDK 1.8 when createJavaDocAnnotations is true #40
Comments
Complete log for running maven with |
It appears that |
Setting the configuration property |
I suppose we can handle this in the plugin by checking the JDK version, and applying the correct setting. |
This issue also appears if you have transformSchemas, even if you turn off createJavaDocAnnotations, you will get this exception until you remove all transformSchemas. |
The error is thrown from the following code snippet: private static TransformerFactory getFactory() {
if (FACTORY == null) {
try {
FACTORY = TransformerFactory.newInstance();
// Harmonize XML formatting
FACTORY.setAttribute("indent-number", 2);
} catch (Throwable exception) {
// This should really not happen... but it seems to happen in some test cases.
throw new IllegalStateException("Could not acquire TransformerFactory implementation.", exception);
}
}
// All done.
return FACTORY;
} ... where the desired outcome is to provide a more sensible XSD formatting than if the indent-number argument was not provided. The "indent-number" parameter, in turn is found - along with the other accepted parameters - in the implementation of the TransformerFactory. The implementation found within the JDK8 ( However, a simple way to handle IllegalArgumentException is simply to catch it and move on. In case the TransformerFactory implementation does not support the indent-number attribute, the user will simply get a less well-formatted, generated XSD as a result. |
When running schemagen from the command line (the 1.8 version) everything is fine, a schema is generated as expected. When the jaxb2-maven-plugin runs schemagen, it fails with a report that says that schemagen did not finish properly. Running maven with the -e flag I get the following cause:
POM sets java to 1.8:
The plugin is run like so:
Output with mvn -X -e compile:
Will attach the complete log.
The text was updated successfully, but these errors were encountered: