I’m trying to import org.sonatype.nexus.repository.storage.StorageFacet in my test Groovy script. However, for some reason I’m geting “Script4.groovy: 3: unable to resolve class org.sonatype.nexus.repository.storage.StorageFacet”. Same for other classes from the storage package. “import org.sonatype.nexus.repository.Repository” is fine.
Is that expected? Are classes from the storage package expected to be available by default in Groovy scripts, once scripting got enabled? Should I add some jar in some path somewhere?
I understand that scripting is being actively deprecated, but still…
I’m looking for a groovy script to count the number of components per repository in Nexus OSS 3.71 (H2 database).
The script provided via this link works well with an OrientDB database.
Do you know if there is an equivalent script that would be compatible with an H2 database, please?
The public APIs extend ScriptApi, otherwise these are internal APIs and may change in releases. You may wish to look at ContentFacet which is attached to repositories while using an SQL database.