[Geoserver-devel] Maven Build pom.xml problem

Hi all,

So I notice there’s no Oracle maintainer at the moment, Andrea is on holiday and I’d like to help if I can (especially to investigate performance issues). I have a little java experience but have never used Maven, Eclipse or subversion and tbh don’t really fully understand the role of all of them so this may be a bad idea but… I decided to have a go anyway but am having a little trouble setting it all up and the instructions on the wiki seem to be slightly vague / outdated now. :frowning: so here’s what I’ve done, can anyone help me to the next step?

Tortoise 1.4.3 was already installed as I was taking a look at it for possible use with our own projects and used it to download the latest OpenLayers source but that’s about as far as my knowledge goes, however the geoserver source downloaded successfully to c:/devgeoserver.

Eclipse is installed and that seems to be running ok although I’ve not actually tried any java code in it. Previously I’ve used NetBeans for the few java classes I’ve written.

Java 6 is installed and working fine.

I downloaded Maven 2.0.7 (the link on the Maven page on the wiki points to 2.0.6 but that doesn’t seem to exist anymore) unzipped it to c:/program files/maven-2.0.7 and added the bin directory to the path environment variable as per the instructions here: http://maven.apache.org/download.html

Then, as per instructions here: http://docs.codehaus.org/display/GEOSDOC/2+Maven+Quickstart

I ran the following at the command line and got the output shown.

C:>cd c:\geoserverdev

C:\geoserverdev>mvn compile
[INFO] Scanning for projects…
[INFO] -------------------------------------------------------------------------

[INFO] Building Maven Default Project
[INFO] task-segment: [compile]
[INFO] -------------------------------------------------------------------------

[INFO] artifact org.apache.maven.plugins:maven-resources-plugin: checking for up
dates from central
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resour
ces-plugin/2.2/maven-resources-plugin-2.2.pom
1K downloaded
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-plugin
s/1/maven-plugins-1.pom
3K downloaded
Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-parent/1/maven
-parent-1.pom
6K downloaded
Downloading: http://repo1.maven.org/maven2/org/apache/apache/1/apache-1.pom
3K downloaded
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resour
ces-plugin/2.2/maven-resources-plugin-2.2.jar
13K downloaded
[INFO] artifact org.apache.maven.plugins:maven-compiler-plugin: checking for upd
ates from central
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-compil
er-plugin/2.0.2/maven-compiler-plugin-2.0.2.pom
2K downloaded
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-plugin
s/8/maven-plugins-8.pom
5K downloaded
Downloading: http://repo1.maven.org/maven2/org/apache/maven/maven-parent/5/maven
-parent-5.pom
14K downloaded
Downloading: http://repo1.maven.org/maven2/org/apache/apache/3/apache-3.pom
3K downloaded
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-compil
er-plugin/2.0.2/maven-compiler-plugin-2.0.2.jar
17K downloaded
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot execute mojo: resources. It requires a project with an existing po
m.xml, but the build is not using one.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16 seconds
[INFO] Finished at: Sat Jul 28 16:30:02 BST 2007
[INFO] Final Memory: 2M/4M
[INFO] ------------------------------------------------------------------------

What now?

Hi Tom,

Tom (JDi Solutions) wrote:

Hi all,

So I notice there's no Oracle maintainer at the moment, Andrea is on holiday and I'd like to help if I can (especially to investigate performance issues). I have a little java experience but have never used Maven, Eclipse or subversion and tbh don't really fully understand the role of all of them so this may be a bad idea but...

Glad to see you jumping into development Tom. I is always nice to see people getting down and dirty. Here is a quick rundown:

Subversion: version control system, getting code in and out of central versioning repository

Maven: build system, manages dependencies among geoserver modules and on third party libraries, allows for compling, testing, releasing, etc...

Eclipse: most popular ide used by geoserver developers. maven comes with direct support for eclipse which makes it the most logical choice

From the error it just looks like you are not running the command from the root of the *source* tree. The root of the source tree should contain directories called "main", "wfs","wms", etc... and most importantly a file called "pom.xml".

My guess is that your "geoserverdev" directory contains two directories named "configuration" and "geoserver"? Just change directory to
"geoserver" and run the command again.

Also feel free to hop on IRC and ask for help directly. We will be happy to help you get setup.

-Justin

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Justin,

Spot on, thanks. Now I’ve got as far as importing the project into Eclipse but there are loads of errors and it says in the docs “If your eclipse projects are filled with errors, it may be that you either did not set up Eclipse properly, or that you did not fully build Geoserver before attempting to setup the Eclipse projects. Go back and look again in the prerequisites section.”

after I got mvn compile running in the correct directory it managed to build successfully on about the 4th attempt. I then ran

mvn -DdownloadSources=
true eclipse:eclipse

as per instructions and got the following:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] GeoServer … SUCCESS [47.828s]

[INFO] GeoServer Maven Plugins … SUCCESS [ 0.016s]
[INFO] Plugins configuration files … SUCCESS [6:13.641
s]
[INFO] Configuration Deployment PlugIn … SUCCESS [1:32.687
s]
[INFO] Core Platform Module … SUCCESS [ 0.094s]
[INFO] Data Module … SUCCESS [0.125s]
[INFO] Open Web Service Model … SUCCESS [0.078s]
[INFO] Open Web Service Module … SUCCESS [ 0.453s]
[INFO] Main Module … SUCCESS [0.547s]
[INFO] Web Coverage Service Module … SUCCESS [0.469s]
[INFO] Validation Module … SUCCESS [ 0.312s]
[INFO] Web Feature Service Model … SUCCESS [0.063s]
[INFO] Web Feature Service Module … SUCCESS [0.484s]
[INFO] Versioning Web Feature Service Model … SUCCESS [ 0.078s]
[INFO] Versioned Web Feature Service Module … SUCCESS [0.422s]
[INFO] Web Map Service Module … SUCCESS [0.453s]
[INFO] Web Application Module … SUCCESS [21: 41.45
3s]
[INFO] Test Module … SUCCESS [0.297s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 30 minutes 23 seconds
[INFO] Finished at: Sun Jul 29 22:10:28 BST 2007
[INFO] Final Memory: 20M/36M
[INFO] ------------------------------------------------------------------------

C:\geoserverdev\geoserver>

…after a load of files downloaded so that looks like it worked ok right? So why do I have errors? I also followed the instructions running a debug session but obviously that failed because of the errors.

I did download a few plugins for Eclipse after I installed it but other than that I haven’t actually done anything else with it so I’m not sure I can have set that up wrong?

Also, 2 other questions, Jetty is a java web server, is that included in the geoserver build?
Does the build include datastores? Specifically I want to be able to test with the Oracle datastore.

and, assuming I eventually get this running, is it possible to get this build using my existing data directory so I don’t have to setup all the feature types again?

cheers,

Tom

On 7/29/07, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Hi Tom,

Tom (JDi Solutions) wrote:

Hi all,

So I notice there’s no Oracle maintainer at the moment, Andrea is on
holiday and I’d like to help if I can (especially to investigate
performance issues). I have a little java experience but have never
used Maven, Eclipse or subversion and tbh don’t really fully understand
the role of all of them so this may be a bad idea but…
Glad to see you jumping into development Tom. I is always nice to see
people getting down and dirty. Here is a quick rundown:

Subversion: version control system, getting code in and out of central
versioning repository

Maven: build system, manages dependencies among geoserver modules and on
third party libraries, allows for compling, testing, releasing, etc…

Eclipse: most popular ide used by geoserver developers. maven comes with
direct support for eclipse which makes it the most logical choice

From the error it just looks like you are not running the command from
the root of the source tree. The root of the source tree should
contain directories called “main”, “wfs”,“wms”, etc… and most
importantly a file called “pom.xml”.

My guess is that your “geoserverdev” directory contains two directories
named “configuration” and “geoserver”? Just change directory to
“geoserver” and run the command again.

Also feel free to hop on IRC and ask for help directly. We will be happy
to help you get setup.

-Justin


Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Hi Tom,

Looks like you are making progress!! Responses inline.

Tom (JDi Solutions) wrote:

Justin,

Spot on, thanks. Now I've got as far as importing the project into Eclipse
but there are loads of errors and it says in the docs "If your eclipse
projects are filled with errors, it may be that you either did not set up
Eclipse properly, or that you did not fully build Geoserver before
attempting to setup the Eclipse projects. Go back and look again in the
prerequisites section."

after I got mvn compile running in the correct directory it managed to build
successfully on about the 4th attempt. I then ran

mvn -DdownloadSources=true eclipse:eclipse

as per instructions and got the following:

[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
------------------------------------------------------------------------
[INFO] GeoServer ............................................. SUCCESS [
47.828s]

[INFO] GeoServer Maven Plugins ............................... SUCCESS [
0.016s]
[INFO] Plugins configuration files ........................... SUCCESS [6:
13.641
s]
[INFO] Configuration Deployment PlugIn ....................... SUCCESS [1:
32.687
s]
[INFO] Core Platform Module .................................. SUCCESS [
0.094s]
[INFO] Data Module ........................................... SUCCESS [
0.125s]
[INFO] Open Web Service Model ................................ SUCCESS [
0.078s]
[INFO] Open Web Service Module ............................... SUCCESS [
0.453s]
[INFO] Main Module ........................................... SUCCESS [
0.547s]
[INFO] Web Coverage Service Module ........................... SUCCESS [
0.469s]
[INFO] Validation Module ..................................... SUCCESS [
0.312s]
[INFO] Web Feature Service Model ............................. SUCCESS [
0.063s]
[INFO] Web Feature Service Module ............................ SUCCESS [
0.484s]
[INFO] Versioning Web Feature Service Model .................. SUCCESS [
0.078s]
[INFO] Versioned Web Feature Service Module .................. SUCCESS [
0.422s]
[INFO] Web Map Service Module ................................ SUCCESS [
0.453s]
[INFO] Web Application Module ................................ SUCCESS [21:
41.45
3s]
[INFO] Test Module ........................................... SUCCESS [
0.297s]
[INFO]
------------------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 30 minutes 23 seconds
[INFO] Finished at: Sun Jul 29 22:10:28 BST 2007
[INFO] Final Memory: 20M/36M
[INFO]
------------------------------------------------------------------------

C:\geoserverdev\geoserver>

...after a load of files downloaded so that looks like it worked ok right?
So why do I have errors? I also followed the instructions running a debug
session but obviously that failed because of the errors.

I did download a few plugins for Eclipse after I installed it but other than
that I haven't actually done anything else with it so I'm not sure I can
have set that up wrong?

Hmmm... looks ok. Did you set the M2_REPO classpath variable in eclipse? It should probably be a bit more clear in the docs. It is explained here:

http://docs.codehaus.org/display/GEOSDOC/5+Eclipse

Also... another thing to note which is a gotcha if you are not used to working with maven and eclipse... is that whenever you run a command from the command line it is important to "Refresh" all the projects in your eclipse workspace. For instnace when you do an 'svn update' or when you run 'mvn eclipse:eclipse'.

Also, 2 other questions, Jetty is a java web server, is that included in the
geoserver build?

Yes. There is a class in the "web" module that will fire up a jetty instance running geoserver. Its called 'org.mortbay.jetty.Start'.

Does the build include datastores? Specifically I want to be able to test
with the Oracle datastore.

It includes some... but oracle is not one of them. If you look in the pom.xml file in the "web" module you should see the following dependency:

  <dependency>
       <groupId>org.geotools</groupId>
       <artifactId>gt2-postgis</artifactId>
     </dependency>

Directly after it add the following dependency:

  <dependency>
       <groupId>org.geotools</groupId>
       <artifactId>gt2-oracle-spatial</artifactId>
       <version>2.4-SNAPSHOT</version>
     </dependency>

Be sure that after you do this you run mvn eclipse:eclipse again (from the root of the source tree) and then refresh inside of eclipse (or the new dependency wont be picked up).

and, assuming I eventually get this running, is it possible to get this
build using my existing data directory so I don't have to setup all the
feature types again?

Yup. The easiest way to do this when running from eclipse is to set GEOSERVER_DATA_DIR as a program argument.

-DGEOSERVER_DATA_DIR=<path to your data dir>

I added some docs to the end of the quickstart about this with a screenshot.

-Justin

cheers,

Tom

On 7/29/07, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Hi Tom,

Tom (JDi Solutions) wrote:

Hi all,

So I notice there's no Oracle maintainer at the moment, Andrea is on
holiday and I'd like to help if I can (especially to investigate
performance issues). I have a little java experience but have never
used Maven, Eclipse or subversion and tbh don't really fully understand
the role of all of them so this may be a bad idea but...

Glad to see you jumping into development Tom. I is always nice to see
people getting down and dirty. Here is a quick rundown:

Subversion: version control system, getting code in and out of central
versioning repository

Maven: build system, manages dependencies among geoserver modules and on
third party libraries, allows for compling, testing, releasing, etc...

Eclipse: most popular ide used by geoserver developers. maven comes with
direct support for eclipse which makes it the most logical choice

From the error it just looks like you are not running the command from
the root of the *source* tree. The root of the source tree should
contain directories called "main", "wfs","wms", etc... and most
importantly a file called "pom.xml".

My guess is that your "geoserverdev" directory contains two directories
named "configuration" and "geoserver"? Just change directory to
"geoserver" and run the command again.

Also feel free to hop on IRC and ask for help directly. We will be happy
to help you get setup.

-Justin

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

!DSPAM:4007,46ad0f7028175409313003!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Getting there…

I added the dependency, raran mvn eclipse:eclipse and now I have only warnings when I open it all in Eclipse but still can’t quite run it!

For reference I had a small issue along the way with the maven pathname and it gave the following error: java.lang.NoClassDefFoundError: Files\maven-2/0/7/bin/m2/conf
Exception in thread “main”

It seems something doesn’t like either spaces or dots in the name so I moved maven from c:/program files/maven-2.0.7 to c:/maven207 and changed the relevant settings and now it seems to be working…

In attempting to run the project in debug mode in Eclipse I get the output listed at the bottom of this mail.

I’m at a client’s site at the mo so it could be being blocked by their firewall? Maybe if I have a go tonight it will work? Should I be worried about it “blacklisting” refractions?!?!

Another quick question if I may? Subversion is the program to check in and out of the repository so why does Maven do so much downloading? What is it actually getting? Surely I downloaded everything that’s necessary when I downloaded the source from the subversion repository? My current guess is that it’s getting the latest version of the required libraries which are not included in the source (because they’re not part of the geoserver project?) and then why does Eclipse do even more downloading?

cheers,

Tom

[INFO] Scanning for projects…
[INFO] Searching repository for plugin with prefix: ‘jetty’.
[INFO] org.apache.maven.plugins: checking for updates from mortbay-repo
[INFO] org.codehaus.mojo: checking for updates from mortbay-repo
[INFO] snapshot org.codehaus.mojo:jalopy-maven-plugin:1.0-SNAPSHOT: checking for updates from mortbay-repo
[INFO] snapshot org.codehaus.mojo:mojo:10-SNAPSHOT: checking for updates from mortbay-repo
[INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from mortbay-repo
[INFO] artifact org.codehaus.mojo:cobertura-maven-plugin: checking for updates from mortbay-repo
[INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin: checking for updates from mortbay-repo
[INFO] artifact org.apache.maven.plugins:maven-jar-plugin: checking for updates from mortbay-repo
[INFO] ----------------------------------------------------------------------------
[INFO] Building Web Application Module
[INFO] task-segment: [jetty:run]
[INFO] ----------------------------------------------------------------------------
[INFO] Preparing jetty:run
[INFO] artifact org.apache.maven.plugins:maven-resources-plugin: checking for updates from mortbay-repo
[INFO] artifact org.apache.maven.plugins:maven-compiler-plugin: checking for updates from mortbay-repo
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] snapshot org.geoserver:platform:1.6-SNAPSHOT: checking for updates from refractions
[WARNING] repository metadata for: ‘snapshot org.geoserver:platform:1.6-SNAPSHOT’ could not be retrieved from repository: refractions due to an error: Error transferring file
[INFO] Repository ‘refractions’ will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:

  1. org.geoserver:wcs:jar:1.6-SNAPSHOT

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=org.geoserver -DartifactId=wcs
-Dversion=1.6-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.geoserver -DartifactId=wcs
-Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
-Durl=[url] -DrepositoryId=[id]

Path to dependency:

  1. org.geoserver:web:jar:1.6-SNAPSHOT

  2. org.geoserver:wcs:jar:1.6-SNAPSHOT

  3. org.geoserver:validation:jar:1.6-SNAPSHOT

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=org.geoserver -DartifactId=validation
-Dversion=1.6-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.geoserver -DartifactId=validation
-Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
-Durl=[url] -DrepositoryId=[id]

Path to dependency:

  1. org.geoserver:web:jar:1.6-SNAPSHOT

  2. org.geoserver:validation:jar:1.6-SNAPSHOT

  3. org.geoserver:wfsv:jar:1.6-SNAPSHOT

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=org.geoserver -DartifactId=wfsv
-Dversion=1.6-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.geoserver -DartifactId=wfsv
-Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
-Durl=[url] -DrepositoryId=[id]

Path to dependency:

  1. org.geoserver:web:jar:1.6-SNAPSHOT

  2. org.geoserver:wfsv:jar:1.6-SNAPSHOT

  3. org.geoserver:wms:jar:1.6-SNAPSHOT

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId= org.geoserver -DartifactId=wms
-Dversion=1.6-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.geoserver -DartifactId=wms
-Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
-Durl=[url] -DrepositoryId=[id]

Path to dependency:

  1. org.geoserver:web:jar:1.6-SNAPSHOT

  2. org.geoserver:wms:jar:1.6-SNAPSHOT

  3. org.geoserver:wfs:jar:1.6-SNAPSHOT

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=org.geoserver -DartifactId=wfs
-Dversion=1.6-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.geoserver -DartifactId=wfs
-Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
-Durl=[url] -DrepositoryId=[id]

Path to dependency:

  1. org.geoserver:web:jar:1.6-SNAPSHOT

  2. org.geoserver:wfs:jar:1.6-SNAPSHOT

  3. org.geoserver:platform:jar:1.6-SNAPSHOT

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=org.geoserver -DartifactId=platform
-Dversion=1.6-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.geoserver -DartifactId=platform
-Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
-Durl=[url] -DrepositoryId=[id]

Path to dependency:

  1. org.geoserver:web:jar:1.6-SNAPSHOT

  2. org.geoserver:platform:jar:1.6-SNAPSHOT

  3. org.geoserver:data:jar:1.6-SNAPSHOT

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=org.geoserver -DartifactId=data
-Dversion=1.6-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.geoserver -DartifactId=data
-Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
-Durl=[url] -DrepositoryId=[id]

Path to dependency:

  1. org.geoserver:web:jar:1.6-SNAPSHOT

  2. org.geoserver:data:jar:1.6-SNAPSHOT

  3. org.geoserver:main:jar:1.6-SNAPSHOT

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=org.geoserver -DartifactId=main
-Dversion=1.6-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.geoserver -DartifactId=main
-Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
-Durl=[url] -DrepositoryId=[id]

Path to dependency:

  1. org.geoserver:web:jar:1.6-SNAPSHOT
  2. org.geoserver:main:jar:1.6-SNAPSHOT

8 required artifacts are missing.

for artifact:
org.geoserver:web:jar:1.6-SNAPSHOT

from the specified remote repositories:
espace (http://maven.espace.ird.nc),
geotools ( http://maven.geotools.fr/repository/),
mortbay (http://www.mortbay.org/maven2/release ),
refractions (http://lists.refractions.net/m2/),
Sateh (http://maven.sateh.com/repository),
central (http://repo1.maven.org/maven2),
ibiblio ( http://www.ibiblio.org/maven2)

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 minutes 32 seconds
[INFO] Finished at: Mon Jul 30 11:24:38 BST 2007
[INFO] Final Memory: 10M/18M
[INFO] ------------------------------------------------------------------------

On 7/30/07, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Hi Tom,

Looks like you are making progress!! Responses inline.

Tom (JDi Solutions) wrote:

Justin,

Spot on, thanks. Now I’ve got as far as importing the project into Eclipse
but there are loads of errors and it says in the docs “If your eclipse
projects are filled with errors, it may be that you either did not set up
Eclipse properly, or that you did not fully build Geoserver before
attempting to setup the Eclipse projects. Go back and look again in the
prerequisites section.”

after I got mvn compile running in the correct directory it managed to build
successfully on about the 4th attempt. I then ran

mvn -DdownloadSources=true eclipse:eclipse

as per instructions and got the following:

[INFO]

[INFO] Reactor Summary:
[INFO]

[INFO] GeoServer … SUCCESS [
47.828s]

[INFO] GeoServer Maven Plugins … SUCCESS [
0.016s]
[INFO] Plugins configuration files … SUCCESS [6:
13.641
s]
[INFO] Configuration Deployment PlugIn … SUCCESS [1:
32.687
s]
[INFO] Core Platform Module … SUCCESS [
0.094s]
[INFO] Data Module … SUCCESS [
0.125s]
[INFO] Open Web Service Model … SUCCESS [
0.078s]
[INFO] Open Web Service Module … SUCCESS [
0.453s]
[INFO] Main Module … SUCCESS [
0.547s]
[INFO] Web Coverage Service Module … SUCCESS [
0.469s]
[INFO] Validation Module … SUCCESS [
0.312s]
[INFO] Web Feature Service Model … SUCCESS [
0.063s]
[INFO] Web Feature Service Module … SUCCESS [
0.484s]
[INFO] Versioning Web Feature Service Model … SUCCESS [
0.078s]
[INFO] Versioned Web Feature Service Module … SUCCESS [
0.422s]
[INFO] Web Map Service Module … SUCCESS [
0.453s]
[INFO] Web Application Module … SUCCESS [21:
41.45
3s]
[INFO] Test Module … SUCCESS [
0.297s]
[INFO]

[INFO]

[INFO] BUILD SUCCESSFUL
[INFO]

[INFO] Total time: 30 minutes 23 seconds
[INFO] Finished at: Sun Jul 29 22:10:28 BST 2007
[INFO] Final Memory: 20M/36M
[INFO]

C:\geoserverdev\geoserver>

…after a load of files downloaded so that looks like it worked ok right?
So why do I have errors? I also followed the instructions running a debug
session but obviously that failed because of the errors.

I did download a few plugins for Eclipse after I installed it but other than
that I haven’t actually done anything else with it so I’m not sure I can
have set that up wrong?
Hmmm… looks ok. Did you set the M2_REPO classpath variable in eclipse?
It should probably be a bit more clear in the docs. It is explained here:

http://docs.codehaus.org/display/GEOSDOC/5+Eclipse

Also… another thing to note which is a gotcha if you are not used to
working with maven and eclipse… is that whenever you run a command
from the command line it is important to “Refresh” all the projects in
your eclipse workspace. For instnace when you do an ‘svn update’ or when
you run ‘mvn eclipse:eclipse’.

Also, 2 other questions, Jetty is a java web server, is that included in the
geoserver build?
Yes. There is a class in the “web” module that will fire up a jetty
instance running geoserver. Its called ‘org.mortbay.jetty.Start’.

Does the build include datastores? Specifically I want to be able to test
with the Oracle datastore.
It includes some… but oracle is not one of them. If you look in the
pom.xml file in the “web” module you should see the following dependency:

org.geotools gt2-postgis

Directly after it add the following dependency:

org.geotools gt2-oracle-spatial 2.4-SNAPSHOT

Be sure that after you do this you run mvn eclipse:eclipse again (from
the root of the source tree) and then refresh inside of eclipse (or the
new dependency wont be picked up).

and, assuming I eventually get this running, is it possible to get this
build using my existing data directory so I don’t have to setup all the
feature types again?

Yup. The easiest way to do this when running from eclipse is to set
GEOSERVER_DATA_DIR as a program argument.

-DGEOSERVER_DATA_DIR=

I added some docs to the end of the quickstart about this with a screenshot.

-Justin

cheers,

Tom

On 7/29/07, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Hi Tom,

Tom (JDi Solutions) wrote:

Hi all,

So I notice there’s no Oracle maintainer at the moment, Andrea is on
holiday and I’d like to help if I can (especially to investigate
performance issues). I have a little java experience but have never
used Maven, Eclipse or subversion and tbh don’t really fully understand
the role of all of them so this may be a bad idea but…
Glad to see you jumping into development Tom. I is always nice to see
people getting down and dirty. Here is a quick rundown:

Subversion: version control system, getting code in and out of central
versioning repository

Maven: build system, manages dependencies among geoserver modules and on
third party libraries, allows for compling, testing, releasing, etc…

Eclipse: most popular ide used by geoserver developers. maven comes with
direct support for eclipse which makes it the most logical choice

From the error it just looks like you are not running the command from
the root of the source tree. The root of the source tree should
contain directories called “main”, “wfs”,“wms”, etc… and most
importantly a file called " pom.xml".

My guess is that your “geoserverdev” directory contains two directories
named “configuration” and “geoserver”? Just change directory to
“geoserver” and run the command again.

Also feel free to hop on IRC and ask for help directly. We will be happy
to help you get setup.

-Justin


Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

!DSPAM:4007,46ad0f7028175409313003!


Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Tom (JDi Solutions) wrote:

Getting there...

I added the dependency, raran mvn eclipse:eclipse and now I have only warnings when I open it all in Eclipse but still can't quite run it!

For reference I had a small issue along the way with the maven pathname and it gave the following error: java.lang.NoClassDefFoundError: Files\maven-2/0/7/bin/m2/conf
Exception in thread "main"

Hmmm... never thought about spaces in path names throwing it off... quite possibly. we should update the quickstart to include quotes around the path names.

It seems something doesn't like either spaces or dots in the name so I moved maven from c:/program files/maven-2.0.7 to c:/maven207 and changed the relevant settings and now it seems to be working...

In attempting to run the project in debug mode in Eclipse I get the output listed at the bottom of this mail.

I suggest you use the first alternative for debugging from eclipse... its a lot easier then the one you are trying... All you have to do is find org.mortbay.jetty.Start in the "web" module... and run it as a java application from eclipse.

However... I believe the problem here is that you need to (from the command line) run "mvn clean install" from the root of the source tree.

I'm at a client's site at the mo so it could be being blocked by their firewall? Maybe if I have a go tonight it will work? Should I be worried about it "blacklisting" refractions?!?!

Hmmm... I don't think so... the jars its trying to download are ones that will be installed in your local repo after you successfully to mvn clean install.

Another quick question if I may? Subversion is the program to check in and out of the repository so why does Maven do so much downloading? What is it actually getting? Surely I downloaded everything that's necessary when I downloaded the source from the subversion repository? My current guess is that it's getting the latest version of the required libraries which are not included in the source (because they're not part of the geoserver project?) and then why does Eclipse do even more downloading?

Subversion only stores the source code... and does not store any of hte libraries that geoserver depends on. If we did the size of our source repository would become huge... So maven allows to declare dependencies on third party libraries and projects and worries about storing them locally... handling versions... etc...

cheers,

Tom

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'jetty'.
[INFO] org.apache.maven.plugins: checking for updates from mortbay-repo
[INFO] org.codehaus.mojo: checking for updates from mortbay-repo
[INFO] snapshot org.codehaus.mojo:jalopy-maven-plugin:1.0-SNAPSHOT: checking for updates from mortbay-repo
[INFO] snapshot org.codehaus.mojo:mojo:10-SNAPSHOT: checking for updates from mortbay-repo
[INFO] artifact org.apache.maven.plugins:maven-surefire-plugin: checking for updates from mortbay-repo
[INFO] artifact org.codehaus.mojo:cobertura-maven-plugin: checking for updates from mortbay-repo
[INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin: checking for updates from mortbay-repo
[INFO] artifact org.apache.maven.plugins:maven-jar-plugin: checking for updates from mortbay-repo
[INFO] ----------------------------------------------------------------------------
[INFO] Building Web Application Module
[INFO] task-segment: [jetty:run]
[INFO] ----------------------------------------------------------------------------
[INFO] Preparing jetty:run
[INFO] artifact org.apache.maven.plugins:maven-resources-plugin: checking for updates from mortbay-repo
[INFO] artifact org.apache.maven.plugins:maven-compiler-plugin: checking for updates from mortbay-repo
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] snapshot org.geoserver:platform:1.6-SNAPSHOT: checking for updates from refractions
[WARNING] repository metadata for: 'snapshot org.geoserver:platform:1.6-SNAPSHOT' could not be retrieved from repository: refractions due to an error: Error transferring file
[INFO] Repository 'refractions' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) org.geoserver:wcs:jar:1.6-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.geoserver -DartifactId=wcs \
          -Dversion=1.6-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.geoserver -DartifactId=wcs \
          -Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file \
           -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
      1) org.geoserver:web:jar:1.6-SNAPSHOT
      2) org.geoserver:wcs:jar:1.6-SNAPSHOT

2) org.geoserver:validation:jar:1.6-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.geoserver -DartifactId=validation \
          -Dversion=1.6-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.geoserver -DartifactId=validation \
          -Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file \
           -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
      1) org.geoserver:web:jar:1.6-SNAPSHOT
      2) org.geoserver:validation:jar:1.6-SNAPSHOT

3) org.geoserver:wfsv:jar:1.6-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.geoserver -DartifactId=wfsv \
          -Dversion=1.6-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.geoserver -DartifactId=wfsv \
          -Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file \
           -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
      1) org.geoserver:web:jar:1.6-SNAPSHOT
      2) org.geoserver:wfsv:jar:1.6-SNAPSHOT

4) org.geoserver:wms:jar:1.6-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId= org.geoserver -DartifactId=wms \
          -Dversion=1.6-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.geoserver -DartifactId=wms \
          -Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file \
           -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
      1) org.geoserver:web:jar:1.6-SNAPSHOT
      2) org.geoserver:wms:jar:1.6-SNAPSHOT

