Skip to content

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

@vizardespa

Description

@vizardespa

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions