exec-maven-plugin with Xtext [message #1856950] |
Tue, 10 January 2023 16:06  |
Eclipse User |
|
|
|
Is there a way of configuring `exec-maven-plugin` to work with Xtext/Tycho?
I have a main file `GenerateTmGrammar` that needs grammar access to my DSL, i.e., it needs to run
Injector inj = new MyDSLStandaloneSetup().createInjectorAndDoEMFRegistration();
MyDSLGrammarAccess grammarAccess = inj.getInstance(MyDSLGrammarAccess.class);
Grammar grammar = grammarAccess.getGrammar();
Set<String> keywords = GrammarUtil.getAllKeywords(grammar);
However, when running a `mvn clean install` on the parent project, I'm getting the following error:
An exception occurred while executing the Java class. com.google.common.util.concurrent.UncheckedExecutionException: java.lang.SecurityException: class "org.eclipse.core.runtime.OperationCanceledException"'s signer information does not match signer information of other classes in the same package
Interestingly, I'm not getting this error when I run `mvn clean install` on the actual submodule containing `GenerateTmGrammar.java`.
Before I imported anything related to Xtext the plugin was running fine.
Does anybody have experience with setting this up? Any solutions/workarounds?
`exec-maven-plugin` configuration:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>Generate TextMate grammar json file</id>
<phase>prepare-package</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>com.example.mydsl.ide.textmate.GenerateTmLanguage</mainClass>
<arguments>
<argument>${project.basedir}/mydsl.tmLanguage.yaml</argument>
<argument>${project.basedir}/src-gen/syntaxes/mydsl.tmLanguage.json</argument>
</arguments>
<classpathScope>compile</classpathScope>
</configuration>
</execution>
</executions>
</plugin>
Note that I've added `<classpathScope>compile</classpathScope>`. Before that, it wasn't finding my dependency on SnakeYAML, which I added to the target file of my project. I'm not sure why.
[Updated on: Tue, 10 January 2023 16:32] by Moderator Report message to a moderator
|
|
|
Re: exec-maven-plugin with Xtext [message #1856951 is a reply to message #1856950] |
Tue, 10 January 2023 16:12   |
Eclipse User |
|
|
|
have no idea but
An exception occurred while executing the Java class. com.google.common.util.concurrent.UncheckedExecutionException: java.lang.SecurityException: class "org.eclipse.core.runtime.OperationCanceledException"'s signer information does not match signer information of other classes in the same package
this looks like an inconsistent use of ecore.runtime and equinox.common.
by using matching explicit versions for both the problem should vanish
|
|
|
Re: exec-maven-plugin with Xtext [message #1856967 is a reply to message #1856951] |
Wed, 11 January 2023 08:59   |
Eclipse User |
|
|
|
Thanks! Adding these two dependencies to the plugin actually solved it.
After that, I noticed that I actually had some dependencies defined in Maven that were conflicting with Tycho. Once I replaced all explicit Maven dependencies with the corresponding target platform/Tycho dependencies, I could run exec-maven-plugin without the additional dependencies. So the actual cause was a problem in my Maven configuration.
[Updated on: Wed, 11 January 2023 09:00] by Moderator Report message to a moderator
|
|
|
Re: exec-maven-plugin with Xtext [message #1856970 is a reply to message #1856967] |
Wed, 11 January 2023 09:57   |
Eclipse User |
|
|
|
Hm, although now I'm getting a `FileSystemNotFoundException: Provider "bundleresource" not installed` exception while running unit tests. @Christian Dietrich, do you have an idea in which dependency file system support for `bundleresource` is defined?
Tests are fine when I run them in Eclipse.
[Updated on: Wed, 11 January 2023 10:10] by Moderator Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03576 seconds