mojohaus / jaxb2-maven-plugin

JAXB2 Maven Plugin
https://www.mojohaus.org/jaxb2-maven-plugin/
Apache License 2.0
106 stars 77 forks source link

Plugin fails with FileNotFoundException if not run from project directory or system root #109

Closed pieter-v closed 6 years ago

pieter-v commented 6 years ago

We have a master project with child projects

/sources
    master
        pom.xml
    project-A
        pom-xml

The master project has ../project-A as a module. So

cd /sources/master
mvn install

will fail with a FileNotFoundException. You have the same problem if you just execute

cd /sources/master
mvn -f ../project-A/pom.xml

Then it fails because it will look for source files in sources/project-A/src/main/xsd in stead of /sources/project-A/src/main/xsd So the Driver looks for files in /sources/master/sources/project-A/src/main/xsd.

This is probably introduced by #107

pieter-v commented 6 years ago

As I mentioned in the initial report: if it is a part of a multi-project build, then the build fails: starting the build from the master project then a FileNotFoundException is thrown.

So, I think it is better to revert #107 and document that running from the root directory will fail the build.