Java springboot我的jar文件在哪里

Java springboot我的jar文件在哪里,java,spring-boot,jar,Java,Spring Boot,Jar,SpringBoot使安装一个简单的应用程序变得非常容易。 但实际上,我需要更长的时间才能获得一个jar文件,并将其上传到远程服务器。 我用的是IntelliJ,没有命令行,我用的是gradle。应用程序正在以某种方式耗尽Intellij。但是创建的文件在哪里?我的罐子在哪里 buildscript { repositories { mavenCentral() } dependencies { classpath("org.springf

SpringBoot使安装一个简单的应用程序变得非常容易。 但实际上,我需要更长的时间才能获得一个jar文件,并将其上传到远程服务器。 我用的是IntelliJ,没有命令行,我用的是gradle。应用程序正在以某种方式耗尽Intellij。但是创建的文件在哪里?我的罐子在哪里

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.0.RELEASE")
    }
}

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

bootJar {
    baseName = 'gs-spring-boot'
    version =  '0.1.0'
}

repositories {
    mavenCentral()
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
    compile("org.springframework.boot:spring-boot-starter-web")

    compile("org.springframework.boot:spring-boot-starter-actuator")

    testCompile("org.springframework.boot:spring-boot-starter-test")

    // add spring data repos
    compile("org.springframework.boot:spring-boot-starter-data-jpa")

    compile("org.postgresql:postgresql:42.2.4")

    // REST interface
    compile("org.springframework.boot:spring-boot-starter-data-rest")

    // Security
    compile("org.springframework.boot:spring-boot-starter-security")
}
更新:添加了项目结构的图片:

更新2:文件夹结构:


如果您只是在IDE中运行jar,则不会创建jar。为了做到这一点,您需要从IDE或命令行运行gradle构建(在您的例子中),以便将其构建到jar中

从命令行转到项目目录并键入以下内容:

./gradlew build
这将执行gradle包装器,该包装器将下载运行构建所需的所有内容,然后执行构建


然后,您将在
build/lib

中找到您的jar。好的,我在文件夹中打开了cmd,名为“gradlew build”。现在我有了一个builddir,jar位于/build/libs中。IntelliJ也可以这样做吗?