Spring Boot Maven插件无法重新打包项目

时间:2018-09-24 13:57:59

标签: java maven spring-boot spring-boot-maven-plugin

当我尝试mvn软件包或mvn安装我的spring boot应用程序时遇到问题。 发生此错误:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.5.RELEASE:repackage (default) on project oncfmarc
h: Erreur de données (contrôle de redondance cyclique)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)

Caused by: org.apache.maven.plugin.MojoExecutionException: Erreur de données (contrôle de redondance cyclique)
    at org.springframework.boot.maven.RepackageMojo.repackage (RepackageMojo.java:223)
    at org.springframework.boot.maven.RepackageMojo.execute (RepackageMojo.java:207)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)


Caused by: java.io.IOException: Erreur de données (contrôle de redondance cyclique)
    at java.io.FileInputStream.readBytes (Native Method)
    at java.io.FileInputStream.read (FileInputStream.java:233)
    at org.springframework.boot.loader.tools.JarWriter$CrcAndSize.load (JarWriter.java:438)
    at org.springframework.boot.loader.tools.JarWriter$CrcAndSize.<init> (JarWriter.java:427)
    at org.springframework.boot.loader.tools.JarWriter.writeNestedLibrary (JarWriter.java:184)
    at org.springframework.boot.loader.tools.Repackager$WritableLibraries.write (Repackager.java:457)
    at org.springframework.boot.loader.tools.Repackager$WritableLibraries.access$200 (Repackager.java:418)
    at org.springframework.boot.loader.tools.Repackager.repackage (Repackager.java:248)
    at org.springframework.boot.loader.tools.Repackager.repackage (Repackager.java:195)
    at org.springframework.boot.maven.RepackageMojo.repackage (RepackageMojo.java:220)

该异常是类型为“数据错误-循环冗余错误”的IOException。 我试图将我的项目放在另一个硬盘中,但是当我尝试打包该项目时会抛出相同的异常。 我将IntelliJ IDEA用作IDE,并且该应用程序没有错误,我可以正常执行

这是我的pom XML文件:

<?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.oncf</groupId>
    <artifactId>oncfmarch</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>oncfmarch</name>
    <description>Gestion des marchés pour l&#39;ONCF</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.5.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>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-rest</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <!-- optional, it brings userful tags to display spring security stuff -->
        <dependency>
            <groupId>org.thymeleaf.extras</groupId>
            <artifactId>thymeleaf-extras-springsecurity4</artifactId>
        </dependency>
        <!-- hot swapping, disable cache for template, enable live reload -->

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </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>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
        </dependency>
    </dependencies>

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

我提到,在进行一些更改之前,我可以生成我项目的jar文件,并且可以在没有任何异常的情况下通过customdetailuser使用spring boot security。

谢谢

0 个答案:

没有答案