Build local eclipse plugins using tycho pointing to local p2 repository

风格不统一 提交于 2019-12-05 11:45:19
bjrara

Sebastian Zarnekow's answer gave me a hint.

Error while building an xtext project with ant: Generation of the Grammar classes fails

As you can infer from the error message, maven fails to create language models from injection. The reason is explained in the link above:

Xtext uses the platform:/resource URI scheme of EMF.

The solution is you need to give EMFGenerator a new declaration of where the model directory should be. In **.mwe2 file, replace the following code

fragment = ecore.EMFGeneratorFragment auto-inject {}

with

fragment = ecore.EMFGeneratorFragment auto-inject {
    javaModelDirectory = "/${projectName}/src-gen"
}

should do the trick.

for anyone who also runs into this problem, you can also try using:

${project.basedir}

So, say you have the following directories:

- projects:
    - main-project
    - local-repository

In the parent pom (i.e.: main-project/pom.xml) reference the local-repository, using a relative path, in the following way:

<url>file:${project.basedir}/target/repository</url>

Just replace :

<url>file:///.../target/repository</url>

by :

<url>file:<projectname>/deploy/target/repository</url>

(if your parent pom.xml is your root folder)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!