Maven plugin doing weird things

已回答

This is only what the IDE shows, not what Maven actually executes (it downloads the correct version):

${java.version} is "11" in the pom file, "Eclipse Temurin 11.0.17" happens to be the name of the Java SDK.

0
Is the problem specific to a single dependency? Are you able to reproduce it in a different project?
Please upload the idea.log file to https://uploads.jetbrains.com, and provide the upload id here. 'Help | Show Log in...'
0

Haven't noticed it in other projects, but we I haven't seen this construct used in other projects in conjunction with the JDK version either.

Upload ID 2022_12_12_2Azgiioc83E7fKs6s56g3b 

0

What property mssql-jdbc.version is set to? Where do you set this property?

Can you provide a sample project to check?

0

This basic pom will demonstrate:

 

<?xml version="1.0" encoding="UTF-8"?>
<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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>demo</description>
<properties>
<java.version>11</java.version>
<mssql-jdbc.version>11.2.1.jre${java.version}</mssql-jdbc.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>${mssql-jdbc.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
0

Mind this is a visual glitch only, Maven works fine and downloads the dependency.

0

Thank you. Reported as IDEA-308352 Maven pom.xml validation does not resolve nested (double interpolated) properties

0

请先登录再写评论。