第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

Spring Boot 應(yīng)用程序在 STS 中工作但無(wú)法使用 java -jar 啟動(dòng)

Spring Boot 應(yīng)用程序在 STS 中工作但無(wú)法使用 java -jar 啟動(dòng)

富國(guó)滬深 2021-08-25 18:10:09
從 STS(spring 工具套件)運(yùn)行時(shí),應(yīng)用程序啟動(dòng)并正常工作,但是當(dāng)我嘗試使用 java -jar 運(yùn)行它時(shí),出現(xiàn)異常。我究竟做錯(cuò)了什么?如果它在 STS 中運(yùn)行良好,那么當(dāng)我在 tomcat 上部署這個(gè) .war 時(shí),它也運(yùn)行良好;為什么它不能與 java -jar 一起使用?有什么建議嗎?以下是我的 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.xyz</groupId>    <artifactId>youtubeservice</artifactId>    <version>0.0.1-SNAPSHOT</version>    <packaging>war</packaging>    <name>YoutubeService</name>    <description>YoutubeService</description>    <parent>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-starter-parent</artifactId>        <version>1.5.9.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>        <maven.test.skip>true</maven.test.skip>    </properties>    <dependencies>        <dependency>            <groupId>org.springframework.boot</groupId>            <artifactId>spring-boot-starter-web</artifactId>        </dependency>        <dependency>            <groupId>org.apache.tomcat.embed</groupId>            <artifactId>tomcat-embed-jasper</artifactId>            <scope>provided</scope>        </dependency>        <dependency>            <groupId>org.springframework.boot</groupId>            <artifactId>spring-boot-starter-tomcat</artifactId>            <scope>provided</scope>        </dependency>        <dependency>            <groupId>org.springframework.boot</groupId>            <artifactId>spring-boot-starter-test</artifactId>            <scope>test</scope>        </dependency>
查看完整描述

2 回答

?
慕容708150

TA貢獻(xiàn)1831條經(jīng)驗(yàn) 獲得超4個(gè)贊

Spring Boot 參考指南中的Create an Executable JAR with Maven部分很好地解釋了這一點(diǎn)。主要是你必須像這樣使用Spring Boot Maven 插件:


<plugin>

  <groupId>org.springframework.boot</groupId>

  <artifactId>spring-boot-maven-plugin</artifactId>

  <configuration>

    <mainClass>com.my.mainClass</mainClass>

  </configuration>

  <executions>

    <execution>

      <goals>

        <goal>repackage</goal>

      </goals>

    </execution>

  </executions>

</plugin>


查看完整回答
反對(duì) 回復(fù) 2021-08-25
  • 2 回答
  • 0 關(guān)注
  • 263 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)