This message was deleted.
# community-support
s
This message was deleted.
v
Sure
g
ok, so this is what I'm doing
Copy code
pluginManagement {
    includeBuild("../gradle-catalog")
}
dependencyResolutionManagement {
    versionCatalogs {
        create("libs") {
            from("org.scijava:gradle-catalog")
        }
    }
}
> Could not resolve all artifacts for configuration 'incomingCatalogForLibs0'. > > Cannot resolve external dependency org.scijava:gradle-catalog because no repositories are defined. > Required by: > unspecifiedunspecifiedunspecified I don't specify the version in
from
because it's imported via composite build, so it shouldn't be required
and if I add (always in
settings.gradle.kts
)
Copy code
plugins {
    id("org.scijava.catalogs")
}
> An exception occurred applying plugin request [id: 'org.scijava.catalogs'] > > Failed to apply plugin 'org.scijava.catalogs'. > > Invalid model name 'org.scijava': it must match the following regular expression: [a-z]([a-zA-Z0-9])+
v
The latter I never seen, but sounds like you try to create an extension named
org.scijava
which is not allowed.
And the first question, actually I misunderstood, I thought you mean a settings plugin that defines a version catalog, that would definitely work.
But
pluginManagement { includeBuild { ... } }
afair is just for looking up plugins by id, which is not what you are trying.
Try to do
includeBuild
on top-level, but it might well be that this will not work, but not sure, never tried.
g
to be sure, I want to import, via composite build, a setting plugin defining a version catalog
v
Yeah, that should work then and is what I originally understood too. If it still does not work, you probably should provide an MCVE to make your situation more clear.
g
ok, I'll do later thanks so far
šŸ‘Œ 1
ok, so: • producer • consumer (note
catalog
branch) When I
includeBuild("../gradle-catalog")
, then Gradle should perform substitution at
Copy code
dependencyResolutionManagement {
    versionCatalogs {
        create("libs").from("org.scijava:gradle-catalog")
    }
}
Unfortunately this is not the case Interesting enough, I see available, via Idea code completion,
addGeneratedCatalog()
, which is coming from the included catalog plugin. However, whenever I try to run, it complanis:
Unresolved reference: addGeneratedCatalog
I tried to move
addGeneratedCatalog()
under some package (because it was under the root), but nothing changed..
v
I don't know how you could expect that to work.
create("libs").from("org.scijava:gradle-catalog")
does not apply any plugin, it tries to define a catalog from a published TOML version catalog
But you do not publish any TOML version catalog under those coordinates
As I said before, when you got the "Invalid model name" you were closer to what you want, so remove the
dependencyResolutionManagement { ... }
block, put in
plugins { id("org.scijava.catalogs") }
and move the
includeBuild
into
pluginManagement { ... }
, then you have what you want.
šŸ‘ 1
That you then get "Invalid model name" is exactly what I said. In your generated code you have
create("org.scijava")
and that is, what the error message complains about. Come up with some naming strategy that does not use invalid names. The error message even tells you the regex which it must match:
[a-z]([a-zA-Z0-9])+
So you have to sart with a lowercase character, then any sequence of lowercase character, uppercase character, and digit. Nothing else like dot or dash or underscore, not starting with a digit, ... If you fix that place, then the next it complains about is the alias name
3D_Blob_Segmentation
which is also not accepted. The rules are not so strtict as for the catalog name, but still you cannot use arbitrary alias name. If it for example starts with a digit, you couldn't generate a valid accessor for it. So you "just" have to work on your generation code to not produce invalid names.
g
super useful, thanks
šŸ‘Œ 1