测试人社区

搭建mall 使用maven编译时报错

使用ubuntu系统


pom.yml文件如下:

<?xml version="1.0" encoding="UTF-8"?>


4.0.0

<groupId>com.macro.mall</groupId>
<artifactId>mall</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
    <module>mall-common</module>
    <module>mall-mbg</module>
    <module>mall-security</module>
    <module>mall-demo</module>
    <module>mall-admin</module>
    <module>mall-search</module>
    <module>mall-portal</module>
</modules>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.3.0.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>
    <skipTests>true</skipTests>
    <docker.host>http://192.168.3.101:2375</docker.host>
    <docker.maven.plugin.version>1.2.2</docker.maven.plugin.version>
    <pagehelper-starter.version>1.3.0</pagehelper-starter.version>
    <pagehelper.version>5.2.0</pagehelper.version>
    <druid.version>1.1.23</druid.version>
    <hutool.version>5.4.0</hutool.version>
    <swagger2.version>2.9.2</swagger2.version>
    <swagger-models.version>1.6.0</swagger-models.version>
    <swagger-annotations.version>1.6.0</swagger-annotations.version>
    <mybatis-generator.version>1.4.0</mybatis-generator.version>
    <mybatis.version>3.5.5</mybatis.version>
    <mysql-connector.version>8.0.20</mysql-connector.version>
    <spring-data-commons.version>2.3.0.RELEASE</spring-data-commons.version>
    <jjwt.version>0.9.0</jjwt.version>
    <aliyun-oss.version>2.5.0</aliyun-oss.version>
    <logstash-logback.version>5.3</logstash-logback.version>
    <minio.version>7.1.0</minio.version>
    <mall-common.version>1.0-SNAPSHOT</mall-common.version>
    <mall-mbg.version>1.0-SNAPSHOT</mall-mbg.version>
    <mall-security.version>1.0-SNAPSHOT</mall-security.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-aop</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>cn.hutool</groupId>
        <artifactId>hutool-all</artifactId>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-configuration-processor</artifactId>
        <optional>true</optional>
    </dependency>
</dependencies>

<dependencyManagement>
    <dependencies>
        <!--mall通用模块-->
        <dependency>
            <groupId>com.macro.mall</groupId>
            <artifactId>mall-common</artifactId>
            <version>${mall-common.version}</version>
        </dependency>
        <!--mall中MBG生成模块-->
        <dependency>
            <groupId>com.macro.mall</groupId>
            <artifactId>mall-mbg</artifactId>
            <version>${mall-mbg.version}</version>
        </dependency>
        <!--mall安全模块-->
        <dependency>
            <groupId>com.macro.mall</groupId>
            <artifactId>mall-security</artifactId>
            <version>${mall-security.version}</version>
        </dependency>
        <!--MyBatis分页插件starter-->
        <dependency>
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper-spring-boot-starter</artifactId>
            <version>${pagehelper-starter.version}</version>
        </dependency>
        <!--MyBatis分页插件-->
        <dependency>
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper</artifactId>
            <version>${pagehelper.version}</version>
        </dependency>
        <!--集成druid连接池-->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid-spring-boot-starter</artifactId>
            <version>${druid.version}</version>
        </dependency>
        <!--Hutool Java工具包-->
        <dependency>
            <groupId>cn.hutool</groupId>
            <artifactId>hutool-all</artifactId>
            <version>${hutool.version}</version>
        </dependency>
        <!--Swagger-UI API文档生产工具-->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>${swagger2.version}</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>${swagger2.version}</version>
        </dependency>
        <!--解决Swagger 2.9.2版本NumberFormatException-->
        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-models</artifactId>
            <version>${swagger-models.version}</version>
        </dependency>
        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-annotations</artifactId>
            <version>${swagger-annotations.version}</version>
        </dependency>
        <!-- MyBatis 生成器 -->
        <dependency>
            <groupId>org.mybatis.generator</groupId>
            <artifactId>mybatis-generator-core</artifactId>
            <version>${mybatis-generator.version}</version>
        </dependency>
        <!-- MyBatis-->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>${mybatis.version}</version>
        </dependency>
        <!--Mysql数据库驱动-->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>${mysql-connector.version}</version>
        </dependency>
        <!--SpringData工具包-->
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-commons</artifactId>
            <version>${spring-data-commons.version}</version>
        </dependency>
        <!--JWT(Json Web Token)登录支持-->
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt</artifactId>
            <version>${jjwt.version}</version>
        </dependency>
        <!-- 阿里云OSS -->
        <dependency>
            <groupId>com.aliyun.oss</groupId>
            <artifactId>aliyun-sdk-oss</artifactId>
            <version>${aliyun-oss.version}</version>
        </dependency>
        <!--集成logstash-->
        <dependency>
            <groupId>net.logstash.logback</groupId>
            <artifactId>logstash-logback-encoder</artifactId>
            <version>${logstash-logback.version}</version>
        </dependency>
        <!--MinIO JAVA SDK-->
        <dependency>
            <groupId>io.minio</groupId>
            <artifactId>minio</artifactId>
            <version>${minio.version}</version>
        </dependency>
    </dependencies>
