Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: SCA 2021.x build failed #3342

Closed
yuluo-yx opened this issue Jun 8, 2023 · 1 comment
Closed

BUG: SCA 2021.x build failed #3342

yuluo-yx opened this issue Jun 8, 2023 · 1 comment
Assignees

Comments

@yuluo-yx
Copy link
Collaborator

yuluo-yx commented Jun 8, 2023

Which Component
spring cloud alibaba 2021 branch

Describe the bug
Cloning the project to the local, executing the maven command to build failed

To Reproduce

  1. git pull https://github.com/alibaba/spring-cloud-alibaba.git 2021.x:master
  2. mvn clean install -DskipTests=true

Expected behavior
build success

stack trace

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  43.967 s
[INFO] Finished at: 2023-06-08T14:08:03+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project spring-cloud-
starter-alibaba-nacos-config: Compilation failure: Compilation failure: 
[ERROR] /C:/Users/14815/Desktop/sca2021/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config/src/main/java/com/alib
aba/cloud/nacos/NacosConfigProperties.java:[30,24] 程序包javax.annotation不存在
[ERROR] /C:/Users/14815/Desktop/sca2021/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-nacos-config/src/main/java/com/alib
aba/cloud/nacos/NacosConfigProperties.java:[101,10] 找不到符号
[ERROR]   符号:   类 PostConstruct
[ERROR]   位置: 类 com.alibaba.cloud.nacos.NacosConfigProperties
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :spring-cloud-starter-alibaba-nacos-config
@ruansheng8
Copy link
Collaborator

由于 spring-cloud-starter-alibaba-nacos-config模块在2021.x 分支缺少 jakarta.annotation-api 依赖包导致 (以前该依赖是由其他模块传递依赖进来的, 可能由于部分模块版本号的升级, 其他模块已经不再依赖 jakarta.annotation-api 这个包)

2.2.x 分支是通过spring-boot-starter包传递依赖进来的, 2021.x分支在之前的一个提交已经移除掉了spring-boot-starter
d6310b1#diff-0b82ef8d566054eaed68f7e4ffa7b6206857ffca40d7dd03ea7313c2c73f07dfL54-L58

可以考虑直接在 spring-cloud-starter-alibaba-nacos-config模块下添加以下依赖:

    <dependency>
      <groupId>jakarta.annotation</groupId>
      <artifactId>jakarta.annotation-api</artifactId>
    </dependency>

@ruansheng8 ruansheng8 self-assigned this Jun 8, 2023
ruansheng8 added a commit to ruansheng8/spring-cloud-alibaba that referenced this issue Jun 10, 2023
ruansheng8 added a commit to ruansheng8/spring-cloud-alibaba that referenced this issue Jun 22, 2023
steverao pushed a commit that referenced this issue Jun 22, 2023
* Fix: Add jakarta annotation api (#3342)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants