{"record":{"id":"e3080681ef3ed9e1","repo":"quarkusio/quarkus","slug":"the-amazon-lambda-extensions-are-incompatible-with","errorCode":null,"errorMessage":"The Amazon Lambda extensions are incompatible with the 'native-sources' package type.","messagePattern":"The Amazon Lambda extensions are incompatible with the 'native-sources' package type\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/amazon-lambda/common-deployment/src/main/java/io/quarkus/amazon/lambda/deployment/AmazonLambdaCommonProcessor.java","lineNumber":32,"sourceCode":"import io.quarkus.deployment.builditem.SnapStartDefaultValueBuildItem;\nimport io.quarkus.deployment.builditem.SystemPropertyBuildItem;\nimport io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;\nimport io.quarkus.deployment.pkg.builditem.ArtifactResultBuildItem;\nimport io.quarkus.deployment.pkg.steps.NativeBuild;\nimport io.quarkus.deployment.pkg.steps.NativeSourcesBuild;\nimport io.quarkus.jackson.runtime.JsonMapperProducer;\nimport io.quarkus.runtime.LaunchMode;\nimport tools.jackson.databind.ObjectMapper;\n\npublic final class AmazonLambdaCommonProcessor {\n    @BuildStep\n    public SnapStartDefaultValueBuildItem enableSnapStartByDefault() {\n        return new SnapStartDefaultValueBuildItem(true);\n    }\n\n    @BuildStep(onlyIf = NativeSourcesBuild.class)\n    void failForNativeSources(BuildProducer<ArtifactResultBuildItem> artifactResultProducer) {\n        throw new IllegalArgumentException(\n                \"The Amazon Lambda extensions are incompatible with the 'native-sources' package type.\");\n    }\n\n    @BuildStep\n    void tmpdirs(BuildProducer<SystemPropertyBuildItem> systemProperty,\n            LaunchModeBuildItem launchModeBuildItem) {\n        LaunchMode mode = launchModeBuildItem.getLaunchMode();\n        if (mode.isDevOrTest()) {\n            return; // just in case we're on Windows.\n        }\n        systemProperty.produce(new SystemPropertyBuildItem(\"java.io.tmpdir\", \"/tmp\"));\n        systemProperty.produce(new SystemPropertyBuildItem(\"vertx.cacheDirBase\", \"/tmp/vertx\"));\n    }\n\n    @BuildStep\n    public void markObjectMapper(BuildProducer<UnremovableBeanBuildItem> unremovable) {\n        unremovable.produce(new UnremovableBeanBuildItem(\n                new UnremovableBeanBuildItem.BeanClassNameExclusion(ObjectMapper.class.getName())));","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/amazon-lambda/common-deployment/src/main/java/io/quarkus/amazon/lambda/deployment/AmazonLambdaCommonProcessor.java#L14-L50","documentation":"This build step aborts the Quarkus build when the package type is native-sources because Amazon Lambda extensions cannot produce a deployable artifact from native sources (they expect either a JVM zip deployment or a full native binary).","triggerScenarios":"Building with -Dquarkus.package.type=native-sources (NativeSourcesBuild condition) while any Amazon Lambda extension is on the classpath; the failForNativeSources build step runs unconditionally under that condition.","commonSituations":"Using container-based native source builds (e.g. for custom runtimes) in a Lambda project; CI pipelines copying docker-native/native-sources settings from another service onto a Lambda function build.","solutions":["Remove the Amazon Lambda extension if you truly need native-sources packaging","Change package type to native: -Dquarkus.package.type=native","Use the default jar/zip package type and deploy via the Lambda JVM runtime","If using native-sources with a custom container build, drop Lambda extensions and implement the function outside Quarkus Amazon Lambda tooling"],"exampleFix":"// before\nmvn package -Dquarkus.package.type=native-sources\n// after\nmvn package -Dquarkus.package.type=native","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep Lambda builds on package types native or jar/zip","Separate CI pipelines for Lambda vs container-native services","Check quarkus.package.type in build profiles before running package","Read extension docs for supported packaging modes"],"tags":["quarkus","amazon-lambda","native","build","packaging"],"backgroundTag":"incompatible-package-type","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}