# Multi-project dependency on plain Eclipse project without altering eclipse files

**URL:** <https://discuss.gradle.org/t/multi-project-dependency-on-plain-eclipse-project-without-altering-eclipse-files/26507>\
**Category:** Buildship\
**Created:** [April 5, 2018, 6:59am UTC](https://discuss.gradle.org/t/multi-project-dependency-on-plain-eclipse-project-without-altering-eclipse-files/26507 "2018-04-05T06:59:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcodelpercio](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@marcodelpercio](https://discuss.gradle.org/u/marcodelpercio)\
**Post date:** [April 5, 2018, 6:59am UTC](https://discuss.gradle.org/t/multi-project-dependency-on-plain-eclipse-project-without-altering-eclipse-files/26507/1 "2018-04-05T06:59:29Z")

</div>

Hi,

We’d like to move some of our projects to Gradle (we use Eclipse/buildship) however  
in a normal eclipse workspace we have several projects that often work together.  
While some projects belong exclusively to a single EAR there’re a number of common  
projects which are used as well in other contexts that are not ready to move to Gradle  
and yet are still needed for the sake of build path or as libraries inside the ear.

Example

EclipseWorkspace  
±-EarProjA  
±-EJBProjA  
±-WebProjA  
±-JPAProjA  
±-JPAProjCommon  
±-CommonProj1  
±-CommonProj2

Everything in this workspace is required for EarProjA and any other project which ends as “ProjA”  
is used excusively for EarProjA so I could easily add a Gradle nature to them and manage  
their build/dependencies via Gradle.  
The problem are the common projects which are used for EarProjA as well as for other Ears in different  
workspaces, I cannot add a Gradle nature to them because that would mess up their Eclipse files  
and .classpath/.project/etc… causing a problem for other developers who are working with such projects in other workspaces and don’t use gradle.

I tried to refer to such projects via include, for example:

```
include ":CommonProj1"
project(':CommonProj1').projectDir = new File(settingsDir, '../CommonProj1') 

```

but the result is that when I Refresh the Gradle Project in Eclipse  
it automatically turns CommonProj1 into a Gradle project altering its .project/.classpath/etc…

What’s the best way to handle such projects?

Many thanks

---

<div class="post-metadata">

**Author:** ![donat](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/donat/32/7798_2.png) [@donat](https://discuss.gradle.org/u/donat)\
**Post date:** [April 6, 2018, 7:55am UTC](https://discuss.gradle.org/t/multi-project-dependency-on-plain-eclipse-project-without-altering-eclipse-files/26507/2 "2018-04-06T07:55:47Z")

</div>

This is how Buildship works. When you import a project then all subprojects will be configured based on the configuration in the build scripts. However, if need to influence the `.classpath` file content you can do it in the `eclipse.classpath.file.whenMerged {}` block. You’ll find examples [here](https://discuss.gradle.org/t/buildship-1-0-18-is-now-available).
