title: Problem integrating OCL types in Xtext grammar
body: <p>I'm working on a grammar (Xtext project) where I want to reuse OCL types. Usually you refer in Xtext to existing types with an import statement, e.g.</p>
  
  <pre><code>import "http://www.eclipse.org/emf/2002/Ecore" as ecore
  </code></pre>
  
  <p>There is already an example Xtext project (CompleteOCL) which integrates OCL types in a grammar. Unfortunately the project refers in its import statements to local plugins, e.g.</p>
  
  <pre><code>import "platform:/resource/org.eclipse.ocl.examples.xtext.base/model/BaseCST.ecore" as base
  </code></pre>
  
  <p>So there are no dependencies defined in the Manifest.MF file. If I want to reuse OCL types in my grammar I have to write for example</p>
  
  <pre><code>import "http://www.eclipse.org/ocl/3.0.0/BaseCST" as base
  </code></pre>
  
  <p>I've added the  org.eclipse.ocl.examples.xtext.base dependency and can write rules in my grammar which refer to (OCL) BaseCST types. If I try to generate the Xtext artifcats I get the following error:</p>
  
  <pre><code>     ... 3 more
  Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:54)
      ... 36 more
  Caused by: java.lang.IllegalStateException: Problem parsing 'classpath:/org/xtext/example/mydsl/MyDsl.xtext':[XtextLinkingDiagnostic: null:5 Couldn't resolve reference to EPackage 'http://www.eclipse.org/ocl/3.0.0/BaseCST'.]
      at org.eclipse.xtext.generator.LanguageConfig.setUri(LanguageConfig.java:112)
      ... 41 more
  </code></pre>
  
  <p>So probably I'missing something? The problem is quite easy to reproduce. Create a new Xtext project, add the dependency, edit the grammar and add the last import statement ("import "http://...") and try to generate the Xtext artifacts. Any ideas are welcome!</p>
  
  <p>Thanks in advance!<br>
    Michael</p>
  
  <p>EDIT: In order to use a grammar you have to refer in your MWE2 workflow (see section 3.2.2.2 of the the Xtext documentation (version 1.0.1)) to the corresponding genmodel file of the ecore model, for example</p>
  
  <pre><code>fragment = org.eclipse.xtext.generator.ecore.EcoreGeneratorFragement {
    referencedGenModels = "platform:/plugins/org.eclipse.ocl.examples.xtext.base/model/BaseCST.genmodel
  } 
  </code></pre>
  
  <p>Nevertheless it's still not working for me.</p>