【问题标题】:How to solve error : finished with non-zero exit value 1 in spring?如何解决错误:在春季以非零退出值 1 结束?
【发布时间】:2020-08-04 09:42:22
【问题描述】:

[系统]
Spring Boot:2.1.7 发布
摇篮:4.10.2

我通常知道上面的错误是在端口号被其他程序使用的时候出现的,但是当我更改端口时也会出现这个错误。 正如预期的那样,错误是由在 Gradle 依赖项中添加的 Apache Poi 发生的。 我想知道解决这个问题的方法。 下面是我的 Gradle 代码。

buildscript {
    ext {
        springBootVersion = '2.1.7.RELEASE'
    }
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group 'com.tistory.cafecoder'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    compile('org.springframework.boot:spring-boot-starter-web')
    compile('org.projectlombok:lombok')
    compile('org.springframework.boot:spring-boot-starter-data-jpa')
    compile('com.h2database:h2')
    compile('org.springframework.boot:spring-boot-starter-mustache')
    compile('org.springframework.boot:spring-boot-starter-oauth2-client:')
    compile('org.apache.poi:poi-ooxml:3.11')
    compile('org.apache.commons:commons-io:1.3.2')

    testCompile('org.springframework.boot:spring-boot-starter-test')
    testCompile('org.springframework.security:spring-security-test')
}

【问题讨论】:

  • Apache POI 已添加您的依赖项与端口冲突无关
  • 我觉得目前为止没有任何问题,而且我已经习惯性的关闭了服务器。由于添加Apache POI依赖后出现问题,想知道是不是这个问题。谢谢

标签: spring spring-boot gradle


【解决方案1】:

解决了。 POI 本身没有问题。我不想解决服务类中的所有问题,所以我声明了一个外部类来解析 xlsx 文件。 我使用了@RequiredArgsConstructor。 在此过程中,我将一个简单的类声明为“个人最终”时遇到了问题。 这只是缺乏对 Spring Boot 注释知识的问题.... TT

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多