Skip to main content



      Home
Home » Modeling » TMF (Xtext) » refresh dependecies before importing the project on eclipse(Follow weird steps while trying to import project on Eclipse)
refresh dependecies before importing the project on eclipse [message #1833538] Fri, 16 October 2020 05:48 Go to next message
Eclipse UserFriend
Hi guys, I've a simple Xtext that works just fine on my machine.

However, whenever I try to import it on a new pc I should always:
1. clone from the repo
2. perform `gradle build --refresh-dependecies`
3. import the project in Eclipse DSL
4. restore the .classpath file which gets overwritten by Eclipse

Correct .classpath that makes the project work
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry kind="src" path="src-gen"/>
	<classpathentry kind="src" path="xtend-gen"/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
	<classpathentry kind="output" path="target/classes"/>
</classpath>


Wrong .classpath overwritten by Eclipse while importing the 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="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-11/"/>
	<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
	<classpathentry kind="output" path="bin/default"/>
</classpath>


I've discovered this steps via a lot of trial and error but now I would like to finally fix the project (being able to avoid steps 2 and 3 while installing it somewhere)

I've searched online, but, not knowing much of gradle or maven, I didn't get that far. I was wondering if any of you as any idea on what is happening inside my codebase.

Thank you for your help.

[Updated on: Fri, 16 October 2020 05:48] by Moderator

Re: refresh dependecies before importing the project on eclipse [message #1833541 is a reply to message #1833538] Fri, 16 October 2020 05:52 Go to previous message
Eclipse UserFriend
there is no both
either eclipse
or gradle

in your case the gradle eclipse integration does update the .classpath files to be gradle way.

see also https://docs.gradle.org/current/userguide/eclipse_plugin.html#sec:eclipse_customizing_the_generated_files

[Updated on: Fri, 16 October 2020 05:58] by Moderator

Previous Topic:Path Expression Issue
Next Topic:Performance issue in QueuedBuildData
Goto Forum:
  


Current Time: Fri Jul 04 03:38:04 EDT 2025

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

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

Back to the top