-
Notifications
You must be signed in to change notification settings - Fork 10
/
commandline.build.and.run.txt
65 lines (54 loc) · 2.93 KB
/
commandline.build.and.run.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
By default it requires a PostgreSQL db (source code has other working examples of mysql)
This is picked up from a DATABASE_URL env variable such as
postgresql://zktodo2:zktodo2@localhost:5432/zktodo2
Create your user and database on postgres with:
# as root
CREATE USER zktodo2 WITH PASSWORD 'zktodo2';
CREATE DATABASE zktodo2;
GRANT ALL PRIVILEGES ON DATABASE zktodo2 TO zktodo2;
Optionally create a table (not necessary with ALL PRIVILEGES but will be on a hosted server)
CREATE TABLE reminder ( reminder_id bigint NOT NULL, date timestamp without time zone, name character varying(255), priority integer, CONSTRAINT reminder_pkey PRIMARY KEY (reminder_id ));
To switch to MySQL change src/main/WEB-INF/classes/default.datasource-context.xml
to refer to the other properties file. If you get the code working with other
databases let me know the settings which worked and I will commit them
for other folks.
Linux/Mac
1) Obtain the maven3 tar.gz and extract into a folder such as /home/simon/maven
2) Checkout the sourcecode from GitHub
git clone https://simbo1905@github.com/simbo1905/ZkToDo2.git
3) cd ZkToDo2
4) Setup the environment variables for maven and the jdk and ensure that their bin
folders are on your path (see stackoverflow.com for where your JAVA_HOME will be)
MAVEN_HOME=/home/simon/maven
export MAVEN_HOME
JAVA_HOME=/home/simon/jdk1.7
export JAVA_HOME
PATH=$JAVA_HOME\bin:$MAVEN_HOME\bin:$PATH
DATABASE_URL=postgresql://zktodo2:zktodo2@localhost:5432/zktodo2
export DATABASE_URL
5) Run it
mvn -Djetty.port=8080 package jetty:run
Windows:
1) Download an apache Maven zip file from http://maven.apache.org/
and extract into a folder that does not have spaces in the path
e.g. C:\users\simon\apache\maven
2) Checkout the sourcecode from GitHub
git clone https://simbo1905@github.com/simbo1905/ZkToDo2.git
it is a good idea to check the code out into a folder that does not have
spaces e.g. C:\users\simon\projects\zktodo2
3) Open up a command shell (cmd.exe) either from Start > Run... > cmd.exe
on XP or by searching for cmd on the start menu of Vista/WinowsWhatever.
4) Change directories into the folder where the pom.xml file was checked
out from Subversion e.g. cd C:\users\simon\projects\zktodo2
5) Within the cmd.exe configure the location of your jdk1.5 or above with
set JAVA_HOME=C:\users\simon\jdk1.5
6) With the cmd.exe configure the location of your maven install
set MAVEN_HOME=C:\users\simon\apache\maven
7) Ensure that both the java.exe and the mvn.bat folders are on your
binary PATH with the command
set PATH=%JAVA_HOME%\bin;%MAVEN_HOME%\bin;%PATH%
8) Ensure that it knows the database connection details
set DATABASE_URL=postgresql://foodToGoUser:foodToGoPassword@localhost/testdb
9) Compile and run the jetty webcontainer with the maven command
mvn -Djetty.port=8080 clean install jetty:run
jetty will stay running on port until you kill it by entering Ctrl+c