ben-manes / gradle-versions-plugin

Gradle plugin to discover dependency updates
Apache License 2.0
3.83k stars 200 forks source link

Ignore empty middle projects #756

Open ianbrandt opened 1 year ago

ianbrandt commented 1 year ago

From @jvandort in https://github.com/ben-manes/gradle-versions-plugin/issues/727#issuecomment-1467122742:

The log4j problem was present on 0.44.0 before these changes. It is related to trying to resolve the buildscript classpath configuration in the :subprojects project, which has a log4j dependency constraint. Though since the :subprojects project is empty with only a single subproject itself and no other configuration, it has no plugins.

You can either file a separate issue or add a repository to the :subprojects project.

Reproducer: https://github.com/ianbrandt/gradle-versions-plugin-platform-constraints/ (commit as of this writing: https://github.com/ianbrandt/gradle-versions-plugin-platform-constraints/tree/09d5e70d2f78789a045f5442fd05fa6b62d41594).

As said, ":subprojects" is just an empty middle project with no plugins defined. It's not included on its own in my 'settings.gradle.kts', only ":subprojects:app" is: https://github.com/ianbrandt/gradle-versions-plugin-platform-constraints/blob/09d5e70d2f78789a045f5442fd05fa6b62d41594/settings.gradle.kts#L17.

It doesn't have its own 'settings.gradle.kts' or 'build.gradle.kts', and only the Versions Plugin is applied to my root build: https://github.com/ianbrandt/gradle-versions-plugin-platform-constraints/blob/09d5e70d2f78789a045f5442fd05fa6b62d41594/build.gradle.kts#L15.

I would expect the Versions Plugin to just ignore it. Instead the following is printed:

Failed to determine the latest version for the following dependencies (use --info for details):
 - org.apache.logging.log4j:log4j-core
     2.20.0
The exception that is the cause of unresolved state: org.gradle.internal.resolve.ModuleVersionNotFoundException: Cannot resolve external dependency org.apache.logging.log4j:log4j-core:+ because no repositories are defined.
Required by:
    project :subprojects