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

Support for configuration cache #8

Open
britter opened this issue Apr 10, 2020 · 8 comments
Open

Support for configuration cache #8

britter opened this issue Apr 10, 2020 · 8 comments
Labels
enhancement New feature or request
Milestone

Comments

@britter
Copy link
Owner

britter commented Apr 10, 2020

Instant execution is one of the upcoming features in Gradle. The plugin should support this.

@britter britter added this to the 0.3.0 milestone Apr 10, 2020
@britter britter added the enhancement New feature or request label Apr 11, 2020
@britter britter changed the title Support for instant execution Support for configuration cache Aug 2, 2020
@britter britter modified the milestones: 0.4.0, 0.5.0 Aug 2, 2020
@britter britter modified the milestones: 0.5.0, 0.3.2 Sep 27, 2020
@britter britter modified the milestones: 0.3.2, 0.4.0 Mar 11, 2022
@nedtwigg
Copy link

For now this workaround seems to be enough

tasks.named('generateMavenPluginHelpMojoSources') {
  notCompatibleWithConfigurationCache('https://github.com/britter/maven-plugin-development/issues/8')
}

@britter
Copy link
Owner Author

britter commented Jan 23, 2023

Yes, that's true, but it will disable the configuration cache whenever this plugin is part of the build 😕

@Goooler
Copy link
Contributor

Goooler commented Feb 26, 2023

Gradle 7.6.1

- Task `:plugin-maven:generateMavenPluginHelpMojoSources` of type `de.benediktritter.maven.plugin.development.task.GenerateHelpMojoSourcesTask`: cannot serialize object of type 'org.gradle.internal.io.LinePerThreadBufferingOutputStream', a subtype of 'java.io.OutputStream', as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.6.1/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:plugin-maven:generateMavenPluginHelpMojoSources` of type `de.benediktritter.maven.plugin.development.task.GenerateHelpMojoSourcesTask`: value '[classpath, site]' failed Java Object Serialization
  See https://docs.gradle.org/7.6.1/userguide/configuration_cache.html#config_cache:not_yet_implemented:java_serialization
- Task `:plugin-maven:generateMavenPluginHelpMojoSources` of type `de.benediktritter.maven.plugin.development.task.GenerateHelpMojoSourcesTask`: value '[java.lang.Class, java.lang.ClassLoader, java.lang.Compiler, java.lang.InheritableThreadLocal, java.lang.Package, java.lang.Process, java.lang.Runtime, java.lang.RuntimePermission, java.lang.SecurityManager, java.lang.System, java.lang.Thread, java.lang.ThreadGroup, java.lang.ThreadLocal]' failed Java Object Serialization
  See https://docs.gradle.org/7.6.1/userguide/configuration_cache.html#config_cache:not_yet_implemented:java_serialization
- Task `:plugin-maven:generateMavenPluginHelpMojoSources` of type `de.benediktritter.maven.plugin.development.task.GenerateHelpMojoSourcesTask`: value '[org.apache.velocity.runtime.log.AvalonLogChute, org.apache.velocity.runtime.log.Log4JLogChute, org.apache.velocity.runtime.log.CommonsLogLogChute, org.apache.velocity.runtime.log.ServletLogChute, org.apache.velocity.runtime.log.JdkLogChute]' failed Java Object Serialization
  See https://docs.gradle.org/7.6.1/userguide/configuration_cache.html#config_cache:not_yet_implemented:java_serialization

* What went wrong: Configuration cache state could not be cached: field `inputStream` of `org.apache.velocity.runtime.parser.VelocityCharStream` bean found in field `input_stream` of `org.apache.velocity.runtime.parser.ParserTokenManager` bean found in field `token_source` of `org.apache.velocity.runtime.parser.Parser` bean found in field `pool` of `org.apache.velocity.util.SimplePool` bean found in field `pool` of `org.apache.velocity.runtime.ParserPoolImpl` bean found in field `parserPool` of `org.apache.velocity.runtime.RuntimeInstance` bean found in field `ri` of `org.apache.velocity.app.VelocityEngine` bean found in field `engine` of `org.codehaus.plexus.velocity.DefaultVelocityComponent` bean found in field `velocityComponent` of `org.apache.maven.tools.plugin.generator.PluginHelpGenerator` bean found in field `generator` of task `:plugin-maven:generateMavenPluginHelpMojoSources` of type `de.benediktritter.maven.plugin.development.task.GenerateHelpMojoSourcesTask`: error writing value of type 'java.io.InputStreamReader'
> Unable to make field private final sun.nio.cs.StreamDecoder java.io.InputStreamReader.sd accessible: module java.base does not "opens java.io" to unnamed module @15e5409c

@britter britter modified the milestones: 0.4.2, 0.4.3 Jun 5, 2023
@britter
Copy link
Owner Author

britter commented Feb 28, 2024

This is not possible without breaking API, so I'll put this into the 1.0 milestone.

@sschuberth
Copy link

Just to chime in what I'm running into:

* What went wrong:
Configuration cache state could not be cached: field `configuration` of `org.apache.velocity.runtime.RuntimeInstance` bean found in field `ri` of `org.apache.velocity.app.VelocityEngine` bean found in field `engine` of `org.codehaus.plexus.velocity.DefaultVelocityComponent` bean found in field `velocityComponent` of `org.apache.maven.tools.plugin.generator.PluginHelpGenerator` bean found in field `generator` of task `:plugins:package-managers:maven-plugin:generateMavenPluginHelpMojoSources` of type `de.benediktritter.maven.plugin.development.task.GenerateHelpMojoSourcesTask`: error writing value of type 'org.apache.commons.collections.ExtendedProperties'
> 'ObjectOutputStream.putFields' is not supported by the Gradle configuration cache. See https://docs.gradle.org/8.10/userguide/configuration_cache.html#config_cache:not_yet_implemented:java_serialization for details.

@britter
Copy link
Owner Author

britter commented Aug 31, 2024

yeah, this is still on my backlog. I hope to have some more time to work on this project again in the near future. For now the only workaround is to explicitly disable to configuration cache for the tasks in the plugin.

@sschuberth
Copy link

Does it make sense to finish and merge #148 until then?

@britter
Copy link
Owner Author

britter commented Aug 31, 2024

No, #148 is going to replaced by a different approach. The challenge with the current state of the code is that the tasks unnecessarily reference types that can't be serialized into the configuration cache. My plan is to change that while moving to the org.gradlex namespace because then binary compatibility will be broken anyway.

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

No branches or pull requests

4 participants