{"record":{"id":"29a037c53521dead","repo":"apache/maven","slug":"repository-list-contains-duplicate-entries-each-r","errorCode":null,"errorMessage":"Repository list contains duplicate entries. Each repository must be unique based on its ID and URL. Found {} repositories but only {} unique entries.","messagePattern":"Repository list contains duplicate entries\\. Each repository must be unique based on its ID and URL\\. Found (.+?) repositories but only (.+?) unique entries\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"warning","filePath":"api/maven-api-core/src/main/java/org/apache/maven/api/services/RepositoryAwareRequest.java","lineNumber":106,"sourceCode":"     *   <li>Ensures no duplicate repositories exist in the list</li>\n     *   <li>Ensures no null repository entries exist in the list</li>\n     * </ul>\n     *\n     * <p>Duplicate detection is based on the {@code RemoteRepository#equals(Object)}\n     * method, which typically compares repository IDs and URLs.\n     *\n     * @param repositories the list of repositories to validate, may be {@code null}\n     * @return the same list if validation passes, or {@code null} if input was {@code null}\n     * @throws IllegalArgumentException if the list contains duplicate repositories\n     * @throws IllegalArgumentException if the list contains null repository entries\n     */\n    default List<RemoteRepository> validate(List<RemoteRepository> repositories) {\n        if (repositories == null) {\n            return null;\n        }\n        HashSet<RemoteRepository> set = new HashSet<>(repositories);\n        if (repositories.size() != set.size()) {\n            throw new IllegalArgumentException(\n                    \"Repository list contains duplicate entries. Each repository must be unique based on its ID and URL. \"\n                            + \"Found \" + repositories.size() + \" repositories but only \" + set.size()\n                            + \" unique entries.\");\n        }\n        if (repositories.stream().anyMatch(Objects::isNull)) {\n            throw new IllegalArgumentException(\n                    \"Repository list contains null entries. All repository entries must be non-null RemoteRepository instances.\");\n        }\n        return repositories;\n    }\n}\n","sourceCodeStart":88,"sourceCodeEnd":118,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/api/maven-api-core/src/main/java/org/apache/maven/api/services/RepositoryAwareRequest.java#L88-L118","documentation":"Maven evaluates a profile <activation><file><missing>...</missing> condition by running the configured interpolator over the path expression before checking file existence. If interpolation throws InterpolationException (typically a ${...} expression such as ${env.VAR} or a property that cannot be resolved at activation time), FileProfileActivator catches it, logs this warning (stack trace only with -X), falls through to return false, and the profile is silently treated as NOT active.","triggerScenarios":"A POM declares <activation><file><missing>${some.expression}/marker</missing></file></activation> and the referenced property or environment variable is undefined when Maven evaluates profile activation; every build emits the warning and the profile never activates.","commonSituations":"CI agents missing an env var referenced in the activation; a typo in the property name inside <missing>; the property being defined only in one developer's settings.xml profile; activation expressions written for a different Maven version whose activation context exposes different keys.","solutions":["Define the referenced property before the build: -Dprop=value on the mvn command line, <properties> in the POM, or a settings.xml profile","Run mvn -X once and read the logged InterpolationException stack to identify the exact expression that fails","Replace the expression with a literal path relative to the module basedir (for example target/skip-tests.flag), which needs no interpolation","If the marker file is not essential, remove the <missing> condition or switch to <exists> with a stable file"],"exampleFix":"<!-- before -->\n<activation>\n  <file>\n    <missing>${env.CI_MARKER}/skip-tests.flag</missing>\n  </file>\n</activation>\n<!-- after: literal module-relative path, no interpolation needed -->\n<activation>\n  <file>\n    <missing>target/skip-tests.flag</missing>\n  </file>\n</activation>","handlingStrategy":"validation","validationCode":"# fail fast if profile <file> activation still contains unresolved expressions\ngrep -nE '<(missing|exists)>[^<]*\\$\\{[^}]+\\}' pom.xml */pom.xml && {\n  echo 'unresolved expression in profile <file> activation; define the property or use a literal path'\n  exit 1\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer literal, module-relative paths in <file> activation conditions","Define every property referenced by activation expressions in both developer and CI environments","Run CI builds with -X so interpolation failures include their stack traces","Add maven-enforcer-plugin requireProperty rules for properties your activations depend on"],"tags":["maven","profile-activation","interpolation","pom","maven-compat"],"backgroundTag":"unresolved-property-interpolation","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}