IAmYourFaja
IAmYourFaja

Reputation: 56944

Why is GWT 2.5.1 missing from Maven repo?

I just installed m2e (the Maven Eclipse plugin) and created a new Maven Project with a Quickstart archetype. I then went to the official Maven repo to pull down GWT 2.5.1's dependencies, and see that it wants you to add the following <dependency> element to your project's pom.xml file:

<dependency>
    <groupId>com.google.gwt</groupId>
    <artifactId>gwt</artifactId>
    <version>2.5.1</version>
</dependency>

So, altogether, my pom.xml looks like:

<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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.me.myorg</groupId>
    <artifactId>maven-resolver</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>maven-resolver</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt</artifactId>
            <version>2.5.1</version>
        </dependency>
    </dependencies>
</project>

I am getting the following error:

Missing artifact com.google.gwt:gwt:jar:2.5.1

And furthermore, in Eclipse's Package Explorer, under my project's Maven Dependencies library, nothing is resolving.

What's going on here? Thanks in advance!

Update: the contents of ~/.m2/repository/com/google/gwt/gwt/2.5.1 are as follows:

gwt-2.5.1.jar.lastUpdated  gwt-2.5.1.pom.sha1
gwt-2.5.1.pom              _maven.repositories

Upvotes: 0

Views: 2629

Answers (1)

Deividi Cavarzan
Deividi Cavarzan

Reputation: 10110

This gwt dependencie it's a parent pom for the gwt project. This means that the repo will only contain the hash and the pom, but not the jar.

You need to use two libraries: gwt-servlet and gwt-user:

I've found this configuration for GWT development (maybe you don't need to put the <scope> as described):

 <dependencies>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-servlet</artifactId>
      <version>2.5.1</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <version>2.5.1</version>
      <scope>provided</scope>
    </dependency>
  <dependencies>

Remove your dependencies and update your pom with these two shown above.

You can also use the gwt-maven-plugin to manage your gwt project and deploy via maven. I've found this information there.

I hope that works!

Upvotes: 2

Related Questions