Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Project and External Dependencies" disappeared in eclipse IDE #79

Closed
RobertWalterU3d opened this issue Jan 10, 2022 · 34 comments
Closed

Comments

@RobertWalterU3d
Copy link

RobertWalterU3d commented Jan 10, 2022

I used this template in 2020 to build my own VS Code extension.

Everything worked back then, but when I open the workspace with the very same eclipse version again today (2020-06), the library "Project and External Dependencies" does not show and all the dependencies to Xtext and related libs are broken.

Building from gradle still works, and I assume the issue is related to how buildship sets up the classpath, but I tried to refresh the gradle project and get this "Library entry" back so I can use the eclipse IDE to browse my projects again, but I cannot make it work. Any ideas how I can fix that?

UPDATE

In case you experience the same issue, try this solution of setting up a new workspace and importing the root gradle project, it worked for me:
#79 (comment)

@cdietrich
Copy link
Member

please check the gradle log / console on refresh gradle project

@RobertWalterU3d
Copy link
Author

sorry, but where I can I find the gradle log/console? ALl I see are these two views in the IDE (which is where I do "RIght click->Gradle->Refresh Gradle Project"):

image

@cdietrich
Copy link
Member

cdietrich commented Jan 10, 2022

in the console view on the arrow i see gradle operations when calling gradle refresh on parent/root
Bildschirmfoto 2022-01-10 um 12 55 52

@RobertWalterU3d
Copy link
Author

I don't see that option, but it looks like the [Gradle Operations] are already "open"
image

When I perform the refresh, the console shows nothing.

@cdietrich
Copy link
Member

there is no gradle -> refresh gradle project. ?!?

@RobertWalterU3d
Copy link
Author

The menu option is there, but the console does not show anything when I perform the action.

@RobertWalterU3d
Copy link
Author

gradleConsole

@cdietrich
Copy link
Member

cdietrich commented Jan 10, 2022

is there anything in error log?
have no idea whatn is broken with your buildship install.
how do your .classpath files look like

@RobertWalterU3d
Copy link
Author

This is how the classpath file looks like for the language project:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" output="bin/main" path="src">
		<attributes>
			<attribute name="gradle_scope" value="main"/>
			<attribute name="gradle_used_by_scope" value="main,test"/>
		</attributes>
	</classpathentry>
	<classpathentry kind="src" output="bin/main" path="src-gen">
		<attributes>
			<attribute name="gradle_scope" value="main"/>
			<attribute name="gradle_used_by_scope" value="main,test"/>
		</attributes>
	</classpathentry>
	<classpathentry kind="src" output="bin/main" path="xtend-gen">
		<attributes>
			<attribute name="gradle_scope" value="main"/>
			<attribute name="gradle_used_by_scope" value="main,test"/>
		</attributes>
	</classpathentry>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
	<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
	<classpathentry kind="output" path="bin/default"/>
</classpath>

Again, nothing that would normally be in the "Project and External Dependencies" can be resolved, so my Problems view looks like below (but I guess you mean something else with "error log", right?)

image

@cdietrich
Copy link
Member

cdietrich commented Jan 10, 2022

i mean .log files in workspace/.metadata

yes and normally gradle logs that in the operations log if it cannot resolve stuff.
maybe its also a java version

  • gradle version + buildship version + eclipse version problem.

which ones do you use?

@RobertWalterU3d
Copy link
Author

When I run gradle from console to refresh dependencies, it works (I use the build task as target, maybe that is not correct?)

image

@cdietrich
Copy link
Member

yes but buildship should do the same.

@RobertWalterU3d
Copy link
Author

so, this is what I see at the end of the log file:

image

@cdietrich
Copy link
Member

so it looks like there is something wrong with your setup.

@RobertWalterU3d
Copy link
Author

Maybe unsurprisingly, still wanted to share, this folder is empty:

.\.metadata\.plugins\org.eclipse.buildship.core\project-preferences\

I understand that buildship should store something there.

I will check the versions of gradle, buildship, etc, next, as you suggested.

@cdietrich
Copy link
Member

are you sure the eclipse workspace and the gradle root or a project root are disjoint?

@RobertWalterU3d
Copy link
Author

RobertWalterU3d commented Jan 10, 2022

eclipse version is: 2020-06
buildship version (acc. to eclipse->Help->About): 3.1.4.v20200326-1743
gradle (acc to command ./gradlew -v): 5.6.4

Are you sure the eclipse workspace and the gradle root or a project root are disjoint?

How can I ensure that? Again, building from command line and starting VS code with the plugin works just fine...

The interesting thing is that I used the very same eclipse, gradle, buildship version in 2020 to develop this language extension... so I wonder how it could have worked back then but not today...

@cdietrich
Copy link
Member

what is the dir of your eclipse workspace

@RobertWalterU3d
Copy link
Author

I use the exact same folder structure as this example repository does, so I have a a root folder where my language/ide/websocket/vscode-extension projects are all located in separate folder.

The settings.gradle file includes these five projects.

@kuniss
Copy link

kuniss commented Jan 10, 2022 via email

@cdietrich
Copy link
Member

again which is the workspace dir you use in eclipse?

@kuniss
Copy link

kuniss commented Jan 10, 2022 via email

@RobertWalterU3d
Copy link
Author

It is the "root":

D:\dev\repository\root\

Inside this root folder, there are the five projects, and gradlew.bat, .metadata, .settings and such.

@cdietrich
Copy link
Member

then this is something that buildship dislikes. can you try different dir.

@RobertWalterU3d
Copy link
Author

Sure. So, should I create a completely different directory as the workspace and import my five projects? As copies, or just references?

@cdietrich
Copy link
Member

just new workspace and use gradle import on the root

@RobertWalterU3d
Copy link
Author

... use mavenCentral() instead

Sorry, I'm not used to gradle, maven, or eclipse, I just try to used this as a template, so I don't know how I would go about using maven central instead. It also looks like as if all the dependencies are cached in ~\.gradle\caches\modules-2\ ... so I think it is not an issue of resolving the dependencies from server...?

@RobertWalterU3d
Copy link
Author

just new workspace and use gradle import on the root

I'm sorry, I don't follow. When I create a new workspace, it is empty, right? So, I'm not sure

  • what files I need to copy into the new workspace, if any
  • where to run gradle import from, if the workspace is empty

I'm reall ynot familiar with any of these technologies, sorry.

@cdietrich
Copy link
Member

create new workspace (empty)
import -> gradle -> existing gradle project
choose the root

@RobertWalterU3d
Copy link
Author

Wow, that did indeed fix it!

@RobertWalterU3d
Copy link
Author

Thank you very much, I would have never guessed that.

@cdietrich
Copy link
Member

of course it would be better if buildship showed an error dialog

@RobertWalterU3d
Copy link
Author

Do you want me to add a feature request for that at buildship repo linking this issue?

@cdietrich
Copy link
Member

cdietrich commented Jan 10, 2022

at least you can hint them on the issue.
https://github.com/eclipse/buildship

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants