[
https://issues.apache.org/jira/browse/MNG-8638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17937093#comment-17937093
]
Tamas Cservenak commented on MNG-8638:
--------------------------------------
So, in short: Repositories defined in POM but be "known ahead", they cannot be
"dynamically evaluated" as that renders build reproducibility impossible.
Proper solution for this would be (that works in Maven 3 and Maven 4) is to
have settings.xml that introduces any "variable" to the picture, and have only
"fixed" repositories in POM (so this one removed).
> Properties in repository id/url not supported anymore
> -----------------------------------------------------
>
> Key: MNG-8638
> URL: https://issues.apache.org/jira/browse/MNG-8638
> Project: Maven
> Issue Type: Bug
> Components: Core
> Affects Versions: 4.0.0-rc-3
> Reporter: Marc Guillemot
> Priority: Major
>
> Following pom.xml can be used with Maven 3.9.x but not mit Maven 4.
> {code:xml}
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> https://maven.apache.org/xsd/maven-4.0.0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>test</groupId>
> <artifactId>properties-in-repos</artifactId>
> <version>0.0.1-SNAPSHOT</version>
> <packaging>pom</packaging>
> <properties>
> <repo.snapshots.id>snapshotsRepo</repo.snapshots.id>
>
> <repo.snapshots.url>https://my.server/snapshotsRepo</repo.snapshots.url>
> </properties>
> <profiles>
> <profile>
> <properties>
>
> <repo.snapshots.id>nightlySnapshotsRepo</repo.snapshots.id>
>
> <repo.snapshots.url>https://my.server/nightlySnapshotsRepo</repo.snapshots.url>
> </properties>
> </profile>
> </profiles>
> <repositories>
> <repository>
> <id>${repo.snapshots.id}</id>
> <url>${repo.snapshots.url}</url>
> <releases>
> <enabled>false</enabled>
> </releases>
> </repository>
> </repo
> {code}
> Maven 4.0.0-rc-3 fails with following error:
> {code:java}
> [ERROR] Some problems were encountered while processing the POMs
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR]
> [ERROR] The project test:properties-in-repos:pom:0.0.1-SNAPSHOT
> (C:\dev\eclipse-workspace-okular-bis\poc-dynamic-mvn-deploy\pom.xml) has 1
> error
> [ERROR] 'repositories.repository.[${repo.snapshots.id}].url' contains an
> unsupported expression (only expressions starting with 'project.basedir' or
> 'project.rootDirectory' are supported). @
> test:properties-in-repos:0.0.1-SNAPSHOT,
> file://[sic]/poc-dynamic-mvn-deploy/pom.xml, line 26, column 13
> {code}
> This would block our migration to Maven 4 as we use such a construct to
> deploy snapshots from nightly builds to a separate repository.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)