Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to validate import URI in Maven project managed by Eclipse m2e?(org.eclipse.xtext.validation.ImportUriValidator fails if imported resource is not copied by JDT but m2e)
icon5.gif  How to validate import URI in Maven project managed by Eclipse m2e? [message #1062606] Sun, 09 June 2013 22:02
Torsten Juergeleit is currently offline Torsten JuergeleitFriend
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

Previous Topic:Importing model file outside project
Next Topic:How to get ecore and genmodel?
Goto Forum:
  


Current Time: Fri Apr 26 12:05:35 GMT 2024

Powered by FUDForum. Page generated in 0.03965 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top