Skip to content

Commit 0775f9b

Browse files
committed
Fix issue with Gradle 8.6 and catalog access (projects without catalog)
In earlier version, in a standard configuration, if the 'VersionCatalogsExtension' existed, there was also a catalog called 'libs'. If there were no catalog at all, the extension did not exist. This has changed recently. This causes the plugin to fail in a standard setup where the catalog is NOT used.
1 parent 5df4442 commit 0775f9b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/gradlex/javamodule/dependencies/JavaModuleDependenciesExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public Provider<Map<String, Object>> gav(Provider<String> moduleName) {
266266
}
267267

268268
private Map<String, Object> findGav(String ga, String moduleName) {
269-
VersionCatalog catalog = versionCatalogs == null ? null : versionCatalogs.named(getVersionCatalogName().get());
269+
VersionCatalog catalog = versionCatalogs == null ? null : versionCatalogs.find(getVersionCatalogName().get()).orElse(null);
270270
Optional<VersionConstraint> version = catalog == null ? empty() : catalog.findVersion(moduleName.replace('_', '.'));
271271
Map<String, Object> gav = new HashMap<>();
272272
String[] gaSplit = ga.split(":");

0 commit comments

Comments
 (0)