Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails with Gradle configuration cache enabled #884

Open
sergeykad opened this issue Feb 8, 2024 · 8 comments
Open

Fails with Gradle configuration cache enabled #884

sergeykad opened this issue Feb 8, 2024 · 8 comments
Milestone

Comments

@sergeykad
Copy link

Running on Gradle 8.6 with enabled configuration cache results in the following failure:

* What went wrong:
Some problems were found with the configuration of task ':mymodule:generateJsonSchema2DataClassConfigMain' (type 'Js2pGenerationTask').
  - Type 'org.jsonschema2dataclass.js2p.Js2pGenerationTask' property 'js2dConfiguration' doesn't have a configured value.
    
    Reason: This property isn't marked as optional and no value has been configured.
    
    Possible solutions:
      1. Assign a value to 'js2dConfiguration'.
      2. Mark property 'js2dConfiguration' as optional.
    
    For more information, please refer to https://docs.gradle.org/8.6/userguide/validation_problems.html#value_not_set in the Gradle documentation.
  - Type 'org.jsonschema2dataclass.js2p.Js2pGenerationTask' property 'js2dConfigurationPlugins' doesn't have a configured value.
    
    Reason: This property isn't marked as optional and no value has been configured.
    
    Possible solutions:
      1. Assign a value to 'js2dConfigurationPlugins'.
      2. Mark property 'js2dConfigurationPlugins' as optional.
    
    For more information, please refer to https://docs.gradle.org/8.6/userguide/validation_problems.html#value_not_set in the Gradle documentation.

@eirnym
Copy link
Collaborator

eirnym commented Feb 8, 2024

Thank you for an issue.

There was an issue #788 for exactly that.

Patch wasn't successful though for Java >= 11. I'll be glad if you have a proper solution.

@eirnym eirnym added this to the 7.0.0 milestone Feb 8, 2024
@sergeykad
Copy link
Author

sergeykad commented Feb 11, 2024

With the latest Java LTS being 21 I am guessing most of the projects are on Java 11+ by now.
Unfortunately, I do not have experience in Kotlin or writing Gradle plugins, so I probably will not be able to help much. Maybe it's just adding the @Optional annotation as mentioned in the documentation?

@eirnym
Copy link
Collaborator

eirnym commented Feb 11, 2024

Kotlin is quite similar to Java even syntax is not the same. Don't worry about imperfect styling

Optional is not the case as information in the configuration is mandatory.

So it's important to find which variable has not been fulfilled for Gradle.

There's a disabled test which you can use and add an additional argument to pass a debug argument. In GradleVersions.kt there's listed all gradle versions to be tested, almost all of them can be disabled by commenting out or an environment variable to be passed.

Could you please help me?

@eirnym
Copy link
Collaborator

eirnym commented Feb 12, 2024

Hi @sergeykad, I probably fixed the issue. Presumably, configurations must be visible to be cacheable. We'll see how tests will go.

@sergeykad
Copy link
Author

Hi @eirnym, sorry for nagging, but when do you think you will be able to release version 7? The last release was over a year ago.

@eirnym
Copy link
Collaborator

eirnym commented Jun 5, 2024

Thank you for nagging actually. Sorry for keeping you waining.

@sergeykad
Copy link
Author

Hi @eirnym , any news regarding when you will release a new version?
This is the only issue that keeps us from using the configuration cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants