membersound
membersound

Reputation: 86637

How to define parent-version in maven as property?

I'm using the following dependency as parent in my maven pom.xml:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.1.6.RELEASE</version>
</parent>

If I define the version as property <version>${spring-boot.version}</version> I'm getting the following error:

Project build error: Non-resolvable parent POM: Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:${spring-boot.version} from http://repo.spring.io/milestone was cached in the local repository, resolution will not be reattempted until the update interval of spring-milestones has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:${spring-boot.version} from/to spring-milestones (http://repo.spring.io/milestone): Illegal character in path at index 85: http://repo.spring.io/milestone/org/springframework/boot/spring-boot-starter-parent/${spring-boot.version}/spring-boot-starter-parent-${spring-boot.version}.pom and 'parent.relativePath' points at wrong local POM

So is it not possible to define the parent version as maven property?

Upvotes: 11

Views: 2732

Answers (1)

carlspring
carlspring

Reputation: 32567

Try updating Maven to 3.2.3. Check these release notes:

There was some work done this front in the latest versions of Maven and it should be possible to do it with version 3.2.1 (at least), but if you're upgrading Maven anyway, go with the latest.

Upvotes: 3

Related Questions