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?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With