From: James M. <j.m...@ge...> - 2002-11-20 13:25:25
|
At 11:04 20/11/2002, you wrote: >Hi folks, > >I just cvs'd a copy of all of the source and tried to build with maven. >There were lots of errors? My understanding of maven is that it should >go and get dependancies if necessary and it should build correctly. > >What did I do wrong? Hard to say without knowing what some of the errors were, could you paste some of them in a message. The following is a general discussion of the maven build system, it would be good if everyone on this list tried the system out as it is hopefully set to become the main build method soon. First, grab a recent copy of the GT2 source code, you can do this via CVS or by downloading the latest source snapshot from: http://geotools.sf.net/daily/lib/gt2-src-snapshot.tar.gz You will need the latest copy of maven, I am using beta-7 which you can download from: http://www.ibiblio.org/maven/maven/distributions/ Installation is straight forward, basicaly you need to unpack the archive and place the /bin folder on your path and set an environment variable 'MAVEN_HOME' to point to the folder which contains the bin folder. Maven uses a few files to manage the build process, these are: project.xml - contains information about the project and dependencies project.properties or build.properties - special options which control aspects of the build maven.xml - optional extra scripts for performing special tasks. Each module in geotools2 is treated as a project in its own right, so in each geotools-src/modulename folder you will find a project.xml file that contains the details specific to that module. However, as the modules also have a lot in common you will find a master project.xml file in the geotools2 directory that they all extend. If you want to do a complete build of all working modules then put yourself in the geotools2 directory (the one that contains geotools-src) and type 'maven' The first time you run maven it will grab a lot of files that it needs for itself, then it will try to download the files it needs to build GT2. It will try ibilo and geotools.org for these files and it will generate error messages when it fails to find them at ibilo before trying geotools.org. It will work out what order to build the modules in itself and then try to process them in that order. As it finishes each module it will 'install' the finished jar into a repository (MAVEN_HOME/repository). The following modules will then build against the file in the repository if they depend upon it. Because of this, if a module fails to build, say filter, then a module which depends on filter will show an error like this: Unable to download filter-0.1.jar This is misleading as it should not be attempting to download filter-0.1 instead this means that filter failed to build and install itself into the repository. All being well, the final line of the build output should give you a list of which modules built without error and were installed. To get more information about the status of each module and any test errors you can run maven site from the geotools2 directory, this is a lengthy process so we have a server which is doing this for us on a regular basis, you can find the output at http://modules.geotools.org If you want to build an individual module without doing a complete build (which can take a while) then go into the specific module directory and type maven you can build javadocs with maven javadoc and run the unit tests with maven test generate a site just for the module with maven site and find out a list of other things you can do with maven -g All output will go in a 'target' folder NOTE: If you change a module that other modules depend on make sure you do a maven jar:install So that an updated copy is placed in the repository. Give maven a try and feedback your experiences, our aim is to make the build process as painless as possible. All the best James -- James Macgill Center for Computational Geography http://www.ccg.leeds.ac.uk Spell Checker (c) Creative Spelling inc (aka my dyslexic brain) http://www.geotools.org a client side java mapping toolkit. |