From: Michael B. <mic...@gm...> - 2008-07-07 08:19:27
|
OK - the reason you're getting a warning in Netbeans about the coverage.grid package and the GridCoverage2D class is because you don't have gt2-coverage in your pom.xml so maven hasn't installed it for you. Here's (roughly) how it works. For every geotools class that you use in your app you need the corresponding jar installed in your local repository. Maven will install the jars for you if you tell it that you need them and you do that with the dependency entries in your pom. In Netbeans, if you look in the Libraries section of your Project tree you will see the jars that are already attached to the project. Some of these will correspond to modules (artifacts in maven-speak) that you've specified in your pom. Some of them will be additional jars that the specified ones depend on - maven calls these transitive dependencies and drags them in for you automagically. This is why you may find that you have some geotools modules in the Project->Libraries list that you haven't specified in the pom - they were required by modules that you did specify. In your case gt2-coverage hasn't yet been installed as either a direct or a transitive dependency, so you need to add it to the pom.xml. 2008/7/7 fx5900 <luo...@ho...>: > > Hi Michael, > > Thanks for replying, at this moment in time, no, the dependencies i do > have is the following: > <dependencies> > > <dependency> > <groupId>junit</groupId> > <artifactId>junit</artifactId> > <version>3.8.1</version> > <scope>test</scope> > </dependency> > > <dependency> > <groupId>org.geotools</groupId> > <artifactId>gt2-image</artifactId> > <version>${project.version}</version> > </dependency> > > <dependency> > <groupId>javax.media</groupId> > <artifactId>jai_core</artifactId> > <version>1.1.3</version> > </dependency> > > <dependency> > <groupId>javax.media</groupId> > <artifactId>jai_codec</artifactId> > <version>1.1.3</version> > </dependency> > > <dependency> > <groupId>javax.media</groupId> > <artifactId>jai_imageio</artifactId> > <version>1.1</version> > </dependency> > > </dependencies> > > Cheers > > > Michael Bedward wrote: >> >> Hi Luong, >> >> Probably best to take it one thing at a time... >> >> Do you have gt2-coverage in the dependencies section of your pom.xml ? >> It needs to be there for maven to download and install the jar when >> you build your project. >> >> Michael >> >> 2008/7/7 fx5900 <luo...@ho...>: >>> >>> Hi Michael, >>> >>> I installed the 3 jar files manually which was successful. Then after >>> updating the local repository index i still could not see the jar files >>> in >>> my tree structure. In the Miscellaneous tab, i left the local repository >>> blank and did a clean/build process, but i still keep on getting the same >>> error messages. Is there a way for me try and build the file on the >>> command >>> prompt? just to see what kind of result i get. Is it possible that there >>> might be something wrong with the NB6 i have? perhaps uninstalling and >>> re-installing it may help or is that necessary? >>> >>> In my ImageLab.java file i have the following code so far: >>> >>> >>> package org.geotools.demo; >>> >>> >>> >>> >>> import javax.swing.*; >>> >>> >>> >>> import org.geotools.coverage.grid.GridCoverage2D; >>> >>> >>> /** >>> * >>> * @author XXXXX >>> */ >>> public class ImageLab extends JDialog { >>> >>> /** Original coverage we are working on */ >>> GridCoverage2D coverage; >>> >>> } >>> >>> >>> >>> In my import org.geotools..... statement i have an error showing up >>> stating >>> that package org.geotools.coverage.grid does not exist. Now, do you know >>> where i can download this package because in my C:\Documents and >>> Settings\luong\.m2\org\geotools folder, i to do not have this. >>> >>> Cheers. >>> >>> >>> Michael Bedward wrote: >>>> >>>> Hi Luong, >>>> >>>> The error message look like either there was a prob with your internet >>>> connection at the time or you hit heavy traffic. The best first thing >>>> to do in such cases is wait a while then just try it again - often >>>> works. >>>> >>>> IF you do have to install a file manually, the error message it >>>> telling you how to do it. E.g. if you've got jai_imageio.jar in >>>> C:\documents so cd into that directory and issue this command: >>>> >>>> mvn install:install-file -DgroupId=javax.media >>>> -DartifactId=jai_imageio -Dversion=1.1 -Dpackaging=jar >>>> -Dfile=jai_imageio.jar >>>> >>>> (you just copy and paste the text from the error message and edit the >>>> filename) >>>> >>>> Maven will then put the jar into your repository in the correct >>>> location and with all the dir and filenames set properly. >>>> >>>> Michael >>>> >>>> >>>> 2008/7/4 fx5900 <luo...@ho...>: >>>>> >>>>> Hi am reading the ImageLabe lesson >>>>> http://docs.codehaus.org/display/GEOTDOC/08+ImageLab >>>>> http://docs.codehaus.org/display/GEOTDOC/08+ImageLab and have added >>>>> the >>>>> JAR >>>>> dependecy code for both Java Advanced Imaging and Image IO. However, >>>>> after >>>>> did that and did a clean and build process i got a few errors >>>>> >>>>> ERROR]Transitive dependency resolution for scope: compile has failed >>>>> for >>>>> your project. >>>>> [ERROR]Error message: Missing: >>>>> [ERROR]---------- >>>>> [ERROR]1) org.geotools:gt2-image:jar:1.0-SNAPSHOT >>>>> [ERROR] Try downloading the file manually from the project website. >>>>> [ERROR] Then, install it using the command: >>>>> [ERROR] mvn install:install-file -DgroupId=org.geotools >>>>> -DartifactId=gt2-image -Dversion=1.0-SNAPSHOT -Dpackaging=jar >>>>> -Dfile=/path/to/file >>>>> [ERROR] Alternatively, if you host your own repository you can deploy >>>>> the >>>>> file there: >>>>> [ERROR] mvn deploy:deploy-file -DgroupId=org.geotools >>>>> -DartifactId=gt2-image -Dversion=1.0-SNAPSHOT -Dpackaging=jar >>>>> -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] >>>>> [ERROR] Path to dependency: >>>>> [ERROR] 1) org.geotools.demo:gt2-image:jar:1.0-SNAPSHOT >>>>> [ERROR] 2) org.geotools:gt2-image:jar:1.0-SNAPSHOT >>>>> [ERROR]2) javax.media:jai_core:jar:1.1.3 >>>>> [ERROR] Try downloading the file manually from the project website. >>>>> [ERROR] Then, install it using the command: >>>>> [ERROR] mvn install:install-file -DgroupId=javax.media >>>>> -DartifactId=jai_core -Dversion=1.1.3 -Dpackaging=jar >>>>> -Dfile=/path/to/file >>>>> [ERROR] Alternatively, if you host your own repository you can deploy >>>>> the >>>>> file there: >>>>> [ERROR] mvn deploy:deploy-file -DgroupId=javax.media >>>>> -DartifactId=jai_core -Dversion=1.1.3 -Dpackaging=jar >>>>> -Dfile=/path/to/file >>>>> -Durl=[url] -DrepositoryId=[id] >>>>> [ERROR] Path to dependency: >>>>> [ERROR] 1) org.geotools.demo:gt2-image:jar:1.0-SNAPSHOT >>>>> [ERROR] 2) javax.media:jai_core:jar:1.1.3 >>>>> [ERROR]3) javax.media:jai_codec:jar:1.1.3 >>>>> [ERROR] Try downloading the file manually from the project website. >>>>> [ERROR] Then, install it using the command: >>>>> [ERROR] mvn install:install-file -DgroupId=javax.media >>>>> -DartifactId=jai_codec -Dversion=1.1.3 -Dpackaging=jar >>>>> -Dfile=/path/to/file >>>>> [ERROR] Alternatively, if you host your own repository you can deploy >>>>> the >>>>> file there: >>>>> [ERROR] mvn deploy:deploy-file -DgroupId=javax.media >>>>> -DartifactId=jai_codec -Dversion=1.1.3 -Dpackaging=jar >>>>> -Dfile=/path/to/file >>>>> -Durl=[url] -DrepositoryId=[id] >>>>> [ERROR] Path to dependency: >>>>> [ERROR] 1) org.geotools.demo:gt2-image:jar:1.0-SNAPSHOT >>>>> [ERROR] 2) javax.media:jai_codec:jar:1.1.3 >>>>> [ERROR]4) javax.media:jai_imageio:jar:1.1 >>>>> [ERROR] Try downloading the file manually from the project website. >>>>> [ERROR] Then, install it using the command: >>>>> [ERROR] mvn install:install-file -DgroupId=javax.media >>>>> -DartifactId=jai_imageio -Dversion=1.1 -Dpackaging=jar >>>>> -Dfile=/path/to/file >>>>> [ERROR] Alternatively, if you host your own repository you can deploy >>>>> the >>>>> file there: >>>>> [ERROR] mvn deploy:deploy-file -DgroupId=javax.media >>>>> -DartifactId=jai_imageio -Dversion=1.1 -Dpackaging=jar >>>>> -Dfile=/path/to/file >>>>> -Durl=[url] -DrepositoryId=[id] >>>>> [ERROR] Path to dependency: >>>>> [ERROR] 1) org.geotools.demo:gt2-image:jar:1.0-SNAPSHOT >>>>> [ERROR] 2) javax.media:jai_imageio:jar:1.1 >>>>> [ERROR]---------- >>>>> [ERROR]4 required artifacts are missing. >>>>> [ERROR]for artifact: >>>>> [ERROR] org.geotools.demo:gt2-image:jar:1.0-SNAPSHOT >>>>> [ERROR]from the specified remote repositories: >>>>> [ERROR] central (http://repo1.maven.org/maven2) >>>>> [ERROR]Group-Id: org.geotools.demo >>>>> [ERROR]Artifact-Id: gt2-image >>>>> [ERROR]Version: 1.0-SNAPSHOT >>>>> [ERROR]From file: C:\MyNBProjects\gt2-image\pom.xml >>>>> . >>>>> So what i did was downloaded the JAI files manually, placed the >>>>> jai-1_1_2 >>>>> file in my C:\Documents and Settings\luong\.m2\repository and updated >>>>> the >>>>> index on my NB6 but it did not show up on the tree. I have not >>>>> downloaded >>>>> the Image IO files as of yet. Can somebody suggest what i could do >>>>> please. >>>>> -- >>>>> View this message in context: >>>>> http://www.nabble.com/ImageLab-Tutorial-Question-tp18268257p18268257.html >>>>> Sent from the geotools-gt2-users mailing list archive at Nabble.com. >>>>> >>>>> >>>>> ------------------------------------------------------------------------- >>>>> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! >>>>> Studies have shown that voting for your favorite open source project, >>>>> along with a healthy diet, reduces your potential for chronic lameness >>>>> and boredom. Vote Now at http://www.sourceforge.net/community/cca08 >>>>> _______________________________________________ >>>>> Geotools-gt2-users mailing list >>>>> Geo...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >>>>> >>>> >>>> ------------------------------------------------------------------------- >>>> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! >>>> Studies have shown that voting for your favorite open source project, >>>> along with a healthy diet, reduces your potential for chronic lameness >>>> and boredom. Vote Now at http://www.sourceforge.net/community/cca08 >>>> _______________________________________________ >>>> Geotools-gt2-users mailing list >>>> Geo...@li... >>>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >>>> >>>> >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/ImageLab-Tutorial-Question-tp18268257p18306509.html >>> Sent from the geotools-gt2-users mailing list archive at Nabble.com. >>> >>> >>> ------------------------------------------------------------------------- >>> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! >>> Studies have shown that voting for your favorite open source project, >>> along with a healthy diet, reduces your potential for chronic lameness >>> and boredom. Vote Now at http://www.sourceforge.net/community/cca08 >>> _______________________________________________ >>> Geotools-gt2-users mailing list >>> Geo...@li... >>> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >>> >> >> ------------------------------------------------------------------------- >> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! >> Studies have shown that voting for your favorite open source project, >> along with a healthy diet, reduces your potential for chronic lameness >> and boredom. Vote Now at http://www.sourceforge.net/community/cca08 >> _______________________________________________ >> Geotools-gt2-users mailing list >> Geo...@li... >> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >> >> > > -- > View this message in context: http://www.nabble.com/ImageLab-Tutorial-Question-tp18268257p18311400.html > Sent from the geotools-gt2-users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Geotools-gt2-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > |