Skip to content
This repository has been archived by the owner on Jul 9, 2022. It is now read-only.
kdvolder edited this page Aug 1, 2012 · 5 revisions

Table of Contents

FAQ

What functionality is provided?

In a nutshell, we provide the following:

For more details see the links on this Wiki's home page.

The Gradle STS support is built upon a new tooling API that is being developed as part of Gradle itself. As this API is fleshed out, the set of features in our tools will also expand.

What types of projects are supported?

The current version of the Gradle Tooling API only provides information about the "Java" aspects of a project. That is, things such as the classpath, project dependencies and source folders. The current version of Gradle STS support therefore only explicitly provides support for "plain Java" projects.  In Eclipse terms, if your Eclipse project only requires the Java project nature then it is supported, otherwise it is not supported yet.

However, since version 2.8.0 we also attempt to support additional project types (WTP, AspectJ, ...) via an indirect method.

Much like you could already use the gradle-eclipse plugins in Gradle itself to generate the Eclipse metadata our tools now allow you to execute these tasks as part of tool's workflow.

For example, the import wizard provides an explicit option to run tasks 'cleanEclipse' and 'eclipse' as part of the import operation; and it will do its best to preserve any additional information it finds already existing in the project before making its own customizations.

My Java level (1.6 | 1.5) and libraries are not setup right. Why not?

The Gradle Tooling API does not (yet) tell us this information so we cannot set it up automatically. You will just get your workspace defaults.

Is there support for editing ".gradle" files?

As of STS 2.9.0.M2 there is somewhat better support for editing .gradle files. This requires that you install a recent version of Groovy Eclipse (2.7.x is required for STS 3.0.0 gradle editor support).

If a compatible version of Groovy Eclipse is installed, STS-Gradle will provide an option in its Gradle menu to 'Enable DSLD Support'. This will add some customizations to your project to enable Groovy Eclipse on your project and contribute a DSL Descriptor. This DSL Descriptor is currently quite limited and a work in progress. However you will already get some useful code-assist and JavaDoc hovers if it is turned on.

We know there is much work to be done here, and many clever things are possible (e.g. content assisting for dependencies/version numbers by using knowledge available from the selected dependency repository).

Make sure to install a recent version of Groovy Eclipse. Groovy-Eclipse can easily be installed from the STS dashboard, or the most recent dev build via this update site

http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.7/

The Groovy-Eclipse project homepage< provides the comprehensive list of available update sites.

Why does importing a Gradle project take so long?

Longer version of this question: When I open the import wizard and click the "Build Model" button, this seems to take a long time. Also, it seems to download a lot of stuff. Why does it do that?

Answer: Gradle needs to understand your project's structure to be able to build the project/sub-project structure model. This means it needs to understand (at least to some degree) your gradle script. However, a Gradle script is essentially a program. To understand this program Gradle needs to download at least some of the dependencies that the program itself relies upon. Unfortunately this takes time and can not be avoided. If you have already been running gradle builds of your project outside of STS before importing the project, you will find it is pretty quick because the dependencies have all already been downloaded.

Why does the progress bar behave funny?

The Gradle Tooling API upon which we built does not provide real progress information (yet). The progress bar that you see is currently just a guesstimate at progress information, almost more of a 'Yes, I am still alive' monitor right now.

Why can't I cancel any of the Gradle related operations in STS?

The Gradle Tooling API upon which we built does not provide a way to cancel long running operations (yet).

What versions of Gradle are supported?

Currently we ship with an embdedded copy of the Gradle 1.0 Tooling API. The tooling API intends to support working with a range of Gradle versions. At this point, we recommend that you use at least Gradle 1.0, but you may be able to use the tools with versions as far back as 1.0-M3. We don't recommend this however.

Can I use the Gradle Tools with a Plain Eclipse?

Yes, this has always been possible though it was somewhat complex to install all the dependencies. The installation procedure to install just the Eclipse-Integration-Gradle support into a plain Eclipse has been greatly simplified for version 3.0.0. You now just need a single udate site!

Please see the project's README file for detailed instructions and update site URLs.

How do I import an existing Gradle project?

Use the Gradle Import Wizard.

