While building the gradle project I am getting below error- FAILURE: Build failed with an exception.
Where: Build file '/Users/vdubey/Documents/microservices/workspace/Promo-Service/build.gradle' line: 30
What went wrong: A problem occurred evaluating root project 'Promo-Service'.
Could not find method bootJar() for arguments [build_3jq74tz48uic808y18txabjvx$_run_closure1@5c4aa147] on root project 'Promo-Service' of type org.gradle.api.Project.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
Any clue why it is failing?
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 Spring Boot Gradle Plugin provides Spring Boot support in Gradle. It allows you to package executable jar or war archives, run Spring Boot applications, and use the dependency management provided by spring-boot-dependencies .
app-plain. jar is the archive produced by the jar task. This is a plain or standard jar file that contains only the module's classes and resources. You can learn a bit more about this in the documentation for Spring Boot's Gradle plugin.
Dependency is nothing but a 'Library' that provides specific functionality that we can use in our application. In Spring-Boot, Dependency Management and Auto-Configuration work simultaneously.
Consider checking the presence of gradle plugin for Spring Boot: https://plugins.gradle.org/plugin/org.springframework.boot
For Gradle 2.1 and later:
plugins {
id "org.springframework.boot" version "2.1.0.RELEASE"
}
For older Gradle versions:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.0.RELEASE"
}
}
apply plugin: "org.springframework.boot"
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