semantic-version-gradle-plugin icon indicating copy to clipboard operation
semantic-version-gradle-plugin copied to clipboard

Failed to apply plugin due to missing project version, when there is one in build.gradle.kts

Open vizardespa opened this issue 2 years ago • 3 comments

Describe the bug After adding the plugin to the "plugins" block section and running the configure task "prepareKotlinBuildScriptModel", the semantic-version-gradle-plugin fails during the apply phase due to a missing project version that is actually in place.

To Reproduce Steps to reproduce the behavior:

  1. Have a springboot 3.0.1 project with gradle 7.6 and a Kotlin-based build.gradle.kts
  2. Add "version" to build.gradle.kts
  3. Add "com.dipien.semantic-version" (version 2.0.0) to the plugins block section
  4. Run configure task "prepareKotlinBuildScriptModel"
  5. See error

Expected behavior It should detect the project's version so the plugin can be successfully applied

Screenshots Screenshot 2023-03-01 at 3 21 32 PM Screenshot 2023-03-01 at 1 46 05 PM

Additional context I suspected it would be caused by a race condition of not having the project object created during the "Add/Apply Plugins" section, and added the workaround on not applying the plugin until the task "prepareKotlinBuildScriptModel" is done and it seems to be working perfectly fine after that:

Screenshot 2023-02-28 at 6 19 12 PM

Nevertheless, this workaround should not be needed.

vizardespa avatar Mar 01 '23 23:03 vizardespa

Hi. The plugin doesn't support the new way to apply plugins. You should use the legacy way, as described on the readme

maxirosson avatar Mar 02 '23 01:03 maxirosson

Hey I am having the same issue. How about a update to support the new way of declaring plugins?

Zeyad-37 avatar Mar 03 '23 15:03 Zeyad-37

Hello. I have the same issue.

terrium88 avatar May 16 '23 06:05 terrium88