Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compat/maven-model-builder/src/site/apt/index.apt
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ Maven Model Builder
<<<pom.basedir>>> (<deprecated>)\
<<<basedir>>> (<deprecated>) | the directory containing the <<<pom.xml>>> file | <<<$\{project.basedir\}>>> |
*----+------+------+
| <<<project.baseUri>>>\
<<<pom.baseUri>>> (<deprecated>) | the directory containing the <<<pom.xml>>> file as URI | <<<$\{project.baseUri\}>>> |
| <<<project.baseUri>>> (<deprecated>)\
<<<pom.baseUri>>> (<deprecated>) | the directory containing the <<<pom.xml>>> file as URI. Those properties are deprecated, use <<<$\{project.basedir.uri\}>>> instead. | <<<$\{project.basedir.uri\}>>> |
*----+------+------+
| <<<project.rootDirectory>>> | the project's root directory (containing a <<<.mvn>>> directory or with the <<<root="true">>> xml attribute) | <<<$\{project.rootDirectory\}>>> |
*----+------+------+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,16 @@ private void validateRawRepositories(
Matcher matcher = EXPRESSION_NAME_PATTERN.matcher(repository.getUrl());
while (matcher.find()) {
String expr = matcher.group(1);
if (!("basedir".equals(expr)
if ("project.baseUri".equals(expr)) {
addViolation(
problems,
Severity.WARNING,
Version.V40,
prefix + prefix2 + "[" + repository.getId() + "].url",
null,
"contains a deprecated 'project.baseUri' expression, use 'project.basedir.uri' instead.",
repository);
} else if (!("basedir".equals(expr)
|| "project.basedir".equals(expr)
|| expr.startsWith("project.basedir.")
|| "project.rootDirectory".equals(expr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -896,8 +896,8 @@ void repositoryWithExpression() throws Exception {

@Test
void repositoryWithBasedirExpression() throws Exception {
SimpleProblemCollector result = validateRaw("raw-model/repository-with-basedir-expression.xml");
assertViolations(result, 0, 0, 0);
SimpleProblemCollector result = validateFile("raw-model/repository-with-basedir-expression.xml");
assertViolations(result, 0, 0, 1);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ under the License.
<id>repo</id>
<url>file://${x}/sdk/maven/repo</url>
</repository>
<repository>
<id>repo2</id>
<url>${project.basedir.uri}/sdk/maven/repo</url>
</repository>
</repositories>

</project>
Loading