# Show compile dependencies only

**URL:** <https://discuss.gradle.org/t/show-compile-dependencies-only/6798>\
**Category:** Old Forum Archive\
**Created:** [October 16, 2012, 8:43pm UTC](https://discuss.gradle.org/t/show-compile-dependencies-only/6798 "2012-10-16T20:43:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Waschkowski1](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@Mark\_Waschkowski1](https://discuss.gradle.org/u/Mark_Waschkowski1)\
**Post date:** [October 16, 2012, 8:43pm UTC](https://discuss.gradle.org/t/show-compile-dependencies-only/6798/1 "2012-10-16T20:43:00Z")

</div>

Hi,

I’m looking for a way to get just compile configuration dependencies from the command line. Barring that, can I do it with a task?

I tried both :

gradle dependencies compile

and:

task showCompileDep \<\< {

println configurations.compile.dependencies }

but just starting off, so not working…

Thanks,

Mark

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [October 17, 2012, 5:35am UTC](https://discuss.gradle.org/t/show-compile-dependencies-only/6798/2 "2012-10-17T05:35:00Z")

</div>

Please use HTML ‘code’ tags for all code snippets.

```gradle
task showCompileDep << {
   println configurations.compile
}

```

Or, probably more readable:

```gradle
task showCompileDep << {
   configurations.compile.each { println it }
}

```

---

<div class="post-metadata">

**Author:** ![Mark\_Waschkowski1](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@Mark\_Waschkowski1](https://discuss.gradle.org/u/Mark_Waschkowski1)\
**Post date:** [October 17, 2012, 8:01pm UTC](https://discuss.gradle.org/t/show-compile-dependencies-only/6798/3 "2012-10-17T20:01:00Z")

</div>

OK, sounds great, thanks. I’ll just use a special task. Would be nice to be able to do it from the command line, something like:

```gradle
gradle dependencies.compile

```

Thanks again for the help!

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [October 17, 2012, 8:03pm UTC](https://discuss.gradle.org/t/show-compile-dependencies-only/6798/4 "2012-10-17T20:03:00Z")

</div>

I assume you are familiar with ‘gradle dependencies’.

---

<div class="post-metadata">

**Author:** ![Mark\_Waschkowski1](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@Mark\_Waschkowski1](https://discuss.gradle.org/u/Mark_Waschkowski1)\
**Post date:** [October 17, 2012, 8:35pm UTC](https://discuss.gradle.org/t/show-compile-dependencies-only/6798/5 "2012-10-17T20:35:00Z")

</div>

Oh yes, was just thinking of a refinement to that functionality as the amount of text you get from that command is huge - being able to look at one configuration at a time would be very helpful.

---

<div class="post-metadata">

**Author:** ![Szczepan\_Faber](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/szczepan_faber/32/213_2.png) [@Szczepan\_Faber](https://discuss.gradle.org/u/Szczepan_Faber)\
**Post date:** [October 19, 2012, 9:54am UTC](https://discuss.gradle.org/t/show-compile-dependencies-only/6798/6 "2012-10-19T09:54:00Z")

</div>

You can create an instance of dependencyReportTask:

```gradle
task compileDeps(type: DependencyReportTask) {
  configurations = [project.configurations.compile] as Set
}

```

We’re looking at adding more command line support to the dependency report. There might be some new way of specifying a configuration in the dependency report in 1.3 or 1.4. Something like: ‘gradle dependencies --configuration compile’.

---

<div class="post-metadata">

**Author:** ![Mark\_Waschkowski1](https://avatars.discourse-cdn.com/v4/letter/m/b5a626/32.png) [@Mark\_Waschkowski1](https://discuss.gradle.org/u/Mark_Waschkowski1)\
**Post date:** [October 24, 2012, 11:15am UTC](https://discuss.gradle.org/t/show-compile-dependencies-only/6798/7 "2012-10-24T11:15:00Z")

</div>

Thanks to everyone for the suggestions.

Thank you Szczepan, that is _exactly_ what I was looking for. I also look forward to 1.3 or 1.4 for the functionality you mentioned.

Please consider this closed.

Best,

Mark
