问题描述

当私服的内容发生变动或有其他依赖更新时,使用Jenkins构建镜像时还使用老的依赖导致构建失败。
报错如下:

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /var/jenkins_home/workspace/xxx-gateway/xxx-gateway/src/main/java/com/xxx/gateway/filter/AuthGlobalFilter.java:[36,83] cannot find symbol
  symbol:   variable JWT_TOKEN_NICK_NAME
  location: class com.xxx.base.constant.Auth
[ERROR] /var/jenkins_home/workspace/xxx-gateway/xxx-gateway/src/main/java/com/xxx/gateway/filter/AuthGlobalFilter.java:[37,82] cannot find symbol
  symbol:   variable JWT_TOKEN_ROLE_IDS
  location: class com.xxx.base.constant.Auth
[ERROR] /var/jenkins_home/workspace/xxx-gateway/xxx-gateway/src/main/java/com/xxx/gateway/filter/AuthGlobalFilter.java:[39,29] cannot find symbol
  symbol:   method builder()

解决方法

配置maven setting.xml文件

				 <repository>
                    <id>xxx</id>
                    <url>https://xxxx</url>
                    <releases>
              		    <enabled>true</enabled>
						<updatePolicy>always</updatePolicy>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
						<updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>

关键点在于: enabled -> true,updatePolicy -> true,这样每次构建是都会去刷新依赖。

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