Andy, I still have the problem after I add those dependencies
could you help me?i really need to use this >.<
this is my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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>com.mycompany</groupId>
<artifactId>cobacoba</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>cobacoba</name>
<url>
http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>RELEASE</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>netbeans-public</id>
<activation>
<property>
<name>netbeans.execution</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib</classpathPrefix>
<mainClass>com.mycompany.cobacoba.App</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>nb</id>
<phase>package</phase>
<goals>
<goal>directory</goal>
</goals>
<configuration>
<descriptor>${basedir}/src/main/assemblies/netbeans-run.xml</descriptor>
<finalName>executable</finalName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<properties>
<geotools.version>2.6-M2</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-main</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-shapefile</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-epsg-hsql</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-render</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-epsg-hsql</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-swing</artifactId>
<version>${geotools.version}</version>
<!-- For this module we explicitly exclude some of its own -->
<!-- dependencies from being downloaded because they are -->
<!-- big and we don't need them -->
<exclusions>
<exclusion>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-transcoder</artifactId>
</exclusion>
</exclusions>
</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>
and this is my error log
------------------------------------------------------------------------
[ERROR]BUILD FAILURE
------------------------------------------------------------------------
Compilation failure
com/mycompany/cobacoba/Quickstart.java.java:[11,24] cannot find symbol
symbol : class FileDataStore
location: package org.geotools.data
com/mycompany/cobacoba/Quickstart.java.java:[15,25] package org.geotools.swing does not exist
com/mycompany/cobacoba/Quickstart.java.java:[16,30] package org.geotools.swing.data does not exist
com/mycompany/cobacoba/Quickstart.java.java:[30,20] cannot find symbol
symbol : variable JFileDataStoreChooser
location: class com.mycompany.cobacoba.Quickstart
com/mycompany/cobacoba/Quickstart.java.java:[35,8] cannot find symbol
symbol : class FileDataStore
location: class com.mycompany.cobacoba.Quickstart
com/mycompany/cobacoba/Quickstart.java.java:[35,49] getDataStore(java.net.URL) in org.geotools.data.FileDataStoreFinder cannot be applied to (java.io.File)
com/mycompany/cobacoba/Quickstart.java.java:[40,11] cannot access org.geotools.coverage.grid.io.AbstractGridCoverage2DReader
class file for org.geotools.coverage.grid.io.AbstractGridCoverage2DReader not found
map.addLayer(featureSource, null);
com/mycompany/cobacoba/Quickstart.java.java:[43,8] cannot find symbol
symbol : variable JMapFrame
location: class com.mycompany.cobacoba.Quickstart
------------------------------------------------------------------------
Total time: 5 seconds
Finished at: Wed Sep 30 23:35:25 ICT 2009
Final Memory: 79M/95M
------------------------------------------------------------------------
Andy Turner wrote:
To be clear, I added the following dependencies:
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-render</artifactId>
<version>${geotools.version}</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-swing</artifactId>
<version>${geotools.version}</version>
</dependency>
Now all imports resolve :-)
Andy
http://www.geog.leeds.ac.uk/people/a.turner/
-----Original Message-----
From: Michael Bedward [mailto:michael.bedward@gmail.com]
Sent: 29 September 2009 13:04
To: Andy Turner
Cc: geotools users
Subject: Re: [Geotools-gt2-users] quickstart and example pages
Hi Andy,
> It still has problems with:
> import org.geotools.map.DefaultMapContext;
> import org.geotools.map.MapContext;
> import org.geotools.swing.JMapFrame;
> import org.geotools.swing.data.JFileDataStoreChooser;
>
OK - the first two are in the gt-render module and the second two are
in the gt-swing module. They must be missing from the pom (so much for
my web page proof-reading skills !)
Add those in and see how you go.
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
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users