Maven Missing artifact org.geotools:gt-shapefile:jar:11-SNAPSHOT

Hello I am trying to write a simple geotools project with maven. Actually I am very new to maven. I opened new maven project I set the setting and write some code. As I know maven should download and install the needed jar files of geotools. But A am getting "Missing artifact org.geotools:gt-shapefile:jar:11-SNAPSHOT" error and I cannot understand why is that.

My working envirement:

Eclipse Kepler, Jdk 6, Maven-Latest release, Geotools-Latest release

Here is my pom.xml

<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>org.geotools</groupId>
<artifactId>tutorial</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>tutorial</name>
<url>http://maven.apache.org</url>
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <geotools.version>11-SNAPSHOT</geotools.version>
</properties>
<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt-shapefile</artifactId>
        <version>${geotools.version}</version>
    </dependency>
    <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt-swing</artifactId>
        <version>${geotools.version}</version>
    </dependency>
</dependencies>
<repositories>
    <repository>
        <id>maven2-repository.dev.java.net</id>
        <name>Java.net repository</name>
        <url>http://download.java.net/maven/2</url>
    </repository>
    <repository>
        <id>osgeo</id>
        <name>Open Source Geospatial Foundation Repository</name>
        <url>http://download.osgeo.org/webdav/geotools/</url>
    </repository>
</repositories>

Here is my Quickstart class

    package org.geotools.tutorial;

import java.io.File;

import org.geotools.data.FileDataStore;
import org.geotools.data.FileDataStoreFinder;
import org.geotools.data.simple.SimpleFeatureSource;
import org.geotools.map.FeatureLayer;
import org.geotools.map.Layer;
import org.geotools.map.MapContent;
import org.geotools.styling.SLD;
import org.geotools.styling.Style;
import org.geotools.swing.JMapFrame;
import org.geotools.swing.data.JFileDataStoreChooser;

/**
 * Prompts the user for a shapefile and displays the contents on the screen in a map frame.
 * <p>
 * This is the GeoTools Quickstart application used in documentationa and tutorials. *
 */
public class Quickstart {

    /**
     * GeoTools Quickstart demo application. Prompts the user for a shapefile and displays its
     * contents on the screen in a map frame
     */
    public static void main(String[] args) throws Exception {
        // display a data store file chooser dialog for shapefiles
        File file = JFileDataStoreChooser.showOpenFile("shp", null);
        if (file == null) {
            return;
        }

        FileDataStore store = FileDataStoreFinder.getDataStore(file);
        SimpleFeatureSource featureSource = store.getFeatureSource();

        // Create a map content and add our shapefile to it
        MapContent map = new MapContent();
        map.setTitle("Quickstart");

        Style style = SLD.createSimpleStyle(featureSource.getSchema());
        Layer layer = new FeatureLayer(featureSource, style);
        map.addLayer(layer);

        // Now display the map
        JMapFrame.showMap(map);
    }

}

I just wrote the codes I didn't download or install any jars. I opened the project as maven project. I wonder when and how maven is downloading and installing jars?

Thank you.

Answers


Try replacing repository URL with: http://repo.opengeo.org/


Maven downloading and putting jars to local repository during one of its lifecycle phases im not sure which one, but if you run mvn clean install it should download all jars required by your project.


For me, adding following fixed the problem. It try to get GeoTools from following repo since it is not on maven central.

<repository>
    <id>osgeo</id>
    <name>Geotools repository</name>
    <url>http://download.osgeo.org/webdav/geotools</url>
</repository>

I had the same problem, replacing repository with URL "http://repo.opengeo.org/" works for me!


This is a pretty old post, but I had this problem recently and solved it by replacing

http://repo.opengeo.org/ with http://repo.boundlessgeo.com/main/


Need Your Help

Issues with WCF and SOAP WS-Security PlainText Username (No SSL)

c# wcf soap ws-security

We need to consume a SOAP 1.1 Web Service, developed using Java, from within a C#/.Net 4.0 application. We have no access to the service programming or the server it resides on. The service is ex...