kordamp / kordamp-gradle-plugins

A collection of Gradle plugins
https://kordamp.org/kordamp-gradle-plugins/
Apache License 2.0
138 stars 25 forks source link

ProjectsExtensionImpl.cleanup throws a ConcurrentModificationException #455

Closed FRodrigues-BrandenPT closed 3 years ago

FRodrigues-BrandenPT commented 3 years ago

Hello, when I run this project I get this exception:

* Exception is:
java.util.ConcurrentModificationException
        at org.kordamp.gradle.plugin.settings.internal.ProjectsExtensionImpl.cleanup(ProjectsExtensionImpl.groovy:453)
        at org.kordamp.gradle.plugin.settings.internal.ProjectsExtensionImpl.resolveFromConfig(ProjectsExtensionImpl.groovy:155)
        at org.kordamp.gradle.plugin.settings.internal.ProjectsExtensionImpl.access$5(ProjectsExtensionImpl.groovy)
        at org.kordamp.gradle.plugin.settings.internal.ProjectsExtensionImpl$1.settingsEvaluated(ProjectsExtensionImpl.groovy:86)
        at jdk.internal.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)

Probably because this method is removing objects of the iterator?

I'm going to not use the settings plugin for the time being. Thanks.

FRodrigues-BrandenPT commented 3 years ago

Found the problem. Gradle or IntelliJ added the following statements to the settings.gradle:

include("ThisProjectPlugin")
include("build-config-plugins:ThisProjectPlugin")
findProject(":build-config-plugins:ThisProjectPlugin")?.name = "ThisProjectPlugin"

Sorry to bother you. I'm going to still leave this and the repository open if you want to test something.

aalmiray commented 3 years ago

OK. So this is not a bug in Kordamp itself, is it?

FRodrigues-BrandenPT commented 3 years ago

I'm not sure, because as a user I would expect a plugin error saying that I'm trying to add non-existing projects. But instead, I got ConcurrentModificationException. So if it's a bug of Kordamp I wouldn't prioritize it.