Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » exec-maven-plugin with Xtext(SecurityException on org.eclipse.core.runtime.OperationCanceledException)
exec-maven-plugin with Xtext [message #1856950] Tue, 10 January 2023 16:06 Go to next message
Simon Cockx is currently offline Simon CockxFriend
Messages: 69
Registered: October 2021
Member
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]

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 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: exec-maven-plugin with Xtext [message #1856967 is a reply to message #1856951] Wed, 11 January 2023 08:59 Go to previous messageGo to next message
Simon Cockx is currently offline Simon CockxFriend
Messages: 69
Registered: October 2021
Member
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]

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 Go to previous messageGo to next message
Simon Cockx is currently offline Simon CockxFriend
Messages: 69
Registered: October 2021
Member
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]

Report message to a moderator

Re: exec-maven-plugin with Xtext [message #1856977 is a reply to message #1856970] Wed, 11 January 2023 12:51 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
can you try with a clean maven repo -Dmaven.repo.local=somedir
what is the complete stacktrace and what does the code that crashes do?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Wed, 11 January 2023 12:58]

Report message to a moderator

Re: exec-maven-plugin with Xtext [message #1856978 is a reply to message #1856970] Wed, 11 January 2023 13:04 Go to previous messageGo to next message
Simon Cockx is currently offline Simon CockxFriend
Messages: 69
Registered: October 2021
Member
Never mind, I got a workaround. Just opened the resource as a stream instead of opening it as a URL and converting it to a file path.

Thanks for the help!

[Updated on: Wed, 11 January 2023 13:04]

Report message to a moderator

Re: exec-maven-plugin with Xtext [message #1856979 is a reply to message #1856978] Wed, 11 January 2023 13:08 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
so its about plugin tests, not (pure) unit tests

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Grammar solution request
Next Topic:Formatting: respect newlines
Goto Forum:
  


Current Time: Thu Apr 25 08:53:47 GMT 2024

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

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

Back to the top