I installed tomcat on archlinux, I tried both tomcat7 and tomcat8. According to several sources, including official documentation, deploying a WAR file is as simple as deleting it in the webapps folder (which in my case is / var / lib / tomcat7 / webapps). WAR file exploded. However, I cannot figure out how to access my web application. On localhost: 8080 there is a tomcat webpage. I also tried localhost: 8080 / name-of-the-war-file, but this is only allowed for 404 HTTP status.
The application I used for testing is the first spring download guide: http://spring.io/guides/gs/spring-boot/
I modified the maven pom.xml build file to create a WAR file when I run the 'mvn package':
<?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>org.springframework</groupId> <artifactId>gs-spring-boot</artifactId> <version>0.1.0</version> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.2.2.RELEASE</version> </parent> <packaging>war</packaging> <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> <properties> <java.version>1.7</java.version> </properties> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project>
source share