How to validate import URI in Maven project managed by Eclipse m2e? [message #1062606] |
Sun, 09 June 2013 22:02 |
Torsten Juergeleit Messages: 18 Registered: July 2009 |
Junior Member |
|
|
We have a grammar which uses "importURI":
DslModel :
(imports+=DslImport)*
app=DslApplication;
DslImport :
'import' importURI=STRING;
DslApplication :
The validator is generated with the following MWE fragments:
fragment = validation.ValidatorFragment auto-inject {
composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
}
fragment = scoping.ImportURIScopingFragment auto-inject {}
fragment = exporting.SimpleNamesFragment auto-inject {}
The attached screenshot shows that the "ImportUriValidator" isn't able to find the imported resource which is available in the projects class path.
This project is managed by the Eclipse plugin m2e. Here resource folders (like the one with the imported resource) are not managed by JDT but by m2e. As the second screenshot shows are resources are not copied by JDT but by m2e (behind the scenes). This is explained in m2e FAQ Why resource folders in Java project have excluded="*".
After removing the exclusion pattern "**" the "ImportUriValidator" is able to find the imported resource.
Now I'm wondering why only the "ImportUriValidator" fails but the other validators (like the reference validator which is successfully validating the reference "@Person") or the code completion support (as shown in the third screenshot) have no problem to find the imported resource.
/Torsten
[Updated on: Sun, 09 June 2013 22:12] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03965 seconds