Closed rising3 closed 2 years ago
I have a problem, creating a simple Spring Boot project in spring.io, and after adding and running the plugin I got:
$ ./gradlew semver --patch --info
Initialized native services in: /home/recicla-mate2020/.gradle/native
Initialized jansi services in: /home/recicla-mate2020/.gradle/native
The client will now receive all logging from the daemon (pid: 437066). The daemon log file: /home/recicla-mate2020/.gradle/daemon/7.3.2/daemon-437066.out.log
Starting 4th build in daemon [uptime: 16 mins 53.427 secs, performance: 100%, non-heap usage: 30% of 256 MiB]
Using 4 worker leases.
Now considering [/home/recicla-mate2020/Descargas/demo] as hierarchies to watch
Watching the file system is configured to be enabled if available
File system watching is active
Starting Build
Settings evaluated using settings file '/home/recicla-mate2020/Descargas/demo/settings.gradle'.
Projects loaded. Root project using build file '/home/recicla-mate2020/Descargas/demo/build.gradle'.
Included projects: [root project 'demo']
> Configure project :
Evaluating root project 'demo' using build file '/home/recicla-mate2020/Descargas/demo/build.gradle'.
Applying dependency management to configuration 'bootArchives' in project 'demo'
Applying dependency management to configuration 'archives' in project 'demo'
Applying dependency management to configuration 'default' in project 'demo'
FAILURE: Build failed with an exception.
* Where:
Build file '/home/recicla-mate2020/Descargas/demo/build.gradle' line: 5
* What went wrong:
An exception occurred applying plugin request [id: 'java']
> Failed to apply plugin class 'org.gradle.api.plugins.JavaBasePlugin'.
> Task with name 'jar' not found in root project 'demo'.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
I think this was added in v0.6.0, here:
@BrayanCaro
Thank you for reporting.
@BrayanCaro
Hi, The dependency problem of gradle tasks will be addressed in the next version.
You can work around this problem by changing the order of the java plugins.
plugins {
id 'org.springframework.boot' version '2.6.2'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id 'com.github.rising3.semver' version '0.7.1'
}
Putting the plugin at the bottom solved the issue, thank you! :smile:
When creating the JAR, the version cannot be resolved from the tag, so the latest version may not be available.
Fix as follows.