|
UsingGwtpWithMaven
IntroductionSince version 0.5 GWTP is published to Maven Central. Simply add one or more of the following sections to your POM dependencies: <!-- MVP component -->
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-mvp-client</artifactId>
<version>${gwtp.version}</version>
<scope>provided</scope>
</dependency>
<!-- Dispatch component -->
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-dispatch-client</artifactId>
<version>${gwtp.version}</version>
<scope>provided</scope> <!-- Remove for GWTP 0.5.1 and earlier -->
</dependency>
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-dispatch-server-guice</artifactId>
<!-- Or, if you use spring:
<artifactId>gwtp-dispatch-server-spring</artifactId> -->
<!-- For GWTP 0.5.1 and earlier:
<artifactId>gwtp-dispatch-server</artifactId> -->
<version>${gwtp.version}</version>
</dependency>
<!-- Crawler component -->
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-crawler</artifactId>
<version>${gwtp.version}</version>
</dependency>
<!-- Annotation component -->
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-processors</artifactId>
<version>${gwtp.version}</version>
<scope>provided</scope>
</dependency>
<!-- Tester component -->
<dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-tester</artifactId>
<version>${gwtp.version}</version>
<scope>test</scope>
</dependency>You can remove any GWTP component you don't use, for more information on the different components see LibraryOverview. You can define ${gwtp.version} in your POM <properties> or replace it directly with the version number you want to use. You should use the latest version (see the home page). In particular, you need version 0.5.1 or later if you're using GWT 2.2+. SnapshotsSnapshots of the current version are regularly deployed. If you want to use it then add the sonatype snapshot repository to your project: <repositories>
<repository>
<id>sonatype.snapshots</id>
<name>Sonatype snapshot repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<layout>default</layout>
</repository>
</repositories>and make sure you depend on the snapshot: <properties>
<gwtp.version>0.6-SNAPSHOT</gwtp.version>
</properties>You can also visit the snapshot repository from your browser. Earlier versionsYou can get versions prior to 0.5 from our own Maven repository. Excluding Spring dependenciesIf you're using gwtp-all (or gwtp-dispatch-server in GWTP 0.5.1 or earlier) you will get all the spring transitive dependencies automatically. If you don't need them (because, say, you're using Guice) then you can modify your POM as follows: <dependency>
<groupId>com.gwtplatform</groupId>
<artifactId>gwtp-all</artifactId>
<version>0.5</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
</exclusions>
</dependency>
| |
Instead of: <pluginRepositories>
(...)should be: <repositories>
(I think)
Quite right, thanks!
XML comments are not correct. Need to have two '-' characters after "<!"
Thanks! Corrected.
we have a project based on gwt-p TAB example. we're also using maven. idea was to implement each tab in its own maven module. it's not working (yet). i wonder if that sounds like a good way to approach it, or if we should just have one big module with everything inside and use Java's package mechanism to create structure.
@alexander.lochschmied It is probably possible to separate your GWT code in multiple Maven modules, but I'm not surprised if it's a bit tricky. :) Let us know if/when you succeed.
Hello,
I try to use gwtp in a maven project. I have added gwtp's dependencies in my pom but many errors in my project are shown. For example in class "ClientGinjector?", Ginjector is unknow. So the dependency "Ginjector is missing" and after many tests, i must add "gin-1.5-post-gwt-2.2.java" and "guice-assistedinject-3.0.java" Is this normal? why these dependencies are not include in a pom of gwtp's dependencies ? What's the difference between "gin-1.5-post-gwt-2.2.java" and "gin-1.5.0" of google ?
Thanks
@romain.t : I'm trying to go through the 'Getting started' page and I encountered the same issue. Looks like you need to add the gin dependency to your POM, either using gwtp-all or the separated artifacts. I'm using the following dependencies :
<dependency> <groupId>com.gwtplatform</groupId> <artifactId>gwtp-all</artifactId> <version>0.6</version> </dependency> <dependency> <groupId>com.google.gwt.inject</groupId> <artifactId>gin</artifactId> <version>1.5.0</version> </dependency>And it works fine.
Maybe this should be added somewhere to this page, as it is mentioned in the 'getting started' page that these dependencies are needed.
Did the files get removed from the snapshot repository?
No. They just changed version from 0.6-SNAPSHOT to 0.6. So you should correct POM properties:
1? http://mvnrepository.com/artifact/com.gwtplatform
OK thanks, what about 0.7?