Gradle analog of Maven archetype?

What is the Gradle analog of Maven archetypes? How can I provide other Gradle users with a template for file and directory layout for a new project?

+44
maven maven-archetype gradle
Jul 17 2018-12-17T00:
source share
7 answers

Gradle does not support this (yet). An open function request is already open there.

+6
Jul 17 2018-12-17T00:
source share

Use the build init plugin :

~$ mkdir newproj ~$ cd newproj ~/newproj$ gradle init --type java-library 

Currently supported are java-library , scala-library , groovy-library , java-application , pom and basic . The function is incubated, so it can be changed in future releases, so keep an eye on the documents.

+38
Sep 25 '13 at 9:45
source share

While this is not yet supported by Gradle, the gradle: templates plugin looks promising:

+3
Jul 18 '12 at 19:52
source share

Gradle does not support the built-in archetypal function , but you can use a plugin called Gradle templates

More details:
Does gradle have Maven functionality as an archetype?
Gradle archetype problem

+2
May 09 '15 at 19:30
source share

I also looked for this function and found that it is a little harder to have a complex project template to work with https://github.com/townsfolk/gradle-templates .

So, I created this plugin, it is very similar to the function of the Maven archetype. https://github.com/orctom/gradle-archetype-plugin/

+1
Mar 02 '16 at 12:51 on
source share

If you are using the spring framework on Linux: you can use http://start.spring.io/ or, alternatively, install the Spring CLI

 $ curl -s "https://get.sdkman.io" | bash $ sdk install springboot $ spring --version Spring Boot v1.3.5.RELEASE $ spring init --build gradle --name test --groupId com.test Using service at https://start.spring.io Content saved to 'demo.zip' $ unzip demo.zip 
+1
May 13 '16 at 15:05
source share
As far as I know, there is no gradle. However, in most cases, the following steps are sufficient:
  • Create a project with maven and your choice of maven archetype.
  • Convert maven project to gradle project. You can do this by running the following command in the directory where your pom.xml wizard is located:

    gradle init

It is assumed that it will work with all basic maven archetypes.

0
Jul 07 '15 at 8:20
source share



All Articles