Created
September 8, 2013 17:18
-
-
Save domdorn/6486603 to your computer and use it in GitHub Desktop.
RAD with Vaadin7 and Embedded-Glassfish v4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dominikdorn.vaadin7ee.demo.example_one; | |
import com.vaadin.server.VaadinServlet; | |
/** | |
* Subclass of the VaadinServlet to fix issues with the Classloader | |
* not finding our UIs and Themes. | |
* | |
* @author Dominik Dorn <dominik -at- dominikdorn -dot- com> | |
* http://dominikdorn.com/ | |
*/ | |
public class ClassloaderFixVaadinServlet extends VaadinServlet { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"> | |
<parent> | |
<artifactId>parent</artifactId> | |
<groupId>com.dominikdorn.vaadin7ee</groupId> | |
<version>1.0-SNAPSHOT</version> | |
</parent> | |
<modelVersion>4.0.0</modelVersion> | |
<artifactId>javaee7demo</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>war</packaging> | |
<name>javaee7demo</name> | |
<properties> | |
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
<!-- don't use version 4.0 of the plugin, its broken --> | |
<embedded-glassfish.version>3.1.2.2</embedded-glassfish.version> | |
<glassfish.version>4.0</glassfish.version> | |
<vaadin.version>7.1.3</vaadin.version> | |
</properties> | |
<dependencies> | |
<dependency> | |
<groupId>javax</groupId> | |
<artifactId>javaee-web-api</artifactId> | |
<version>7.0</version> | |
<scope>provided</scope> | |
</dependency> | |
<dependency> | |
<groupId>com.vaadin</groupId> | |
<artifactId>vaadin-server</artifactId> | |
<version>${vaadin.version}</version> | |
<!-- add the vaadin dependencies to the glassfish embedded plugin deps to keep war size small --> | |
<scope>provided</scope> | |
</dependency> | |
<dependency> | |
<groupId>com.vaadin</groupId> | |
<artifactId>vaadin-client</artifactId> | |
<version>${vaadin.version}</version> | |
<scope>provided</scope> | |
</dependency> | |
<dependency> | |
<groupId>com.vaadin</groupId> | |
<artifactId>vaadin-client-compiled</artifactId> | |
<version>${vaadin.version}</version> | |
<scope>provided</scope> | |
</dependency> | |
<dependency> | |
<groupId>com.vaadin</groupId> | |
<artifactId>vaadin-themes</artifactId> | |
<version>${vaadin.version}</version> | |
<scope>provided</scope> | |
</dependency> | |
</dependencies> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>3.1</version> | |
<configuration> | |
<source>1.7</source> | |
<target>1.7</target> | |
<compilerArguments> | |
<endorseddirs>${endorsed.dir}</endorseddirs> | |
</compilerArguments> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-war-plugin</artifactId> | |
<version>2.3</version> | |
<configuration> | |
<failOnMissingWebXml>false</failOnMissingWebXml> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-dependency-plugin</artifactId> | |
<version>2.6</version> | |
<executions> | |
<execution> | |
<phase>validate</phase> | |
<goals> | |
<goal>copy</goal> | |
</goals> | |
<configuration> | |
<outputDirectory>${endorsed.dir}</outputDirectory> | |
<silent>true</silent> | |
<artifactItems> | |
<artifactItem> | |
<groupId>javax</groupId> | |
<artifactId>javaee-endorsed-api</artifactId> | |
<version>7.0</version> | |
<type>jar</type> | |
</artifactItem> | |
</artifactItems> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
<plugin> | |
<groupId>org.glassfish.embedded</groupId> | |
<artifactId>maven-embedded-glassfish-plugin</artifactId> | |
<version>${embedded-glassfish.version}</version> | |
<configuration> | |
<app>target/${project.artifactId}-${project.version}/</app> | |
<ports> | |
<http-listener>8282</http-listener> | |
<https-listener>8383</https-listener> | |
</ports> | |
<contextRoot>${project.artifactId}</contextRoot> | |
</configuration> | |
<dependencies> | |
<dependency> | |
<groupId>org.glassfish.main.common</groupId> | |
<artifactId>simple-glassfish-api</artifactId> | |
<version>${glassfish.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.glassfish.main.extras</groupId> | |
<artifactId>glassfish-embedded-all</artifactId> | |
<version>${glassfish.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.vaadin</groupId> | |
<artifactId>vaadin-client-compiled</artifactId> | |
<version>${vaadin.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.vaadin</groupId> | |
<artifactId>vaadin-client</artifactId> | |
<version>${vaadin.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.vaadin</groupId> | |
<artifactId>vaadin-themes</artifactId> | |
<version>${vaadin.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.vaadin</groupId> | |
<artifactId>vaadin-client-compiler</artifactId> | |
<version>${vaadin.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.vaadin</groupId> | |
<artifactId>vaadin-server</artifactId> | |
<version>${vaadin.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.vaadin</groupId> | |
<artifactId>vaadin-client</artifactId> | |
<version>${vaadin.version}</version> | |
</dependency> | |
</dependencies> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app | |
version="3.0" | |
xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> | |
<servlet> | |
<servlet-name>Vaadin7Example1Servlet</servlet-name> | |
<!-- we're using our own servlet to fix classloading issues --> | |
<!--<servlet-class>com.vaadin.server.VaadinServlet</servlet-class>--> | |
<servlet-class>com.dominikdorn.vaadin7ee.demo.example_one.ClassloaderFixVaadinServlet</servlet-class> | |
<init-param> | |
<param-name>UI</param-name> | |
<param-value>com.dominikdorn.vaadin7ee.demo.example_one.ExampleOneUI</param-value> | |
</init-param> | |
<async-supported>true</async-supported> | |
</servlet> | |
<servlet-mapping> | |
<servlet-name>Vaadin7Example1Servlet</servlet-name> | |
<url-pattern>/example1/*</url-pattern> | |
</servlet-mapping> | |
<servlet-mapping> | |
<servlet-name>Vaadin7Example1Servlet</servlet-name> | |
<url-pattern>/VAADIN/*</url-pattern> | |
</servlet-mapping> | |
</web-app> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment