Open KyRobbins opened 4 months ago
Adding to this, there is a separate bug in the same FileSystemUtilities#relativize(String, File, boolean)
method of 2.5.0
for windows systems. The value returned by URL#getPath()
returns a /
delimited path String (with a /
prefix), which is used to feed this method. The baseDirPath
is derived using File#getPath()
on parentDir
, which results in a \
delimited path String.
This will result in https://github.com/mojohaus/jaxb2-maven-plugin/blob/1ac2e020aaca2fb82514bf1f0d9d90fa899227c7/src/main/java/org/codehaus/mojo/jaxb2/shared/FileSystemUtilities.java#L542 never resolving to true
in any situation (and the case-insensitivity can lead to issues on Windows I would assume). The final check for toReturn.startsWith(File.separator)
will also fail, as the URL#getPath()
prefixed with a /
, not the windows native \
, meaning the return statement will return an absolute path.
This is a jumble of different bugs that cancel each other out on Windows, but not on a Unix system.
Using
jaxb2-maven-plugin:2.5.0
, When doing a maven build using the following module structureBuilding using the parent results in a failure due to the fact that the base directory for the execution is
*/root_dir/parent
, which means the check on https://github.com/mojohaus/jaxb2-maven-plugin/blob/1ac2e020aaca2fb82514bf1f0d9d90fa899227c7/src/main/java/org/codehaus/mojo/jaxb2/shared/FileSystemUtilities.java#L542 fails, since the actual xsd source is in*/root_dir/sub-module/src/main/xsd
, and you end up with a concatenated path of*/root_dir/parent/*/root_dir/sub-module/
.This appears to be a bug, and is only an issue in this particular module project structure where the parent and sub-module are sibling directories, and this structure won't change for my current project. I also do not have the ability to downgrade to
2.3.1
(which does not contain this bug) because I'm building with JDK17, which is missing some required classes, but at the same time, I can't jump to3.x
of the plugin becausejavax
is still being used prolifically through the code base and it's not an option to change that at this time.