Maven属性未在父标记中解析 [英] Maven property not resolved in parent tag
问题描述
以下属性无法解析:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<spring.boot.version>1.3.3.RELEASE</spring.boot.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>${spring.boot.version}</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
com.myproject:0.0.1-SNAPSHOT的不可解析的父POM:找不到org.springframework.boot:spring-boot-starter-parent:pom:$ {spring.boot.version}
Non-resolvable parent POM for com.myproject:0.0.1-SNAPSHOT: Failure to find org.springframework.boot:spring-boot-starter-parent:pom:${spring.boot.version}
有人知道我该怎么做吗?
Does anyone know what do I do wrong?
推荐答案
这很正常.当前,Maven不评估<parent>
标记内的属性,因此您需要明确地编写版本.
This is normal. Currently, Maven does not evaluate properties inside the <parent>
tag, so you need to write explicitely the version.
这是在 MNG-2569 中报告的错误,该错误已重复由更通用的 MNG-624 来实现.目前尚无计划在将来进行这项工作(此问题已通过无法解决"解决).
This was reported in MNG-2569 as a bug, which is duplicated by the more general MNG-624. There are currently no plans to make this work in the future (the issue is closed as "Won't Fix").
这篇关于Maven属性未在父标记中解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!