my pom.xml for gwt app

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ru.miit.elearning.weblab.gwt.ui</groupId>
<artifactId>maven-example</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>maven-example</name>
<properties>
<!-- convenience to define GWT version in one place -->
<gwt.version>1.6.4</gwt.version>
<!-- tell the compiler we can use 1.5 -->
<maven.compiler.source>1.5</maven.compiler.source>
<maven.compiler.target>1.5</maven.compiler.target>
<!-- define a transient output directory for gwt -->
<gwt.output.directory>${basedir}/target/gwt</gwt.output.directory>
<!-- the value of the rename-to attribute in your GWT module configuration -->
<gwt.module.alias>Application</gwt.module.alias>
</properties>
<dependencies>
<!-- GWT dependencies (from central repo) -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwt.version}</version>
<scope>runtime</scope>
</dependency>
<!-- test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<!-- Compile classes into the war transient directory for hosted mode live editing -->
<outputDirectory>${gwt.output.directory}/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.1-SNAPSHOT</version>
<executions>
<execution>
<phase>process-classes</phase>
<configuration>
<output>${gwt.output.directory}</output>
<logLevel>INFO</logLevel>
</configuration>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<encoding>UTF-8</encoding>
<!-- Fix for GWT issue #3439 -->
<excludes>
<exclude>javax/servlet/**</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.3</version>
<!-- set encoding to something not platform dependent -->
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.2</version>
<executions>
<!-- This execution copies the war folder to the gwt transient output directory -->
<execution>
<id>war-folder-creation</id>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<copy todir="${gwt.output.directory}">
<fileset dir="${basedir}/src/main/webapp" />
</copy>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<!-- Include GWT compiler output in the war -->
<configuration>
<webResources>
<resource>
<!-- this is relative to the pom.xml directory, it's the GWT compiler output -->
<directory>${basedir}/target/${project.name}-${project.version}/${gwt.module.alias}</directory>
<!-- override the destination directory (WEB-INF/classes) for this resource -->
<targetPath>${gwt.module.alias}</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
<!-- This should really be located in your settings.xml but for simplicity's sake we will leave it here -->
<pluginRepositories>
<pluginRepository>
<id>Codehaus Mojo Snapshot</id>
<url>http://snapshots.repository.codehaus.org/</url>
</pluginRepository>
</pluginRepositories>
</project>