# Embedding gradle - retrieving project info

**URL:** <https://discuss.gradle.org/t/embedding-gradle-retrieving-project-info/7204>\
**Category:** Old Forum Archive\
**Created:** [March 19, 2013, 6:46pm UTC](https://discuss.gradle.org/t/embedding-gradle-retrieving-project-info/7204 "2013-03-19T18:46:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michal\_Matloka](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/michal_matloka/32/560_2.png) [@Michal\_Matloka](https://discuss.gradle.org/u/Michal_Matloka)\
**Post date:** [March 19, 2013, 6:46pm UTC](https://discuss.gradle.org/t/embedding-gradle-retrieving-project-info/7204/1 "2013-03-19T18:46:00Z")

</div>

I’m starting work on ShrinkWrap Resolver Gradle integration ([http://forums.gradle.org/gradle/topics/dependency\_resolution\_with\_gradle\_for\_arquillian\_tests](http://forums.gradle.org/gradle/topics/dependency_resolution_with_gradle_for_arquillian_tests) [https://issues.jboss.org/browse/SHRINKRES-116](https://issues.jboss.org/browse/SHRINKRES-116)).

However I have a few questions - manual in chapter embedding gradle mainly focues on building process. 1. I think I have to use gradle core package available on maven repo in order to fully embedded gradle? 2. How to get Project interface instance basing on build.gradle file, so that then I can get info about projects dependencies etc?

---

<div class="post-metadata">

**Author:** ![daz](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/daz/32/2475_2.png) [@daz](https://discuss.gradle.org/u/daz)\
**Post date:** [March 20, 2013, 4:25pm UTC](https://discuss.gradle.org/t/embedding-gradle-retrieving-project-info/7204/2 "2013-03-20T16:25:00Z")

</div>

The supported mechanism for embedding Gradle is the Tooling API, which is briefly described in the [User Guide](http://www.gradle.org/docs/nightly/userguide/embedding.html). The Tooling API is quite sophisticated in that it is both forward and backward compatible with different Gradle versions: so you can embed the Tooling API v1.4, and you’ll still be able to access information about a build that uses features introduced in Gradle v1.6.

Because of this, the model presented by the Tooling API is an abstraction over the core Gradle Project model. So far, this abstraction has been targeted as IDE integrators, but it should also be useful for other embedding use cases.

So the answer to “how can I get a Project interface instance” using the Tooling API is that you can’t. But getting information about the project dependencies is possible using either the IDEA or Eclipse project model. In the future we’d like to add this capability to the generic “GradleModel”, but that hasn’t happened yet. Check out the Tooling API samples for how this can be done.

I don’t really understand what you’re trying to achieve, so I’m not sure that the Tooling API will have the capabilities you’re looking for. But take a look and let us know if there’s something missing.

---

<div class="post-metadata">

**Author:** ![Rene](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/rene/32/8082_2.png) [@Rene](https://discuss.gradle.org/u/Rene)\
**Post date:** [October 22, 2013, 12:06pm UTC](https://discuss.gradle.org/t/embedding-gradle-retrieving-project-info/7204/3 "2013-10-22T12:06:00Z")

</div>

Hello Michał, Are there any news about the ShrinkWrap gradle resolver? I saw a rough implementation at github, but not merged into the ShrinkWrap master. furthermore I was not able to build the project to test it on my own. I’m happy to support you if you need help. I would really love to see a ShrinkWrap gradle resolver. That’s a big step in smooth arquillian integration. ATM I need to manually create a pom out of the gradle dependencies and use the mavenresolver instead or add the libs completely manually

cheers, René

---

<div class="post-metadata">

**Author:** ![Michal\_Matloka](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/michal_matloka/32/560_2.png) [@Michal\_Matloka](https://discuss.gradle.org/u/Michal_Matloka)\
**Post date:** [October 22, 2013, 1:02pm UTC](https://discuss.gradle.org/t/embedding-gradle-retrieving-project-info/7204/4 "2013-10-22T13:02:00Z")

</div>

Hi René,

I haven’t touched this implementation since pushing that prototype to SWR branch. Before integration in master we need some additional testing on real Gradle projects (I currently dont use gradle at work). I lack a gradle knowledge in some areas, e.g. how to correctly determine the jar/war output file name in order to retrieve this build result.

What were your problems with building the project?

Michał

---

<div class="post-metadata">

**Author:** ![Michal\_Matloka](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/michal_matloka/32/560_2.png) [@Michal\_Matloka](https://discuss.gradle.org/u/Michal_Matloka)\
**Post date:** [November 3, 2013, 12:46am UTC](https://discuss.gradle.org/t/embedding-gradle-retrieving-project-info/7204/5 "2013-11-03T00:46:00Z")

</div>

ping 🙂

---

<div class="post-metadata">

**Author:** ![Michal\_Matloka](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/michal_matloka/32/560_2.png) [@Michal\_Matloka](https://discuss.gradle.org/u/Michal_Matloka)\
**Post date:** [December 7, 2013, 11:38am UTC](https://discuss.gradle.org/t/embedding-gradle-retrieving-project-info/7204/6 "2013-12-07T11:38:00Z")

</div>

Help needed 🙂 [http://forums.gradle.org/gradle/topics/gradle\_tooling\_api\_build\_during\_arquillian\_deployment\_creation\_classnotfoundexception\_saxparserfactory](http://forums.gradle.org/gradle/topics/gradle_tooling_api_build_during_arquillian_deployment_creation_classnotfoundexception_saxparserfactory)

---

<div class="post-metadata">

**Author:** ![Vikas\_Bali](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@Vikas\_Bali](https://discuss.gradle.org/u/Vikas_Bali)\
**Post date:** [March 26, 2014, 1:57pm UTC](https://discuss.gradle.org/t/embedding-gradle-retrieving-project-info/7204/7 "2014-03-26T13:57:00Z")

</div>

I saw the subtask is marked as resolved… Do we have sample code which explain how this would work now ?

---

<div class="post-metadata">

**Author:** ![Michal\_Matloka](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/michal_matloka/32/560_2.png) [@Michal\_Matloka](https://discuss.gradle.org/u/Michal_Matloka)\
**Post date:** [March 26, 2014, 2:02pm UTC](https://discuss.gradle.org/t/embedding-gradle-retrieving-project-info/7204/8 "2014-03-26T14:02:00Z")

</div>

Hi, The version was not yet release to the nexus, but here is the example usage [https://github.com/mmatloka/arquillian-gradle-sample](https://github.com/mmatloka/arquillian-gradle-sample) (still using locally built snapshot, I will upgrade it when SWR will be released), and here the main implementation classs: [https://github.com/shrinkwrap/resolver/blob/master/impl-gradle-embedded-archive/src/main/java/org/jboss/shrinkwrap/impl/gradle/archive/importer/embedded/EmbeddedGradleImporterImpl.java](https://github.com/shrinkwrap/resolver/blob/master/impl-gradle-embedded-archive/src/main/java/org/jboss/shrinkwrap/impl/gradle/archive/importer/embedded/EmbeddedGradleImporterImpl.java)

---

<div class="post-metadata">

**Author:** ![Michal\_Matloka](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/michal_matloka/32/560_2.png) [@Michal\_Matloka](https://discuss.gradle.org/u/Michal_Matloka)\
**Post date:** [April 15, 2014, 10:33pm UTC](https://discuss.gradle.org/t/embedding-gradle-retrieving-project-info/7204/9 "2014-04-15T22:33:00Z")

</div>

I have pushed updated sample [https://github.com/mmatloka/arquillian-gradle-sample/](https://github.com/mmatloka/arquillian-gradle-sample/) to use the SWR 2.2.0-alpha-1
