After a long search and test, here is the solution I came up with:
`` ``
<!-- POM --> <modelVersion>4.0.0</modelVersion> <groupId>fr.ekito.gwt</groupId> <artifactId>gwt-boot</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>Ekito Spring Boot GWT WebApp</name> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.2.5.RELEASE</version> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <start-class>fr.ekito.gwt.server.ServerApplication</start-class> <java.version>1.7</java.version> <gwtVersion>2.6.0</gwtVersion> <googleGin>2.1.2</googleGin> <outputFolder>${project.build.directory}/${artifactId}</outputFolder> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-undertow</artifactId> <exclusions> <exclusion> <groupId>io.undertow</groupId> <artifactId>undertow-websockets-jsr</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> </dependency> <dependency> <groupId>com.google.gwt</groupId> <artifactId>gwt-user</artifactId> <version>${gwtVersion}</version> </dependency> <dependency> <groupId>com.google.gwt.inject</groupId> <artifactId>gin</artifactId> <version>${googleGin}</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <mainClass>${start-class}</mainClass> <layout>ZIP</layout> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <version>${gwtVersion}</version> <executions> <execution> <goals> <goal>compile</goal> </goals> </execution> </executions> <configuration> <runTarget>GwtWebApp.html</runTarget> <persistentunitcachedir>${project.build.directory}</persistentunitcachedir> <deploy>${project.build.directory}/gwt-deploy</deploy> <webappDirectory>${project.build.directory}/classes/public</webappDirectory> </configuration> </plugin> </plugins> </build>
`` ``
my project structure is similar to the original project https://github.com/Ekito/spring-boot-gwt , with the exception of some minor changes:
- Instead of the webapp folder, I have the src / main / resources / public folder, and there is an html and css file there.
- No need for a web.xml file, spring-boot takes care of that.
- No need for WEB-INF folder.
As a result, I have a runable jar, but org.springframework.boot.loader.PropertiesLauncher is executed. A single jar works as expected, Tomcat does not work, as indicated here: http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-web-applications.html# boot-features-jsp-limitations .
In addition, I can move the lib folder outside the jar file, but in order to set the loader.path property, I need to put it in application.properties inside the jar file. I would have to use -Dloader.path, but did not work.
I will check the spring command. But so far this is promising.
Gokhan oner
source share