[SOLVED] Resolve cross references from a different DSL during Maven build [message #1725763] |
Mon, 07 March 2016 08:39  |
Eclipse User |
|
|
|
Hi all,
I have two DSLs, where one DSL has cross references to the other.
For example I can define something like this in DSL A:
package myservice
service MyService {
list : GET
get : GET
save : POST
}
Then I can use the defined service and its methods in DSL B:
package myclient
import myservice
client MyService {
list
get
}
Based on this I can generate client code for the "list" and "get" methods of MyService in Eclipse.
Now let's assume the DSL A snippet is in a file called MyService.dsla and the DSL B snippet is in MyClient.dslb
I would like to achieve the following:
1. Put the file MyService.dsla in it's own Maven artifact (and generate there some stuff that is not related to DSL B at all).
2. Create a separate artifact which contains MyClient.dslb, include the previously built MyService.dsla artifact as a Maven dependency, and generate the DSL B related code based on it.
I can perform the first step. I created an artifact, and I can build it and include MyService.dsla.
I attached the POM to this comment as "myservice-pom.xml" It is mainly from the xtext-examples, I marked the only point where I added new configuration, which tells Maven to include src/main/dsla into the built artifact. This directory contains the MyService.dsla file by my conventions.
I attached the POM of the second artifact as "myclient-pom.xml". It is a standard POM from the xtext-examples. I tried to add the first artifact as a standard dependency of the artifact itself and for the xtext-maven-plugin as well, but I got the same error during a Maven build in both cases:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building myclient 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ myclient ---
[INFO] Deleting /path/to/myclient/target
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default) @ myclient ---
[INFO]
[INFO] --- build-helper-maven-plugin:1.8:add-source (default) @ myclient ---
[INFO] Source directory: /path/to/myclient/target/generated-sources/xtend added.
[INFO] Source directory: /path/to/myclient/target/generated-sources/xtend added.
[INFO]
[INFO] --- xtext-maven-plugin:2.9.1:generate (default) @ myclient ---
[INFO] Encoding: UTF-8
[INFO] Compiler source level: 1.8
[INFO] Compiler target level: 1.8
[INFO] Using common types.
[INFO] Collecting source models.
[INFO] Installing type provider.
[INFO] Generating stubs into /path/to/myclient/target/xtext-temp/stubs
[INFO] /path/to/myclient/target/xtext-temp/stubs
[INFO] Nothing to compile. Stubs compilation was skipped.
[INFO] Installing type provider for stubs.
[INFO] Validate and generate.
[INFO] Starting validation for input: 'MyClient.dslb'
[ERROR] ERROR:Couldn't resolve reference to Service 'MyService'. (file:/path/to/myclient/src/main/resources/MyClient.dslb line : 3 column : 9)
[ERROR] ERROR:Couldn't resolve reference to ServiceMethod 'get'. (file:/path/to/myclient/src/main/resources/MyClient.dslb line : 4 column : 3)
[ERROR] ERROR:Couldn't resolve reference to ServiceMethod 'list'. (file:/path/to/myclient/src/main/resources/MyClient.dslb line : 5 column : 3)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.247 s
[INFO] Finished at: 2016-03-07T14:25:11+01:00
[INFO] Final Memory: 23M/310M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.xtext:xtext-maven-plugin:2.9.1:generate (default) on project myclient: Execution failed due to a severe validation error. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
So, how should I configure my Maven artifacts to be able to build my second artifact successfully with this setup?
Thank you.
[Updated on: Tue, 08 March 2016 11:10] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.09908 seconds