5) org.geoserver:wfs:jar:1.6-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.geoserver -DartifactId=wfs \
          -Dversion=1.6-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.geoserver -DartifactId=wfs \
          -Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file \
           -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
      1) org.geoserver:web:jar:1.6-SNAPSHOT
      2) org.geoserver:wfs:jar:1.6-SNAPSHOT

6) org.geoserver:platform:jar:1.6-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.geoserver -DartifactId=platform \
          -Dversion=1.6-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.geoserver -DartifactId=platform \
          -Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file \
           -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
      1) org.geoserver:web:jar:1.6-SNAPSHOT
      2) org.geoserver:platform:jar:1.6-SNAPSHOT

7) org.geoserver:data:jar:1.6-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.geoserver -DartifactId=data \
          -Dversion=1.6-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.geoserver -DartifactId=data \
          -Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file \
           -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
      1) org.geoserver:web:jar:1.6-SNAPSHOT
      2) org.geoserver:data:jar:1.6-SNAPSHOT

8) org.geoserver:main:jar:1.6-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.geoserver -DartifactId=main \
          -Dversion=1.6-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.geoserver -DartifactId=main \
          -Dversion=1.6-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file \
           -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
      1) org.geoserver:web:jar:1.6-SNAPSHOT
      2) org.geoserver:main:jar:1.6-SNAPSHOT

