Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between baseName and archivesBaseName in gradle war plugin?

Tags:

gradle

war

I was looking at gradle's war plugin docs when I noticed that there is baseName which defaults to archivesBaseName. There is another plugin which is using archivesBaseName instead of baseName. I wanted to suggest them to use baseName instead of default value but I am not sure what is the difference.

So what is the difference?

like image 794
Aseem Bansal Avatar asked Jul 15 '15 12:07

Aseem Bansal


People also ask

What is rootDir in Gradle?

rootDir. The root directory of this project. The root directory is the project directory of the root project. rootProject. The root project for the hierarchy that this project belongs to.

What is bootJar in Gradle?

bootJar on the other hand is a specific task added by Spring Boot Gradle plugin that, when the java plugin is present, attaches itself to the assemble lifecycle task. The assemble task is automatically configured to depend upon the bootJar task so running assemble (or build ) will also run the bootJar task.

What is allprojects in Gradle?

The " allprojects " section is for the modules being built by Gradle. Oftentimes the repository section is the same for both, since both will get their dependencies from jcenter usually (or maybe maven central). But the "dependencies" section will be different.


1 Answers

The link you are referencing is for the War task not the plugin. The task has a property named baseName which is used for naming the archive created by the task. The archivesBaseName property on the other hand is a convention property added to the project by the 'base' plugin. This property is used as the default value for baseName.

Basically, the archivesBaseName property is set as the project level and baseName at the task level. Setting archivesBaseName will apply to all archive tasks (Zip, Jar, War, Ear, Tar) and can be overriden for individual archive tasks by setting the task's baseName property.

like image 54
Mark Vieira Avatar answered Sep 17 '22 13:09

Mark Vieira