</dependencyManagement>

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

看提示貌似是maven版本的问题,换个版本试试

[INFO]
[INFO] ---------------------< com.macro.mall:mall-common >---------------------
[INFO] Building mall-common 1.0-SNAPSHOT [2/8]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] — maven-resources-plugin:3.1.0:resources (default-resources) @ mall-common —
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] Copying 1 resource
[INFO]
[INFO] — maven-compiler-plugin:3.8.1:compile (default-compile) @ mall-common —
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 15 source files to /root/mall/mall-common/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] 读取/root/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.11.0/jackson-databind-2.11.0.jar时出错; zip file is empty
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/api/CommonResult.java:[1,1] 无法访问com.macro.mall.common.api
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/config/BaseSwaggerConfig.java:[1,1] 无法访问com.macro.mall.common.config
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/service/RedisService.java:[1,1] 无法访问com.macro.mall.common.service
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/log/WebLogAspect.java:[1,1] 无法访问com.macro.mall.common.log
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/exception/Asserts.java:[1,1] 无法访问com.macro.mall.common.exception
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/domain/WebLog.java:[1,1] 无法访问com.macro.mall.common.domain
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/service/impl/RedisServiceImpl.java:[1,1] 无法访问com.macro.mall.common.service.impl
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/util/RequestUtil.java:[1,1] 无法访问com.macro.mall.common.util
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/api/CommonPage.java:[12,8] 无法访问java.lang
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/api/IErrorCode.java:[7,8] 无法访问com.macro.mall.common
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/exception/GlobalExceptionHandler.java:[17,8] 无法访问com.macro.mall
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/exception/ApiException.java:[9,8] 无法访问com.macro
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/api/ResultCode.java:[7,8] 无法访问com
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/config/BaseRedisConfig.java:[3,11] 无法访问com.fasterxml
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/config/BaseRedisConfig.java:[3,21] 无法访问com.fasterxml.jackson
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/config/BaseRedisConfig.java:[4,29] 无法访问com.fasterxml.jackson.annotation
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/config/BaseRedisConfig.java:[5,29] 无法访问com.fasterxml.jackson.databind
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/config/BaseRedisConfig.java:[6,38] 无法访问com.fasterxml.jackson.databind.jsontype
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/config/BaseRedisConfig.java:[6,47] 无法访问com.fasterxml.jackson.databind.jsontype.impl
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/config/BaseRedisConfig.java:[9,8] 无法访问org
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/config/BaseRedisConfig.java:[9,11] 无法访问org.springframework
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/config/BaseRedisConfig.java:[10,27] 无法访问org.springframework.data
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/config/BaseRedisConfig.java:[10,32] 无法访问org.springframework.data.redis
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/config/BaseRedisConfig.java:[11,38] 无法访问org.springframework.data.redis.cache
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/config/BaseRedisConfig.java:[13,38] 无法访问org.springframework.data.redis.connection
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/config/BaseRedisConfig.java:[14,38] 无法访问org.springframework.data.redis.core
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/config/BaseRedisConfig.java:[15,38] 无法访问org.springframework.data.redis.serializer
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/config/BaseRedisConfig.java:[20,12] 无法访问java.time
zip END header not found
[ERROR] /root/mall/mall-common/src/main/java/com/macro/mall/common/domain/SwaggerProperties.java:[3,8] 无法访问lombok
zip END header not found
[INFO] 30 errors
[INFO] -------------------------------------------------------------
这是报错信息