为了账号安全,请及时绑定邮箱和手机立即绑定

Spring Boot 我的 jar 文件在哪里

Spring Boot 我的 jar 文件在哪里

三国纷争 2021-08-13 16:11:32
Spring Boot 使设置一个简单的应用程序变得非常容易。但是我需要更长的时间才能真正获得一个可以上传到远程服务器的 jar 文件。我正在使用 IntelliJ,没有命令行,我使用 gradle。该应用程序以某种方式运行在 Intellij 之外。但是创建的文件在哪里?Bootjar 中的 jar 在哪里?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.8targetCompatibility = 1.8dependencies {    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:文件夹结构:
查看完整描述

1 回答

?
慕姐8265434

TA贡献1813条经验 获得超2个赞

如果您只是在 IDE 中运行它,则不会创建 jar。为此,您需要从 IDE 或命令行运行 gradle build(在您的情况下)以将其构建到 jar 中。

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

./gradlew build

这将执行 gradle 包装器,它应该下载运行构建所需的一切,然后执行构建。

然后你会在里面找到你的罐子 build/lib


查看完整回答
反对 回复 2021-08-13
  • 1 回答
  • 0 关注
  • 479 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信