My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
UsingGwtpWithMaven  
How to use configure your POM to get GWTP from Maven central.
Type-Documentation, Featured
Updated Jul 18, 2011 by philippe.beaudoin

Introduction

Since 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+.

Snapshots

Snapshots 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 versions

You can get versions prior to 0.5 from our own Maven repository.

Excluding Spring dependencies

If 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>
Comment by vruiz.ju...@gmail.com, Feb 17, 2011

Instead of: <pluginRepositories>

<pluginRepository>
(...)

should be: <repositories>

<repository>

(I think)

Comment by project member philippe.beaudoin, Feb 17, 2011

Quite right, thanks!

Comment by tahir.ak...@gmail.com, Jul 18, 2011

XML comments are not correct. Need to have two '-' characters after "<!"

Comment by project member philippe.beaudoin, Jul 18, 2011

Thanks! Corrected.

Comment by alexande...@gmail.com, Oct 25, 2011

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.

Comment by project member philippe.beaudoin, Nov 3, 2011

@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.

Comment by romain.t...@gmail.com, Dec 4, 2011

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

Comment by den...@gmail.com, Jan 18, 2012

@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.

Comment by l...@ghue.net, Jan 30, 2012

Did the files get removed from the snapshot repository?

Comment by viaches...@dobromyslov.ru, Jan 30, 2012

No. They just changed version from 0.6-SNAPSHOT to 0.6. So you should correct POM properties:

<properties>
<gwtp.version>0.6</gwtp.version>
</properties>

1? http://mvnrepository.com/artifact/com.gwtplatform

Comment by l...@ghue.net, Jan 31, 2012

OK thanks, what about 0.7?


Sign in to add a comment
Powered by Google Project Hosting