Skip to content

Building instructions

giovo87 edited this page Jul 3, 2012 · 38 revisions

Cloning the repo

Get the source as usual from github.

The git command line should be something like

git clone git@github.com:geosolutions-it/geostore.git geostore

Building GeoStore

Create the GeoStore DB in Windows

In order to be able to run the psql and createdb commands, you must first set in the "PATH" environment variable the path to the /bin folder of Postgres. The follow commands are referred to the Postgres use.

  1. Create a PostgreSQL DB called "geostore" (PostGis support is not required).
    You may need to run these commands as user postgres in the windows Console.
C:\currentDir>createdb -U postgres geostore
  1. Run the sql script doc/sql/001_setup_db.sql on geostore db; it will create the users:
  • geostore with pw geostore

  • geostore_test with pw geostore_test

    and schemas `geostore` and `geostore_test`.
    You may need to run these commands as user `postgres`.
    
C:\currentDir>psql -U postgres -d geostore -f YOUR_GEOSTORE_DIR/doc/sql/001_setup_db.sql
  1. Run the sql script doc/setup/sql/002_create_schema_postgres.sql on geostore db, geostore schema; it will create the base tables, indices, etc. The geostore_test schema will be automatically recreated during tests.
C:\currentDir>psql -U geostore -d geostore -f YOUR_GEOSTORE_DIR/doc/sql/002_create_schema_postgres.sql

Note that you are logging in postgres as usergeostore, so you will be asked for user password, that's set as geostore as stated above.

TODO: add instructions about how to use the HSQLDB instead of pg

Create the GeoStore DB in Linux###

The follow commands are referred to the Postgres use.

  1. Create a PostgreSQL DB called "geostore" (PostGis support is not required).
    You may need to run these commands as user postgres.
createdb geostore
  1. Run the sql script doc/sql/001_setup_db.sql on geostore db; it will create the users:
  • geostore with pw geostore

  • geostore_test with pw geostore_test

    and schemas `geostore` and `geostore_test`. 
    You may need to run these commands as user `postgres`.
    
psql -d geostore -f YOUR_GEOSTORE_DIR/doc/sql/001_setup_db.sql
  1. Run the sql script doc/setup/sql/002_create_schema_postgres.sql on geostore db, geostore schema; it will create the base tables, indices, etc. The geostore_test schema will be automatically recreated during tests.
psql -U geostore -d geostore -f YOUR_GEOSTORE_DIR/doc/sql/002_create_schema_postgres.sql

Note that you are logging in postgres as usergeostore, so you will be asked for user password, that's set as geostore as stated above.

TODO: add instructions about how to use the HSQLDB instead of pg

Build the webapp

Enter the src/ directory and launch

mvn clean install 

You may want to use the profile extjs in order to have services offering output in EXT json format.

mvn clean install -Pextjs

The maven install command will create a .war file:

  • src/server/web/app/target/geostore.war : the geostore service

It will also make available the GeoStore client jar as maven artifact

   <dependency>
      <groupId>it.geosolutions.geostore</groupId>
      <artifactId>geostore-rest-client</artifactId>
      <version>1.0-SNAPSHOT</version>
   </dependency>

(The current code may have a later version for the client)

Run the webapp

You can run the webapp using the embedded Jetty http server.

In order to run GeoStore, enter into the directory src/server/web/app and run the command

mvn jetty:run

adding the extjs profile -Pextjs if needed.