If you have a project that already has a build script that uses Gradle's eclipse-plugin then the following options will provide the path of least resistance (i.e. an import process that mimics closely what you are probably now doing manually.)

  • Disable Dependency Management
  • Disable DSL Support
  • make sure 'run before task' option is set to execute 'cleanEclipse' and 'eclipse' tasks (this is the default setting)

If that works for you, then you can try enabling rather than disabling these options to turn on more of the tooling's feature to test whether these feature's are compatible with your build.

How do I make STS update dependencies after I edited my .gradle file?

In the future, this will probably be automatic, however presently you have to force a refresh manually by using one of the context menu items in the "Gradle" menu, accessible by right clicking on your project.

There are few different options there to 'Refresh' things in your project.

How do I run a task?

Short answer "Windows >> Show View >> Other >> Gradle Tasks".

After opening this view double click on any task to run it.

For a longer answer see the documentation for the Gradle Task UI.

How do I debug a task?

The tools don't currently provide debugging support for launched Gradle tasks.

How do I create a new Gradle project in STS?

Use the New Gradle Project Wizard accessible via menu "File >> New >> Project" under the category "Gradle".

Why is my project/sub-project hierachy "flattened" by the import wizard?

This is because Eclipse (and therefore STS) doesn't have the concept of nested projects. We therefore translate the Gradle project hierarchy into an equivalent flat list of projects that Eclipse can work with.

I imported some Gradle projects but can't find them in my workspace folder on disk, where are they?

They are still in the same place they were before you imported them. The import wizard does not actually copy any files into the STS/Eclipse workspace folder. Instead it creates a linked representation. Each project in your workspace (as shown inside STS) actually points to the original project location on disk where you imported it from. The reason why we do this is because we want to maintain the underlying file system structure (which determines the Gradle project/sub-project) hierarchy. At the same time, to satisfy Eclipse, we need to map these nested projects onto a flat list of Eclipse projects. Using a linked representation it is possible to have both a nested structure on disk and a flattened representation inside the Eclipse workspace at the same time. See also the previous question.

Why doesn't the Gradle import wizard have a "copy resources into workspace" option?

That is because to maintain the project/sub-project relationship we always use a linked project representation. Read the answer to the previous two questions also for more of an explanation why we do this.

Where can I ask more questions?

If you have questions about the STS Gradle tooling, the STS Forum is a good place.

If you have questions about Gradle, please consult the Gradle Help & Support page.

Where can I report a bug?

If your bug is related to the STS Gradle tooling use the STS issue tracker.

If your bug is related to Gradle itself,please consult the Gradle Help & Support page.

If you don't know for sure which one it is, make your best guess.

When filing a bug report, please try to be as precise as possible about how the bug can be reproduced. Good bug reports have a much better chance of getting fixed. Problems that can't be reproduced by us will probably not get fixed.

What is UAA?

If you haven't installed any STS components before, after you installed the Gradle tooling and restart Eclipse you will be prompted by Spring UAA, so naturally you might wonder what it is, why you are being prompted, and what it means to accept or reject the UAA agreement.

For details please see the Spring User Agent Analysis FAQ and the UAA Terms of Use

From the Spring User Agent Analysis FAQ:

Spring UAA helps us gain a better understanding of how people are using Spring technologies. Of course your privacy is of paramount importance. For this reason Spring UAA does not operate unless you explicitly authorize it to, and any data it sends is completely anonymous.

One good reason to allow the UAA to collect your data is that if you are using the STS Gradle tooling, your usage data is an implicit vote for us to continue developing it.

How can I disable the STS Dashboard?

Open the preferences with menu "Window >> Preferences" then search for 'Dashboard' find the checkbox option "Show Dashboard on startup" and disable it.

Should I run ".\gradlew eclipse" before importing my project(s)

Ideally you should not have to. Ideally the import wizard would configure every aspect of your project correctly by querying the Gradle Tooling API for the required information. However, in reality, the Tooling API at this time only provides very limited information (see above "What types of projects are supported?". If any of your projects/subprojects requires natures not in the supported list, you can try to "fill the gap" by leveraging the generated eclipse configuration files. This works relatively well because the import wizard attempts as much as possible not to touch configuration information that cannot be requested from the Tooling API.

Recent versions of our tools accept this simply as a 'fact of life' and even provide the option to run these tasks automatically from the import wizard by default.