After the 2.1 release about a week ago, the build process of one of our multi-module projects started to fail. For some reason, the problem only occurs when run under Linux. On Windows everything works as before.
Basically, we have the following (or similar) directory structure:
In a/pom.xml, we are using jaxb2-maven-plugin:xjc without any explicit source configuration to generate Java classes from the schema.xsd file (it is automatically found, since it is in the src/main/xsd directory).
With release 2.1, the build process started to fail with the following exception:
[ERROR] null [-1,-1] org.xml.sax.SAXParseException; schema_reference.4: Failed to read schema document 'file:/repository/src/main/xsd/schema.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. ... at org.codehaus.mojo.jaxb2.javageneration.AbstractJavaGeneratorMojo.performExecution(AbstractJavaGeneratorMojo.java:384) at org.codehaus.mojo.jaxb2.AbstractJaxbMojo.execute(AbstractJaxbMojo.java:200) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... Caused by: java.io.FileNotFoundException: /repository/src/main/xsd/schema.xsd (No such file or directo
To me, it looks as if the xjc goal looks for schema files and locates the file correctly at this location:
For some reason, the plugin later tries to read the file from here:
/repository/src/main/xsd/schema.xsd (note, the 'a' directory of the sub-module is missing).