# Idea modules containing itself as dependencies

**URL:** <https://discuss.gradle.org/t/idea-modules-containing-itself-as-dependencies/21541>\
**Category:** Help/Discuss\
**Created:** [February 10, 2017, 10:41am UTC](https://discuss.gradle.org/t/idea-modules-containing-itself-as-dependencies/21541 "2017-02-10T10:41:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adriantodt](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/adriantodt/32/5946_2.png) [@adriantodt](https://discuss.gradle.org/u/adriantodt)\
**Post date:** [February 10, 2017, 10:41am UTC](https://discuss.gradle.org/t/idea-modules-containing-itself-as-dependencies/21541/1 "2017-02-10T10:41:43Z")

</div>

Hi,

I’m using a Grade Project to rule a multiple module project on IntelliJ, but it’s generating an .iml containing itself as dependency.

My Gradle settings:  
`/settings.gradle`:

```gradle
rootProject.name = 'PyxelMyst'
include 'api', 'api-impl', 'common', 'client', 'server', 'desktop', 'desktop-client', 'desktop-server', 'android-client'

```

root `build.gradle`:

```gradle
buildscript {
    repositories {
        mavenLocal()
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
		classpath 'org.codehaus.groovy:groovy-android-gradle-plugin:1.1.0'
    }
}

allprojects {
    version = '1.0'

    ext {
        appName = "PyxelMyst"
        gdxVersion = '1.9.5'
        aiVersion = '1.8.0'
    }

    repositories {
        mavenLocal()
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url "https://oss.sonatype.org/content/repositories/releases/" }
    }
}

```

each module’s `build.gradle`:

```gradle
apply plugin: "groovy"

sourceCompatibility = 1.7

dependencies {
	compile project(":common") //and/or other modules required
	compile "com.badlogicgames.gdx:gdx-controllers:$gdxVersion" //or other GDX required dependency
}

compileGroovy.options.encoding = 'UTF-8'

jar.baseName = rootProject.name + "-" + project.name

```

And all projects generate a project`.iml` like:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":client" ...>
    ...
    <orderEntry type="library" exported="" name="client.PyxelMyst-client-1.0" level="project" />
  </component>
</module>

```

with that last `orderEntry` containing the library built by the module/project itself. This causes IntelliJ to comply that the project “already have every single class”, but this is not because I can build all projects without problem.

Is there a way to either remove the IntelliJ’s fake self-dependency? I already spent 4 hours trying to fix this and I can’t get it to work.

All projects only have `apply plugin: "groovy"` with exception of the Android Project. Also I didn’t edited the Project Structure of IntelliJ. And all `build.gradle`s are based on the one that I sent and all `.iml`s have self-dependency.  
Also, I have sure that the modules doesn’t create a cyclic dependency and I’m not using a `idea` plugin to generate the `.iml`s., just the regular IntelliJ Gradle support. Also, the Android and Desktop-Client/Server modules (The ones I deploy) don’t generate the self-dependency, but the other project does.

Thanks in Advice,

Adrian

---

<div class="post-metadata">

**Author:** ![zeebo404](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/zeebo404/32/6270_2.png) [@zeebo404](https://discuss.gradle.org/u/zeebo404)\
**Post date:** [July 6, 2017, 2:35pm UTC](https://discuss.gradle.org/t/idea-modules-containing-itself-as-dependencies/21541/2 "2017-07-06T14:35:59Z")

</div>

Did you ever find the solution to this? I am having the exact same problem.

Interesting that I am also using libgdx. I wonder if that has something to do with it.

---

<div class="post-metadata">

**Author:** ![st\_oehme](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/st_oehme/32/5249_2.png) [@st\_oehme](https://discuss.gradle.org/u/st_oehme)\
**Post date:** [July 6, 2017, 2:40pm UTC](https://discuss.gradle.org/t/idea-modules-containing-itself-as-dependencies/21541/3 "2017-07-06T14:40:17Z")

</div>

A reproducible example project would greatly increase the chances of finding/fixing the issue.
