alibaba/spring-cloud-alibaba

Nacos Client dependency fails due to unresolved ${revision} variable in version 2021.0.5.0

Closed this issue · 3 comments

Which Component
Nacos Discovery

Describe the bug
When trying to use the spring-cloud-starter-alibaba-nacos-discovery dependency with version 2021.0.5.0, I encounter an issue where the ${revision} variable in the nacos-client dependency's POM file is not resolved correctly, leading to an error:

Could not find artifact com.alibaba.nacos:nacos-all:pom:${revision} in aliyunmaven (https://maven.aliyun.com/repository/public)

The POM file contains the following snippet, where ${revision} is used, but it does not get replaced by a concrete version number:

<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 [http://maven.apache.org/xsd/maven-4.0.0.xsd"](http://maven.apache.org/xsd/maven-4.0.0.xsd%22) xmlns="[http://maven.apache.org/POM/4.0.0"](http://maven.apache.org/POM/4.0.0%22)
    xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance">](http://www.w3.org/2001/XMLSchema-instance%22%3E)
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.alibaba.nacos</groupId>
    <artifactId>nacos-all</artifactId>
    <version>${revision}</version> <!-- The issue is here -->
  </parent>
  <groupId>com.alibaba.nacos</groupId>
  <artifactId>nacos-client</artifactId>
  <version>2.2.0</version>
  <name>nacos-client ${project.version}</name>
  <url>http://nacos.io</url>

</project>

Simplest demo
The simplest demo involves creating a Maven project with the following dependency:

<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
    <version>2021.0.5.0</version>
</dependency>

Then try building the project, and you will see the error.

To Reproduce
Steps to reproduce the behavior:

  1. Add the following dependency to a Maven project:
    <dependency>
        <groupId>com.alibaba.cloud</groupId>
        <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
        <version>2021.0.5.0</version>
    </dependency>
  2. Attempt to build the project using mvn clean install.
  3. See the error related to ${revision} not being resolved.

Expected behavior
The ${revision} variable should be replaced with the correct version of nacos-all, and the project should compile without errors.

Screenshots
N/A

Additional context

  • MacOS
  • Java 8
  • Spring Cloud Alibaba version: 2021.0.5.0
  • Nacos client version: 2.2.0

这里的 all 是 nacos 版本的发行版本,或许不应该在 sca 中被替换?

This issue has been open 30 days with no activity. This will be closed in 7 days.

This issue has been automatically marked as stale because it hasn't had any recent activity.If you think this should still be open, or the problem still persists, just pop a reply in the comments and one of the maintainers will (try!) to follow up. Thank you for your interest and contribution to the Sping Cloud Alibaba Community.