Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Packages does not exist from Xtext Maven Example
Packages does not exist from Xtext Maven Example [message #1851750] Thu, 14 April 2022 18:47 Go to next message
Clark Gable is currently offline Clark GableFriend
Messages: 3
Registered: April 2022
Junior Member
Hi,

I am currently new to Xtext and LSP and tried to create a .jar from the sample project to create a language server to use in a VSCode extension. Unfortunately, when I run Maven install on the parent to create the .jar of the language server, the following errors appear:

/org.xtext.example.mydsl.tests/xtend-gen/org/xtext/example/mydsl/tests/MyDslParsingTest.java:[15,29] package org.junit.jupiter.api does not exist
[ERROR]...org.xtext.example.mydsl.parent/org.xtext.example.mydsl.tests/xtend-gen/org/xtext/example/mydsl/tests/MyDslParsingTest.java:[16,29] package org.junit.jupiter.api does not exist
[ERROR].../org.xtext.example.mydsl.parent/org.xtext.example.mydsl.tests/xtend-gen/org/xtext/example/mydsl/tests/MyDslParsingTest.java:[17,39] package org.junit.jupiter.api.extension does not exist
[ERROR].../org.xtext.example.mydsl.parent/org.xtext.example.mydsl.tests/xtend-gen/org/xtext/example/mydsl/tests/MyDslParsingTest.java:[20,2] cannot find symbol
[ERROR]   symbol: class ExtendWith
[ERROR].../org.xtext.example.mydsl.parent/org.xtext.example.mydsl.tests/xtend-gen/org/xtext/example/mydsl/tests/MyDslParsingTest.java:[21,2] cannot find symbol
[ERROR]   symbol: class InjectWith
[ERROR]...org.xtext.example.mydsl.parent/org.xtext.example.mydsl.tests/xtend-gen/org/xtext/example/mydsl/tests/MyDslParsingTest.java:[25,11] cannot find symbol
[ERROR]   symbol:   class ParseHelper
[ERROR]   location: class org.xtext.example.mydsl.tests.MyDslParsingTest
[ERROR].../org.xtext.example.mydsl.parent/org.xtext.example.mydsl.tests/xtend-gen/org/xtext/example/mydsl/tests/MyDslParsingTest.java:[20,13] cannot find symbol
[ERROR]   symbol: class InjectionExtension
[ERROR]...org.xtext.example.mydsl.parent/org.xtext.example.mydsl.tests/xtend-gen/org/xtext/example/mydsl/tests/MyDslParsingTest.java:[21,13] cannot find symbol
[ERROR]   symbol: class MyDslInjectorProvider
[ERROR].../org.xtext.example.mydsl.parent/org.xtext.example.mydsl.tests/xtend-gen/org/xtext/example/mydsl/tests/MyDslParsingTest.java:[27,4] cannot find symbol
[ERROR]   symbol:   class Test
[ERROR]   location: class org.xtext.example.mydsl.tests.MyDslParsingTest
[ERROR].../org.xtext.example.mydsl.parent/org.xtext.example.mydsl.tests/xtend-gen/org/xtext/example/mydsl/tests/MyDslParsingTest.java:[34,7] cannot find symbol
[ERROR]   symbol:   variable Assertions
[ERROR]   location: class org.xtext.example.mydsl.tests.MyDslParsingTest
[ERROR].../org.xtext.example.mydsl.parent/org.xtext.example.mydsl.tests/xtend-gen/org/xtext/example/mydsl/tests/MyDslParsingTest.java:[41,7] cannot find symbol
[ERROR]   symbol:   variable Assertions
[ERROR]   location: class org.xtext.example.mydsl.tests.MyDslParsingTest


The build error is only in the tests:
[INFO] Reactor Summary for org.xtext.example.mydsl.parent 1.0.0-SNAPSHOT:
[INFO] 
[INFO] org.xtext.example.mydsl.parent ..................... SUCCESS [  0.273 s]
[INFO] org.xtext.example.mydsl ............................ SUCCESS [ 11.450 s]
[INFO] org.xtext.example.mydsl.ide ........................ SUCCESS [  3.172 s]
[INFO] org.xtext.example.mydsl.tests ...................... FAILURE [  0.302 s]


Here is what I did:
1. Create new Xtext Project (Java 11, Maven, Fat Jar)
2. Generate Xtext artifacts from MyDsl.xtext
3. mydsl.parent -> Run As "Maven install"

Eclipse: Version: 2022-03 (4.23.0)
Xtext: Version: 2.26.0.v20220228-0901
Java: 11.0.14

I'm not that familiar with the tools, so can somebody help me with this? Thank you very much in advance!
Re: Packages does not exist from Xtext Maven Example [message #1851775 is a reply to message #1851750] Fri, 15 April 2022 09:33 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14721
Registered: July 2009
Senior Member
did you select or deselect eclipse in the wizard?
if you did not deselct how does your mydsl.target file look like?
does it work if you run maven with a dedicated repo? (-Dmaven.repo.local=somepath)
if not can you provide your project or reproducer as github repo orr similar


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com

[Updated on: Fri, 15 April 2022 09:39]

Report message to a moderator

Re: Packages does not exist from Xtext Maven Example [message #1851778 is a reply to message #1851775] Fri, 15 April 2022 10:41 Go to previous messageGo to next message
Clark Gable is currently offline Clark GableFriend
Messages: 3
Registered: April 2022
Junior Member
Yes, I deselected eclipse in the wizard.

You can find the project here: https://github.com/dbfuh/Xtext-languageserver
Re: Packages does not exist from Xtext Maven Example [message #1851781 is a reply to message #1851778] Fri, 15 April 2022 11:23 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14721
Registered: July 2009
Senior Member
this projects builds perfectly fine for me with
org.xtext.example.mydsl.parent]$ mvn clean install -Dmaven.repo.local=.m2


[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for org.xtext.example.mydsl.parent 1.0.0-SNAPSHOT:
[INFO] 
[INFO] org.xtext.example.mydsl.parent ..................... SUCCESS [  7.819 s]
[INFO] org.xtext.example.mydsl ............................ SUCCESS [01:09 min]
[INFO] org.xtext.example.mydsl.ide ........................ SUCCESS [ 11.468 s]
[INFO] org.xtext.example.mydsl.tests ...................... SUCCESS [  7.472 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:37 min
[INFO] Finished at: 2022-04-15T13:21:51+02:00
[INFO] ----------------------------------------------------------------------


so i assume you have some broken files floating around in your local maven repo.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Packages does not exist from Xtext Maven Example [message #1851793 is a reply to message #1851781] Fri, 15 April 2022 18:44 Go to previous messageGo to next message
Clark Gable is currently offline Clark GableFriend
Messages: 3
Registered: April 2022
Junior Member
Thank you for your response!

Ok, so with
mvn clean install -Dmaven.repo.local=.m2
it works but it with "Maven Install" from eclipse I get the error even when I delete the .m2 repository before.
Re: Packages does not exist from Xtext Maven Example [message #1851797 is a reply to message #1851793] Sat, 16 April 2022 05:17 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14721
Registered: July 2009
Senior Member
the questions would be. which maven repo does "from" eclipse use.
you can specify the -Dmaven.repo.local there too in the vm args line.
i assume the one in your user home.
and how does the jar containg the missing classes
$HOME /.m2/repository/org/junit/jupiter/junit-jupiter-api/5.8.1/junit-jupiter-api-5.8.1.jar look like.
is it a real jar? with proper content?
the next question would be: which java version does it use and which maven version


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com

[Updated on: Sat, 16 April 2022 05:41]

Report message to a moderator

Previous Topic:Allow cross-references to "built-in" types
Next Topic:LSP4J : Language Server method call never ends
Goto Forum:
  


Current Time: Mon Oct 07 14:36:42 GMT 2024

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

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

Back to the top