-
Notifications
You must be signed in to change notification settings - Fork 79
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
Incorrect path passed on MacOS #123
Comments
This seems to be Eclipse-related, implying that anyone with Eclipse IDE expertise is welcome to supply an Integration Test and a patch. |
This seems related to just look at the path: on macOS /Applications and /Users are in the root of the disk |
I have the same issue during generating source from maven. After some debugging I found out that
The FileSystemUtilities.relativize will remove the '/' separator from the beginning of the file path (because the third parameter passed as removeInitialFileSep = true ). This will case an issue later. Since thats a relative path. And later it will append the base dir to it. Then the whole generation call will end up looking for a non existent file. Me personally I would pass in with removeInitialFileSep = false . I've change in the debugger the flag and my use case passed. Of corse I do not see all the consequence. But it is clearly in my case the current.getPath() path is not starting with the system.user.dir that means nothing to make relative as base path is not equals with the user dir. |
That code tries to relativize to the current directory ("user.dir"). Why?
|
Don't try to shorten paths to xsd sources. XCJ is called directly, not via the command-line, so doing so doesn't really help. Not trying to shorten these paths also avoids stripping a leading '/', which would otherwise make XCJ treat the path as relative and resolve to the current directory, which breaks out-of-tree builds. Adds an integration test that creates a maven project in the system tmp directory, runs a maven build there, and verifies that that maven build was successful and did generate something.
Don't try to shorten paths to xsd sources. XCJ is called directly, not via the command-line, so doing so doesn't really help. Not trying to shorten these paths also avoids stripping a leading '/', which would otherwise make XCJ treat the path as relative and resolve to the current directory, which breaks out-of-tree builds. Adds an integration test that creates a maven project in the system tmp directory, runs a maven build there, and verifies that that maven build was successful and did generate something.
Not really Eclipse-related, just any out-of-tree build runs into this.
See #168. The test is a bit convoluted; don't know if there'd be a better way to test this. It works, though: fails in the expected way without the fix, succeeds with the fix. (Tested locally on OS X, and verified that this indeed solves the issue also when running via m2e in Eclipse.) |
same for me. |
Don't try to shorten paths to xsd sources. XCJ is called directly, not via the command-line, so doing so doesn't really help. Not trying to shorten these paths also avoids stripping a leading '/', which would otherwise make XCJ treat the path as relative and resolve to the current directory, which breaks out-of-tree builds. Adds an integration test that creates a maven project in the system tmp directory, runs a maven build there, and verifies that that maven build was successful and did generate something. Closes #168 #123
Running Maven within Eclipse 2018-12 on MacOS. I have a POM which works on windows but fails on my MacOS setup. It appears to be prefixing the path to the source with the path of the eclipse application.
My source file is at: /Users/christ/Dev/KeyDirectory/Gateway-Message/src/main/xsd/Message.xsd
This is the error I see in the Maven log:
2019-03-12, 2:22:14 p.m. EDT: [ERROR] null [-1,-1] schema_reference.4: Failed to read schema document 'file:/Applications/Eclipse.app/Contents/MacOS/Users/christ/Dev/KeyDirectory/Gateway-Message/src/main/xsd/Message.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>.
Running mvn package from the command line does allow it to run however.
The text was updated successfully, but these errors were encountered: