{"record":{"id":"44f650d4d88915ef","repo":"apache/maven","slug":"the-property-name-is-required-to-activate-the-prof","errorCode":null,"errorMessage":"The property name is required to activate the profile '{}'","messagePattern":"The property name is required to activate the profile '(.+?)'","errorType":"exception","errorClass":"ProfileActivationException","httpStatus":null,"severity":"error","filePath":"compat/maven-compat/src/main/java/org/apache/maven/profiles/activation/SystemPropertyProfileActivator.java","lineNumber":58,"sourceCode":"    }\n\n    @Override\n    protected boolean canDetectActivation(Profile profile) {\n        return profile.getActivation() != null && profile.getActivation().getProperty() != null;\n    }\n\n    @Override\n    public boolean isActive(Profile profile) throws ProfileActivationException {\n        Activation activation = profile.getActivation();\n\n        ActivationProperty property = activation.getProperty();\n\n        if (property != null) {\n            String name = property.getName();\n            boolean reverseName = false;\n\n            if (name == null) {\n                throw new ProfileActivationException(\n                        \"The property name is required to activate the profile '\" + profile.getId() + \"'\");\n            }\n\n            if (name.startsWith(\"!\")) {\n                reverseName = true;\n                name = name.substring(1);\n            }\n\n            String sysValue = properties.getProperty(name);\n\n            String propValue = property.getValue();\n            if (propValue != null && !propValue.isEmpty()) {\n                boolean reverseValue = false;\n                if (propValue.startsWith(\"!\")) {\n                    reverseValue = true;\n                    propValue = propValue.substring(1);\n                }\n","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-compat/src/main/java/org/apache/maven/profiles/activation/SystemPropertyProfileActivator.java#L40-L76","documentation":"Thrown when a profile declares <activation><property> without a <name> element. SystemPropertyProfileActivator requires the property name before it can look up a system property; an activation property block with a null name aborts profile evaluation with ProfileActivationException naming the profile. Value alone is not enough - Maven must know which property to read.","triggerScenarios":"A POM profile with <property><value>someValue</value></property> but no <name>; also triggered when name is present but the property element itself is malformed so getName() returns null.","commonSituations":"Hand-written profiles meant to activate when a property has a value, forgetting the name; refactoring that removes <name> but leaves <value>; profiles inherited from parent POMs; misunderstanding that value without name is meaningless.","solutions":["Add the missing <name> to the activation property: <property><name>env</name><value>prod</value></property>","If the intent was 'activate when property X exists', specify only <name>X</name> and omit <value>","If the intent was negation, use <name>!X</name>","Run 'mvn help:active-profiles' to confirm the corrected profile resolves"],"exampleFix":"<!-- before -->\n<activation>\n  <property>\n    <value>production</value>\n  </property>\n</activation>\n<!-- after -->\n<activation>\n  <property>\n    <name>deployEnv</name>\n    <value>production</value>\n  </property>\n</activation>","handlingStrategy":"validation","validationCode":"// Before activating, confirm the property block is well-formed\nActivationProperty p = profile.getActivation().getProperty();\nif (p != null && p.getName() == null) {\n    skipAndLog(\"profile '\" + profile.getId() + \"' has activation property without <name>\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair <value> with <name> under activation <property>","Use '!name' for negation instead of omitting name","Lint profiles in CI (help:active-profiles) to catch malformed activation early"],"tags":["maven","profile","activation","system-property","pom"],"backgroundTag":"profile-activation-misconfigured","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}