----------
8 required artifacts are missing.

for artifact:
  org.geoserver:web:jar:1.6-SNAPSHOT

from the specified remote repositories:
  espace (http://maven.espace.ird.nc),
  geotools ( http://maven.geotools.fr/repository/),
  mortbay (http://www.mortbay.org/maven2/release),
  refractions (http://lists.refractions.net/m2/),
  Sateh (http://maven.sateh.com/repository),
  central (http://repo1.maven.org/maven2),
  ibiblio ( http://www.ibiblio.org/maven2)

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 minutes 32 seconds
[INFO] Finished at: Mon Jul 30 11:24:38 BST 2007
[INFO] Final Memory: 10M/18M
[INFO] ------------------------------------------------------------------------

On 7/30/07, *Justin Deoliveira * <jdeolive@anonymised.com <mailto:jdeolive@anonymised.com>> wrote:

    Hi Tom,

    Looks like you are making progress!! Responses inline.

    Tom (JDi Solutions) wrote:
     > Justin,
     >
     > Spot on, thanks. Now I've got as far as importing the project
    into Eclipse
     > but there are loads of errors and it says in the docs "If your
    eclipse
     > projects are filled with errors, it may be that you either did
    not set up
     > Eclipse properly, or that you did not fully build Geoserver before
     > attempting to setup the Eclipse projects. Go back and look again
    in the
     > prerequisites section."
     >
     > after I got mvn compile running in the correct directory it
    managed to build
     > successfully on about the 4th attempt. I then ran
     >
     > mvn -DdownloadSources=true eclipse:eclipse
     >
     > as per instructions and got the following:
     >
     > [INFO]
     >
    ------------------------------------------------------------------------
     > [INFO] Reactor Summary:
     > [INFO]
     >
    ------------------------------------------------------------------------

     > [INFO] GeoServer .............................................
    SUCCESS [
     > 47.828s]
     >
     > [INFO] GeoServer Maven Plugins ...............................
    SUCCESS [
     > 0.016s]
     > [INFO] Plugins configuration files ...........................
    SUCCESS [6:
     > 13.641
     > s]
     > [INFO] Configuration Deployment PlugIn .......................
    SUCCESS [1:
     > 32.687
     > s]
     > [INFO] Core Platform Module ..................................
    SUCCESS [
     > 0.094s]
     > [INFO] Data Module ...........................................
    SUCCESS [
     > 0.125s]
     > [INFO] Open Web Service Model ................................
    SUCCESS [
     > 0.078s]
     > [INFO] Open Web Service Module ...............................
    SUCCESS [
     > 0.453s]
     > [INFO] Main Module ...........................................
    SUCCESS [
     > 0.547s]
     > [INFO] Web Coverage Service Module ...........................
    SUCCESS [
     > 0.469s]
     > [INFO] Validation Module .....................................
    SUCCESS [
     > 0.312s]
     > [INFO] Web Feature Service Model .............................
    SUCCESS [
     > 0.063s]
     > [INFO] Web Feature Service Module ............................
    SUCCESS [
     > 0.484s]
     > [INFO] Versioning Web Feature Service Model ..................
    SUCCESS [
     > 0.078s]
     > [INFO] Versioned Web Feature Service Module ..................
    SUCCESS [
     > 0.422s]
     > [INFO] Web Map Service Module ................................
    SUCCESS [
     > 0.453s]
     > [INFO] Web Application Module ................................
    SUCCESS [21:
     > 41.45
     > 3s]
     > [INFO] Test Module ...........................................
    SUCCESS [
     > 0.297s]
     > [INFO]
     >
    ------------------------------------------------------------------------
     > [INFO]
     >
    ------------------------------------------------------------------------
     > [INFO] BUILD SUCCESSFUL
     > [INFO]
     >
    ------------------------------------------------------------------------
     > [INFO] Total time: 30 minutes 23 seconds
     > [INFO] Finished at: Sun Jul 29 22:10:28 BST 2007
     > [INFO] Final Memory: 20M/36M
     > [INFO]
     >
    ------------------------------------------------------------------------

     >
     > C:\geoserverdev\geoserver>
     >
     > ...after a load of files downloaded so that looks like it worked
    ok right?
     > So why do I have errors? I also followed the instructions
    running a debug
     > session but obviously that failed because of the errors.
     >
     > I did download a few plugins for Eclipse after I installed it but
    other than
     > that I haven't actually done anything else with it so I'm not
    sure I can
     > have set that up wrong?
    Hmmm... looks ok. Did you set the M2_REPO classpath variable in eclipse?
    It should probably be a bit more clear in the docs. It is explained
    here:

    http://docs.codehaus.org/display/GEOSDOC/5+Eclipse

    Also... another thing to note which is a gotcha if you are not used to
    working with maven and eclipse... is that whenever you run a command
    from the command line it is important to "Refresh" all the projects in
    your eclipse workspace. For instnace when you do an 'svn update' or when
    you run 'mvn eclipse:eclipse'.
     >
     > Also, 2 other questions, Jetty is a java web server, is that
    included in the
     > geoserver build?
    Yes. There is a class in the "web" module that will fire up a jetty
    instance running geoserver. Its called 'org.mortbay.jetty.Start'.

     > Does the build include datastores? Specifically I want to be
    able to test
     > with the Oracle datastore.
    It includes some... but oracle is not one of them. If you look in the
    pom.xml file in the "web" module you should see the following
    dependency:

      <dependency>
           <groupId>org.geotools</groupId>
           <artifactId>gt2-postgis</artifactId>
         </dependency>

    Directly after it add the following dependency:

      <dependency>
           <groupId>org.geotools</groupId>
           <artifactId>gt2-oracle-spatial</artifactId>
           <version>2.4-SNAPSHOT</version>
         </dependency>

    Be sure that after you do this you run mvn eclipse:eclipse again (from
    the root of the source tree) and then refresh inside of eclipse (or the
    new dependency wont be picked up).
     >
     > and, assuming I eventually get this running, is it possible to
    get this
     > build using my existing data directory so I don't have to setup
    all the
     > feature types again?

    Yup. The easiest way to do this when running from eclipse is to set
    GEOSERVER_DATA_DIR as a program argument.

    -DGEOSERVER_DATA_DIR=<path to your data dir>

    I added some docs to the end of the quickstart about this with a
    screenshot.

    -Justin
     >
     > cheers,
     >
     > Tom
     >
     > On 7/29/07, Justin Deoliveira <jdeolive@anonymised.com
    <mailto:jdeolive@anonymised.com>> wrote:
     >> Hi Tom,
     >>
     >> Tom (JDi Solutions) wrote:
     >>> Hi all,
     >>>
     >>> So I notice there's no Oracle maintainer at the moment, Andrea
    is on
     >>> holiday and I'd like to help if I can (especially to investigate
     >>> performance issues). I have a little java experience but have
    never
     >>> used Maven, Eclipse or subversion and tbh don't really fully
    understand
     >>> the role of all of them so this may be a bad idea but...
     >> Glad to see you jumping into development Tom. I is always nice
    to see
     >> people getting down and dirty. Here is a quick rundown:
     >>
     >> Subversion: version control system, getting code in and out of
    central
     >> versioning repository
     >>
     >> Maven: build system, manages dependencies among geoserver
    modules and on
     >> third party libraries, allows for compling, testing, releasing,
    etc...
     >>
     >> Eclipse: most popular ide used by geoserver developers. maven
    comes with
     >> direct support for eclipse which makes it the most logical choice
     >>
     >> From the error it just looks like you are not running the
    command from
     >> the root of the *source* tree. The root of the source tree should
     >> contain directories called "main", "wfs","wms", etc... and most
     >> importantly a file called " pom.xml".
     >>
     >> My guess is that your "geoserverdev" directory contains two
    directories
     >> named "configuration" and "geoserver"? Just change directory to
     >> "geoserver" and run the command again.
     >>
     >> Also feel free to hop on IRC and ask for help directly. We will
    be happy
     >> to help you get setup.
     >>
     >> -Justin
     >>
     >> --
     >> Justin Deoliveira
     >> The Open Planning Project
     >> http://topp.openplans.org
     >>
     >

    --
    Justin Deoliveira
    The Open Planning Project
    http://topp.openplans.org

!DSPAM:4007,46adbe04127847180515871!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org