配置的环境是 jdk1.8,本地代码调试编译运行都没问题 但是通过自己的服务器配置的 Jenkins 拉去代码进行 install 的时候一直提示 lombok 相关包找不到 (错误信息在下面有贴出)
网上说的很多说更改 maven-compiler-plugin 版本,试了很多还是没有效果 Linux 服务器环境是 CentOS 7.4 64 位
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.library</groupId>
<artifactId>libraryproject</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>libraryproject</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<!-- mybatis 版本号 -->
<mybatis.version>3.4.6</mybatis.version>
</properties>
<dependencies>
<!-- 引入 Caffeine 本地缓存技术 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>2.6.2</version>
</dependency>
<!-- FastJson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.47</version>
</dependency>
<!-- mybatis 核心包 -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>${mybatis.version}</version>
</dependency>
<!-- druid 数据库连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.0</version>
</dependency>
<!-- 解决 @mapper 注解问题 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.2</version>
</dependency>
<!-- lombok 快捷开发包 -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.10</version>
<scope>provided</scope>
</dependency>
<!-- easypoi 工具包 -->
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-web</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-annotation</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
</dependency>
<!-- 工具包 -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
大致的错误信息如下:
~~~执行 Maven:-B -f /root/.jenkins/workspace/LibrayProject/pom.xml 安装
[INFO]扫描项目......
[信息]
[INFO] --------------------- <com.library:libraryproject> ------------------- -
[INFO]构建 libraryproject 0.0.1-SNAPSHOT
[INFO] -------------------------------- [war] ------------ ---------------------
[信息]
[INFO] --- maven-resources-plugin:3.0.2:resources ( default-resources )@ libraryproject ---
[INFO]使用'UTF-8'编码复制过滤后的资源。
[INFO]复制 1 个资源
[INFO]复制 6 个资源
[信息]
[INFO] --- maven-compiler-plugin:3.6.2:compile ( default-compile )@ libraryproject ---
[INFO]检测到更改 - 重新编译模块!
[INFO]将 38 个源文件编译到 /root/.jenkins/workspace/LibrayProject/target/classes
[INFO] ----------------------------------------------- --------------
[ERROR]编译错误:
[INFO] ----------------------------------------- --------------------
[ERROR] /root/.jenkins/workspace/LibrayProject/src/main/java/com/library/libraryproject/entity/SeatLocation.java:[3,14]包 lombok 不存在
[错误] /root/.jenkins/workspace/LibrayProject/src/main/java/com/library/libraryproject/entity/SeatLocation.java:[4,14]包 lombok 不存在
[错误] /root/.jenkins/workspace/LibrayProject/src/main/java/com/library/libraryproject/entity/SeatLocation.java:[5,14]包 lombok 不存在
[ERROR] / root /。jenkins / workspace / LibrayProject / src / main / java / com / library / libraryproject / entity / SeatLocation.java:[6,14]包 lombok 不存在
[错误] /root/.jenkins/workspace/LibrayProject/src/main/java/com/library/libraryproject/entity/SeatLocation.java:[13,2]找不到符号
符号:class Data
[ERROR] / root /。jenkins / workspace / LibrayProject / src / main / java / com / library / libraryproject / entity / SeatLocation.java:[14,2]找不到符号
符号:class Builder
[ERROR] /root/.jenkins/workspace/LibrayProject/src /main/java/com/library/libraryproject/entity/SeatLocation.java:[15,2]找不到符号
符号:class AllArgsConstructor
[ERROR] /root/.jenkins/workspace/LibrayProject/src/main/java/com/ library / libraryproject / entity / SeatLocation.java:[16,2]找不到符号
符号:class NoArgsConstructor
[错误] /root/.jenkins/workspace/LibrayProject/src/main/java/com/library/libraryproject/controller/ManagerController.java:[7,27]包 lombok.extern.slf4j 不存在
[ERROR] / root /.jenkins/workspace/LibrayProject/src/main/java/com/library/libraryproject/controller/ManagerController.java:[8,52]包 org.springframework.beans.factory.annotation 不存在
[ERROR] / root / .jenkins / workspace / LibrayProject / src / main / java / com / library / libraryproject / controller / ManagerController.java:[9,38] package org.springframework.stereotype 不存在
[ERROR] /root/.jenkins/workspace/ LibrayProject / src / main / java / com / library / libraryproject / controller / ManagerController.java:[10,47]包 org.springframework.web.bind.annotation 不存在
[错误] /root/.jenkins/workspace/LibrayProject/src/main/java/com/library/libraryproject/controller/ManagerController.java:[11,47]包 org.springframework.web.bind.annotation 不存在
[ ERROR] /root/.jenkins/workspace/LibrayProject/src/main/java/com/library/libraryproject/controller/ManagerController.java:[18,2]找不到符号
符号:class Slf4j
[ERROR] /root/.jenkins /workspace/LibrayProject/src/main/java/com/library/libraryproject/controller/ManagerController.java:[19,2]找不到符号
符号:class Controller
[ERROR] /root/.jenkins/workspace/LibrayProject/src/ main / java / com / library / libraryproject / controller / ManagerController.java:[20,2]找不到符号
符号:class RequestMapping
[错误] /root/.jenkins/workspace/LibrayProject/src/main/java/com/library/libraryproject/entity/Manager.java:[3,14]包 lombok 不存在
[ERROR] /root/.jenkins/ workspace / LibrayProject / src / main / java / com / library / libraryproject / entity / Manager.java:[4,14] package lombok 不存在
[ERROR] /root/.jenkins/workspace/LibrayProject/src/main/java /com/library/libraryproject/entity/Manager.java:[5,14]包 lombok 不存在
[ERROR] /root/.jenkins/workspace/LibrayProject/src/main/java/com/library/libraryproject/entity/ Manager.java:[6,14]包 lombok 不存在
[错误] /root/.jenkins/workspace/LibrayProject/src/main/java/com/library/libraryproject/entity/Manager.java:[13,2]找不到符号
符号:class Data
[错误] /root/.jenkins/workspace/LibrayProject/src/main/java/com/library/libraryproject/entity/Manager.java:[14,2]找不到符号
符号:class Builder
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.