{"record":{"id":"e2ba426dbea2afc4","repo":"github/copilot-sdk","slug":"blank-or-missing-version-property-in-check-ma","errorCode":null,"errorMessage":"Blank or missing 'version' property in  — check Maven resource filtering configuration","messagePattern":"Blank or missing 'version' property in  — check Maven resource filtering configuration","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"java/sdk/src/main/java/com/github/copilot/ffi/NativeRuntimeLoader.java","lineNumber":261,"sourceCode":"     * @return the version string\n     * @throws IOException\n     *             if the resource cannot be read\n     * @throws IllegalStateException\n     *             if the resource is missing or the version property is blank\n     */\n    static String readVersion(ClassLoader loader) throws IOException {\n        URL resource = loader.getResource(VERSION_RESOURCE);\n        if (resource == null) {\n            throw new IllegalStateException(\"Missing version resource: \" + VERSION_RESOURCE\n                    + \" — ensure Maven resource filtering has run (mvn process-resources)\");\n        }\n        Properties props = new Properties();\n        try (InputStream in = resource.openStream()) {\n            props.load(in);\n        }\n        String version = props.getProperty(\"version\");\n        if (version == null || version.isBlank()) {\n            throw new IllegalStateException(\"Blank or missing 'version' property in \" + VERSION_RESOURCE\n                    + \" — check Maven resource filtering configuration\");\n        }\n        return version;\n    }\n\n    private static String readNativePackageVersion(ClassLoader loader, String classifier) throws IOException {\n        String resourcePath = \"native/\" + classifier + \"/\" + PLATFORM_PROPERTIES_FILENAME;\n        URL resource = loader.getResource(resourcePath);\n        if (resource == null) {\n            throw new FileNotFoundException(\"Native runtime metadata not found on classpath: \" + resourcePath\n                    + \" — add the matching classifier JAR to the classpath\");\n        }\n\n        Properties props = new Properties();\n        try (InputStream in = resource.openStream()) {\n            props.load(in);\n        }\n        String version = props.getProperty(\"version\");","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/java/sdk/src/main/java/com/github/copilot/ffi/NativeRuntimeLoader.java#L243-L279","documentation":"The copilot-runtime.properties resource exists but its `version` property is missing or blank. Maven resource filtering should substitute the project version into this property at build time; an unfiltered or misconfigured build leaves it empty, and the loader refuses to use it as a cache key.","triggerScenarios":"Building with resource filtering enabled but the properties file not referencing ${project.version}; filtering applied to the wrong resource directory; a placeholder that failed substitution (literal ${project.version} is non-blank, but a miswritten filter leaves it unset); hand-edited properties file.","commonSituations":"Custom builds (Gradle/Bazel migrations) that copy the template without substituting the version; overridden resource directories in pom.xml dropping the filter config; building from a source checkout with stale filtered output.","solutions":["Verify the properties file template declares version=${project.version} and filtering is enabled for its directory, then rebuild with mvn clean process-resources.","Inspect the built artifact: unzip -p target/classes/copilot-runtime.properties — confirm a concrete version string.","If migrating off Maven, add a build step that writes the actual version into copilot-runtime.properties.","Re-run a full clean build to eliminate stale, unfiltered resource copies."],"exampleFix":"// before: src/main/resources/copilot-runtime.properties (never substituted)\nversion=\n\n// after\ncopilot-runtime.properties filter template:\nversion=${project.version}\n// with <filtering>true</filtering> in pom.xml -> builds to version=1.2.0","handlingStrategy":"validation","validationCode":"try (InputStream in = getClass().getResourceAsStream(\"/copilot-runtime.properties\")) {\n    Properties p = new Properties(); p.load(in);\n    if (p.getProperty(\"version\") == null || p.getProperty(\"version\").isBlank())\n        throw new IllegalStateException(\"copilot-runtime.properties has no version — resource filtering misconfigured\");\n}\n","typeGuard":null,"tryCatchPattern":"try {\n    Path runtime = NativeRuntimeLoader.resolve();\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Blank or missing 'version' property\")) {\n        throw new IllegalStateException(\"Rebuild the SDK: version property was not substituted by Maven filtering\", e);\n    } else throw e;\n}","preventionTips":["Template the file as version=${project.version} with filtering enabled.","Verify filtered output (unzip -p target/classes/copilot-runtime.properties) in CI.","Reproduce Maven filtering explicitly if migrating to Gradle/Bazel.","Never hand-edit copilot-runtime.properties in source or build output."],"tags":["maven","build","resource-filtering","versioning"],"backgroundTag":"missing-config-value","analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}