Skip to end of metadata
Go to start of metadata

Ohjeet otettu hituisen muokattuna README tiedostostosta versionhallinnnasta.
Asiaa käsitelty myös tiketissä:

VIRTAJUL-38

 

##Prerequisites

 

###Setup the environment

**Building:** Java JDK 1.8, Maven 3
**Database:** MS SQL Server 2011 with proper schema
**Running:** JDK 8, currently embeds Tomcat 8.

 

## Build and Install

Build project with

    

    You need manually add sql-server jdbc drivers to the local repository:

    $ mvn install:install-file -Dfile=sqljdbc4-4.0.jar  -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 -Dpackaging=jar

 

    Build project:   

    $ mvn clean package

    

Copy distribution zip file `target/julkaisu-api-[version]-bin.zip` to serverinto directory /app/jutiapp and unzip it.

 

Create sympolic link julkaisu-api pointing to the release you want to run.

 

    $ ln -s julkaisu-api-1.0-SNAPSHOT julkaisu-api

 

Folders in zip file:

       

       init - Includes daemon start stop init script.
       bin - Executable for starting application.
       config - Default server configuration file server.properties and default api configuration file api.properties
       repo - Application libraries.
       webapp/api-doc - HTML api documentation
       webapp/META-INF - Context configuration file context.xml

      

Edit `webapp/META-INF/context.xml` for proper database information.

Change owner of the files to jutiapp.   

    $ chown -R jutiapp:jutiapp /app/jutiapp/julkaisu-api-1.0-SNAPSHOT

 

Edit `init/julkaisu-api` and chnage path variable to path=/app/jutiapp/julkaisu-api/

Copy `init/julkaisu-api` script to servers `/etc/init.d/` folder and enable / start service with

 

    $ chkconfig --add julkaisu-api

    $ service julkaisu-api start

 

##Changing JAVA_OPTS in server

Init script includes `/etc/sysconfig/julkaisu-api` file if found. In this file you can set JAVA_OPTS of java process.

    JAVA_OPTS="-Xms128m -Xmx512m"