Bonjour,
J'ai construit un projet GWT avec Maven.
Pour eclispe, j'ai le plugin GWT et Maven.
Dans un premier temps, j'ai construit un archetype comme expliqué ici en ligne de commande.
Ensuite, j'ai importer le projet Maven.
J'ai nettoyé (le POM, la version de Java ...) et j'obtiens ça:
Le POM ressemble à ça:
Un maven built, c'est OK, j'obtiens un magnifique .war (qui se déploie sous Tomcat par exemple).
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <?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"> <!-- POM file generated with GWT webAppCreator --> <modelVersion>4.0.0</modelVersion> <groupId>projet</groupId> <artifactId>projet</artifactId> <packaging>war</packaging> <version>1</version> <name>GWT Maven Archetype</name> <properties> <!-- Convenience property to set the GWT version --> <gwtVersion>2.4.0</gwtVersion> <!-- GWT needs at least java 1.5 --> <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>com.google.gwt</groupId> <artifactId>gwt-servlet</artifactId> <version>${gwtVersion}</version> <scope>runtime</scope> </dependency> <dependency> <groupId>com.google.gwt</groupId> <artifactId>gwt-user</artifactId> <version>${gwtVersion}</version> <scope>provided</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.7</version> <scope>test</scope> </dependency> <dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <version>1.0.0.GA</version> <scope>test</scope> </dependency> <dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <version>1.0.0.GA</version> <classifier>sources</classifier> <scope>test</scope> </dependency> </dependencies> <build> <!-- Generate compiled stuff in the folder used for developing mode --> <outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory> <plugins> <!-- GWT Maven Plugin --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <version>2.4.0</version> <executions> <execution> <goals> <goal>compile</goal> <goal>test</goal><!-- <goal>i18n</goal> <goal>generateAsync</goal>--> </goals> </execution> </executions> <!-- Plugin configuration. There are many available options, see gwt-maven-plugin documentation at codehaus.org --> <configuration> <runTarget>projet.html</runTarget> <hostedWebapp>${webappDirectory}</hostedWebapp><!-- <i18nMessagesBundle>com.projet.client.Messages</i18nMessagesBundle>--> </configuration> </plugin> <!-- Copy static web files before executing gwt:run --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <executions> <execution> <phase>compile</phase> <goals><!-- <goal>exploded</goal>--> </goals> </execution> </executions> <configuration> <webappDirectory>${webappDirectory}</webappDirectory> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> </plugins> </build> </project>
Le problème est lorsque je veux lancer via Eclipse pour debugger, en utilisant Jetty.
J'obtiens ça:
Je pense donc qu'il faut spécifier le module .gwt.xml.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 Missing required argument 'module[s]' Google Web Toolkit 2.4.0 DevMode [-noserver] [-port port-number | "auto"] [-whitelist whitelist-string] [-blacklist blacklist-string] [-logdir directory] [-logLevel level] [-gen dir] [-bindAddress host-name-or-address] [-codeServerPort port-number | "auto"] [-server servletContainerLauncher[:args]] [-startupUrl url] [-war dir] [-deploy dir] [-extra dir] [-workDir dir] module[s] where -noserver Prevents the embedded web server from running -port Specifies the TCP port for the embedded web server (defaults to 8888) -whitelist Allows the user to browse URLs that match the specified regexes (comma or space separated) -blacklist Prevents the user browsing URLs that match the specified regexes (comma or space separated) -logdir Logs to a file in the given directory, as well as graphically -logLevel The level of logging detail: ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL -gen Debugging: causes normally-transient generated types to be saved in the specified directory -bindAddress Specifies the bind address for the code server and web server (defaults to 127.0.0.1) -codeServerPort Specifies the TCP port for the code server (defaults to 9997) -server Specify a different embedded web server to run (must implement ServletContainerLauncher) -startupUrl Automatically launches the specified URL -war The directory into which deployable output files will be written (defaults to 'war') -deploy The directory into which deployable but not servable output files will be written (defaults to 'WEB-INF/deploy' under the -war directory/jar, and may be the same as the -extra directory/jar) -extra The directory into which extra files, not intended for deployment, will be written -workDir The compiler's working directory for internal use (must be writeable; defaults to a system temp dir) and module[s] Specifies the name(s) of the module(s) to host
Je pense qu'il faut le spécifier dans "run configuration" à la page suivante:
Mais là où ça se corse, je n'arrive pas à savoir comment spécifier le module.
C'est ici (enfin c'est ce que je pense) qu'il faut spécifier le module GWT, mais là je coince, je ne sais vraiment pas comment.
J'ai Eclipse Indigo
Partager