Problem getting started with GeoTools 2.6 M2

6 messages Options
Embed this post
Permalink
Andy Turner

Problem getting started with GeoTools 2.6 M2

Reply Threaded More More options
Print post
Permalink
Hi and thanks everyone for the great work on GeoTools,

Sorry for the length of this email and thanks in advance if you can help.

I'm trying to start using GeoTools again and am following the instructions at the following:
http://www.geotools.org/quickstart.html

In the section "Depending on GeoTools" pom.xml is edited, is something missing?

I've got stuck at the section "Modifying Main" adding the import etc.

I've had a tinker around trying to get the missing resources, but I feel sure I'm doing something wrong or am missing something.

When I try to build the example I get the following (At the end of this email I've pasted my pom.xml file):

NetBeans: Executing 'C:\Work\src\lib\apps\maven\apache-maven-2.2.1-bin\apache-maven-2.2.1\bin\mvn.bat -Dnetbeans.execution=true install'
NetBeans:      JAVA_HOME =C:\Program Files\Java\jdk1.6.0_07
Scanning for projects...
------------------------------------------------------------------------
Building example
   task-segment: [install]
------------------------------------------------------------------------
[resources:resources]
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory C:\Work\src\lib\java\GeoTools\geotools-2.6-M2-project\geotools-2.6-M2\example\src\main\resources
Downloading: http://download.java.net/maven/2/org/geotools/gt-main/1.0-SNAPSHOT/gt-main-1.0-SNAPSHOT.pom
Unable to find resource 'org.geotools:gt-main:pom:1.0-SNAPSHOT' in repository maven2-repository.dev.java.net (http://download.java.net/maven/2)
Downloading: http://download.osgeo.org/webdav/geotools//org/geotools/gt-main/1.0-SNAPSHOT/gt-main-1.0-SNAPSHOT.pom
Unable to find resource 'org.geotools:gt-main:pom:1.0-SNAPSHOT' in repository osgeo (http://download.osgeo.org/webdav/geotools/)
Downloading: http://repo.opengeo.org/org/geotools/gt-main/1.0-SNAPSHOT/gt-main-1.0-SNAPSHOT.pom
Unable to find resource 'org.geotools:gt-main:pom:1.0-SNAPSHOT' in repository opengeo (http://repo.opengeo.org)
Downloading: http://download.java.net/maven/2/org/geotools/xsd/gt-xsd-filter/1.0-SNAPSHOT/gt-xsd-filter-1.0-SNAPSHOT.pom
Unable to find resource 'org.geotools.xsd:gt-xsd-filter:pom:1.0-SNAPSHOT' in repository maven2-repository.dev.java.net (http://download.java.net/maven/2)
Downloading: http://download.osgeo.org/webdav/geotools//org/geotools/xsd/gt-xsd-filter/1.0-SNAPSHOT/gt-xsd-filter-1.0-SNAPSHOT.pom
Unable to find resource 'org.geotools.xsd:gt-xsd-filter:pom:1.0-SNAPSHOT' in repository osgeo (http://download.osgeo.org/webdav/geotools/)
Downloading: http://repo.opengeo.org/org/geotools/xsd/gt-xsd-filter/1.0-SNAPSHOT/gt-xsd-filter-1.0-SNAPSHOT.pom
Unable to find resource 'org.geotools.xsd:gt-xsd-filter:pom:1.0-SNAPSHOT' in repository opengeo (http://repo.opengeo.org)
Downloading: http://download.java.net/maven/2/org/geotools/gt-main/1.0-SNAPSHOT/gt-main-1.0-SNAPSHOT.jar
Downloading: http://download.java.net/maven/2/org/geotools/xsd/gt-xsd-filter/1.0-SNAPSHOT/gt-xsd-filter-1.0-SNAPSHOT.jar
Unable to find resource 'org.geotools.xsd:gt-xsd-filter:jar:1.0-SNAPSHOT' in repository maven2-repository.dev.java.net (http://download.java.net/maven/2)
Unable to find resource 'org.geotools:gt-main:jar:1.0-SNAPSHOT' in repository maven2-repository.dev.java.net (http://download.java.net/maven/2)
Downloading: http://download.osgeo.org/webdav/geotools//org/geotools/xsd/gt-xsd-filter/1.0-SNAPSHOT/gt-xsd-filter-1.0-SNAPSHOT.jar
Downloading: http://download.osgeo.org/webdav/geotools//org/geotools/gt-main/1.0-SNAPSHOT/gt-main-1.0-SNAPSHOT.jar
Unable to find resource 'org.geotools.xsd:gt-xsd-filter:jar:1.0-SNAPSHOT' in repository osgeo (http://download.osgeo.org/webdav/geotools/)
Downloading: http://repo.opengeo.org/org/geotools/xsd/gt-xsd-filter/1.0-SNAPSHOT/gt-xsd-filter-1.0-SNAPSHOT.jar
Unable to find resource 'org.geotools:gt-main:jar:1.0-SNAPSHOT' in repository osgeo (http://download.osgeo.org/webdav/geotools/)
Downloading: http://repo.opengeo.org/org/geotools/gt-main/1.0-SNAPSHOT/gt-main-1.0-SNAPSHOT.jar
Unable to find resource 'org.geotools.xsd:gt-xsd-filter:jar:1.0-SNAPSHOT' in repository opengeo (http://repo.opengeo.org)
Unable to find resource 'org.geotools:gt-main:jar:1.0-SNAPSHOT' in repository opengeo (http://repo.opengeo.org)
------------------------------------------------------------------------
[ERROR]BUILD ERROR
------------------------------------------------------------------------
Failed to resolve artifact.

Missing:
----------
1) org.geotools.xsd:gt-xsd-filter:jar:1.0-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.geotools.xsd -DartifactId=gt-xsd-filter -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=org.geotools.xsd -DartifactId=gt-xsd-filter -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
          1) org.geotools.demo:example:jar:1.0-SNAPSHOT
          2) org.geotools.xsd:gt-xsd-filter:jar:1.0-SNAPSHOT

2) org.geotools:gt-main:jar:1.0-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.geotools -DartifactId=gt-main -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=org.geotools -DartifactId=gt-main -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
          1) org.geotools.demo:example:jar:1.0-SNAPSHOT
          2) org.geotools:gt-main:jar:1.0-SNAPSHOT

----------
2 required artifacts are missing.

for artifact:
  org.geotools.demo:example:jar:1.0-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  osgeo (http://download.osgeo.org/webdav/geotools/),
  maven2-repository.dev.java.net (http://download.java.net/maven/2),
  opengeo (http://repo.opengeo.org)



------------------------------------------------------------------------
For more information, run Maven with the -e switch
------------------------------------------------------------------------
Total time: 3 seconds
Finished at: Fri Sep 18 18:58:45 BST 2009
Final Memory: 10M/254M
------------------------------------------------------------------------



My pom.xml file is like this:

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <artifactId>geotools</artifactId>
    <groupId>org.geotools</groupId>
    <version>2.6-M2</version>
  </parent>
  <groupId>org.geotools.demo</groupId>
  <artifactId>example</artifactId>
  <version>1.0-SNAPSHOT</version>
  <name>example</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-main</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.geotools.xsd</groupId>
      <artifactId>gt-xsd-filter</artifactId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <!--
           Use maven from the command line:
           1. mvn exec:java -Dexec.mainClass="org.geotools.demo.example.WFSExample
           2. mvn exec:java -Dexec.mainClass="org.geotools.demo.example.WMSExample
           3. mvn exec:java -Dexec.mainClass="org.geotools.demo.example.SLDExample" -Dexec.keepAlive=true
        -->
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
</project>

I'll try again from a different machine and post back if I see my mistake.

Thanks again,

Andy
http://www.geog.leeds.ac.uk/people/a.turner/
 


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
mbedward

Re: Problem getting started with GeoTools 2.6 M2

Reply Threaded More More options
Print post
Permalink
Hi Andy,

As you guessed, something is amiss with the pom.xml on the Quickstart
page. It's been fixed but, for some reason, the new page is not
showing up on the server yet.

I think all of the errors that you're getting are due to the faulty
pom.xml. Below is what it is supposed to look like at that part of the
page (where it is cut off by the code box).

Hope this helps

Michael


<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">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.geotools.demo</groupId>
  <artifactId>example</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>example</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-main</artifactId>
      <version>2.6-M2</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>
</project>

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Andy Turner

Re: Problem getting started with GeoTools 2.6 M2

Reply Threaded More More options
Print post
Permalink
Thank you Michael, I've still not made progress, but I'll be patient and wait a few days then have another try.

BTW, I tried a different browser to see if the quick start page (http://www.geotools.org/quickstart.html) loaded better in that. I found it did not load well and was somewhat empty in Microsoft Internet Explorer 7.

Best wishes,

Andy
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
mbedward

Re: Problem getting started with GeoTools 2.6 M2

Reply Threaded More More options
Print post
Permalink
> I've still not made progress, but I'll be patient and wait a few days then have another try.
>

G'day Andy,

If the corrected pom didn't help I'd be keen to hear what sort of
problems you're still having. Jody and I are trying to whip the
quickstart and example pages and code into shape at the moment so any
feedback would be very helpful.

cheers
Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Andy Turner

Re: Problem getting started with GeoTools 2.6 M2

Reply Threaded More More options
Print post
Permalink
Eyup,

Sorry Michael, I tried again and it worked :-) I'm not sure what went wrong before, perhaps something to do with email adding extra line breaks... Anyway, I started with the example again and just copied the extra dependency and the resources section from your email and it worked. I thought I'd tried this before already without it working, but nevermind, I'm through this stage and I'm sure you'll get the web page fixed and hopefully others can get through this bit no problem.

Despite this issue, I'm very impressed with the documentation, and it was great that you got back to me so fast.

Thank you very much for your help and encouragement.

I'm now looking forward to hitting the ground running when I'm back to work on Monday.

Andy
________________________________________
From: Michael Bedward [[hidden email]]
Sent: 19 September 2009 10:50
To: Andy Turner
Cc: [hidden email]
Subject: Re: [Geotools-gt2-users] Problem getting started with GeoTools 2.6 M2

> I've still not made progress, but I'll be patient and wait a few days then have another try.
>

G'day Andy,

If the corrected pom didn't help I'd be keen to hear what sort of
problems you're still having. Jody and I are trying to whip the
quickstart and example pages and code into shape at the moment so any
feedback would be very helpful.

cheers
Michael
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Andy Turner

Re: Problem getting started with GeoTools 2.6 M2

Reply Threaded More More options
Print post
Permalink
In reply to this post by mbedward
Just to let you know, the quickstart (http://www.geotools.org/quickstart.html) instructions only work for me if I keep the dependency for junit as per in the original example pom.xml. That is, there may be an issue in changing:

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>

To:

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>provided</scope>
    </dependency>

Andy
http://www.geog.leeds.ac.uk/people/a.turner/
 
-----Original Message-----
From: Michael Bedward [mailto:[hidden email]]
Sent: 19 September 2009 10:50
To: Andy Turner
Cc: [hidden email]
Subject: Re: [Geotools-gt2-users] Problem getting started with GeoTools 2.6 M2

> I've still not made progress, but I'll be patient and wait a few days then have another try.
>

G'day Andy,

If the corrected pom didn't help I'd be keen to hear what sort of
problems you're still having. Jody and I are trying to whip the
quickstart and example pages and code into shape at the moment so any
feedback would be very helpful.

cheers
Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users