1

I am using Eclipse Mars.2 (4.5.2) and Gradle IDE 3.7.3.201602250836-RELEASE. How can I add a custom "sample project" to the "New Gradle Project" wizard?

It's annoying to have to do the same cleanup steps to remove the sample stuff each time I create a new project. I'd really like to start off with a defaults configured to my environment and preferences.

This is the wizard I'm talking about. It's accessed via New Project -> Other -> Gradle (STS) -> Gradle (STS) Project.

IImage of New Gradle Project Wizard

Kaypro II
  • 3,210
  • 8
  • 30
  • 41

1 Answers1

1

Gradle doesn't really have an equivalent of maven-archetypes. The sample projects you're seeing in that drop down box are provided by the STS eclipse extension itself. You're out of luck if you're trying to add your own templates to the dropdown box, unless if you modify the code of the eclipse plugin. You can find the source code here:

https://github.com/spring-projects/eclipse-integration-gradle/blob/a1d5554b1c0b0faf8a48b7585ac5371aa9a59793/org.springsource.ide.eclipse.gradle.core/src/org/springsource/ide/eclipse/gradle/core/samples/SampleProjectRegistry.java

The comment banner in there says:

Instance of this class is responsible for knowing all the sample projects that can be used by the New Gradle Project Wizard.

For now the registry is not extensible. The samples are more or less hard-code in here. In the future we might create an extension point to register the samples from external plugins.

They're pulling a few samples from the gradle-ver-all.zip distribution here

RaGe
  • 22,696
  • 11
  • 72
  • 104