{"record":{"id":"0c7205b507eacca1","repo":"apereo/cas","slug":"snapshot-versions-found-in-catalogfile","errorCode":null,"errorMessage":"SNAPSHOT versions found in ${catalogFile}:\n","messagePattern":"SNAPSHOT versions found in (.+?):\n","errorType":"console","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"build.gradle","lineNumber":391,"sourceCode":"        mongoImportExecutable.set(providers.systemProperty(\"casModuleMetadataMongoImportExecutable\").orElse(\"mongoimport\"))\n    }\n}\n\ntasks.register('verifyDependencyVersions') { t ->\n    def catalogFile = rootProject.layout.projectDirectory\n            .file('gradle/libs.versions.toml')\n            .asFile\n    inputs.file(catalogFile).withPathSensitivity(PathSensitivity.RELATIVE)\n\n    doLast {\n        def snapshotLines = []\n        catalogFile.eachLine { line, lineNumber ->\n            if (line =~ /(?i)SNAPSHOT/) {\n                snapshotLines << \"${lineNumber}: ${line.trim()}\"\n            }\n        }\n        if (!snapshotLines.empty) {\n            throw new GradleException(\"SNAPSHOT versions found in ${catalogFile}:\\n\" + snapshotLines.collect { \"\\t - $it\" }.join('\\n'))\n        }\n    }\n}\n\ntasks.named(\"clean\") {\n    delete new File(project.rootDir, '.gradle/cas-test-tags')\n}\n","sourceCodeStart":373,"sourceCodeEnd":399,"githubUrl":"https://github.com/apereo/cas/blob/e7288fc434b4f4505b8452e1a57e8fb3111bb863/build.gradle#L373-L399","documentation":"A build check scans the version catalog (gradle/ libs.versions.toml style catalogFile) line by line and throws GradleException listing any lines containing 'SNAPSHOT' (case-insensitive). CAS forbids SNAPSHOT dependency versions in the catalog to keep reproducible builds.","triggerScenarios":"Editing the version catalog to temporarily point a library at a -SNAPSHOT version, then running any build that executes this check.","commonSituations":"Developer pins a dependency to a snapshot for local testing and forgets to revert before building; a dependabot/upgrade PR accidentally introduces a snapshot.","solutions":["Replace the SNAPSHOT version in the catalog with a released version (e.g. 2.0.0 instead of 2.0.0-SNAPSHOT).","For local experiments, use a local maven repo/composite build instead of a snapshot entry, and revert the catalog afterward.","Use the listed line numbers in the message to locate and fix every offending line."],"exampleFix":"// before (catalog)\nfoo = \"3.2.0-SNAPSHOT\"\n// after\nfoo = \"3.2.0\"","handlingStrategy":"validation","validationCode":"// grep the catalog before building\ngrep -i SNAPSHOT gradle/libs.versions.toml && echo \"fix snapshot versions\" || echo ok","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never commit snapshot versions to the catalog; revert local experiments.","Add a pre-commit hook that greps the catalog for SNAPSHOT.","Upgrade via released versions only; use composite builds for local dev iterations."],"tags":["gradle","version-catalog","dependency","snapshot"],"backgroundTag":"invalid-config-value","analyzedSha":"e7288fc434b4f4505b8452e1a57e8fb3111bb863","analyzedAt":"2026-09-08T15:39:16.015Z","contentChangedAt":"2026-09-08T15:39:16.015Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}