Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle counterpart to Maven archetype?

What is the Gradle counterpart to Maven archetypes? How can I give other Gradle users a template for the file and directory layout for a new project?

like image 506
deamon Avatar asked Jul 17 '12 14:07

deamon


People also ask

What is equivalent to Gradle task in Maven?

Gradle is based on a graph of task dependencies – in which tasks are the things that do the work – while Maven is based on a fixed and linear model of phases. With Maven, goals are attached to project phases, and goals serve a similar function to Gradle's tasks, being the “things that do the work.”

Can I use Gradle instead of Maven?

In the end, what you choose will depend primarily on what you need. Gradle is more powerful. However, there are times that you really do not need most of the features and functionalities it offers. Maven might be best for small projects, while Gradle is best for bigger projects.

How does Gradle differ from Maven?

The biggest differences are Gradle's mechanisms for work avoidance and incrementality. The top 3 features that make Gradle much faster than Maven are: Incrementality — Gradle avoids work by tracking input and output of tasks and only running what is necessary, and only processing files that changed when possible.


1 Answers

Use build init plugin:

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

At the moment java-library, scala-library, groovy-library, java-application, pom and basic supported. The feature is incubating, thus it can be changed in future releases, so keep an eye on docs.

like image 185
pavel_kazlou Avatar answered Nov 15 '22 12:11

pavel_kazlou