Good day. There is an empty Maven project with added support for the GWT framework. If you run the application as a GWT application - everything is ok. Those. A page is formed with default text and a button. But I should add the line to pom.xml :

<packaging>war</packaging> 

- nothing works. A blank html page pops up with the error:

Problem accessing /gwt2war.html. Reason: Not Found

My 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>ru.javastudy</groupId> <artifactId>gwt2war</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <properties> <gwt.version>2.6.0</gwt.version> </properties> <dependencies> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.6</version> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <version>2.6.0</version> </plugin> </plugins> </build> 

Project structure:

enter image description here

    1 answer 1

    Move all the contents from the /war directory to /src/main/webapp (you don't have it). Plus you have no dependencies gwt in the dependencies section. It needs to be added

     <dependency> <groupId>com.google.gwt</groupId> <artifactId>gwt-user</artifactId> <version>2.6.0</version> </dependency>