我正在尝试将Spring Boot应用程序部署到Tomcat,因为我想部署到AWS.我创建了一个WAR文件,但它似乎不在Tomcat上运行,即使它是可见的.
详细信息:
0.这是我的应用程序:
@Configuration
@ComponentScan
@EnableAutoConfiguration
public class App {
public static void main(String[] args) {
SpringApplication.run(SampleController.class, args);
}
}
@Controller
@EnableAutoConfiguration
public class SampleController {
@RequestMapping("/help")
@ResponseBody
String home() {
String input = "Hi! Please use 'tag','check' and 'close' resources.";
return input;
}
}
Run Code Online (Sandbox Code Playgroud)
application.properties有以下内容:
server.port=${port:7777}
Run Code Online (Sandbox Code Playgroud)
http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0
<groupId>com.niewlabs</groupId>
<artifactId>highlighter</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<java.version>1.8</java.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.9.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)
我运行了"mvn package"并获得了WAR文件(大小为250Mb),我将其放入"webapps"文件夹中. …