-
Notifications
You must be signed in to change notification settings - Fork 25
Building JGrasstools and insert it in your project
Get the source code from by cloning https://github.com/moovida/jgrasstools.git.
You should end up having a jgrasstools folder containing the folders of the subprojects:
- apps
- dbs
- grass
- gui
- hortonmachine
- jgrassgears
- lesto
- modules
- oms3
- server
I have made my tests with:
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_60, vendor: Oracle Corporation
Java home: /home/hydrologis/SOFTWARE/JAVA/JDKS/jdk1.8.0_60/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-62-generic", arch: "amd64", family: "unix"
The best way to build jgrasstools is from the root folder, in ordrer to make maven take care about the build order of the various projects.
So enter the root folder and issue the command:
mvn install
if the release is not stable, tests may fail to pass, so you might want to build with:
mvn install -Dmaven.test.skip=true
That will build the project, execute the tests and install the resulting jar into the local repository of the user (usually *~/.m2*
).
Should there be some strange error in building from the root folder, then try by running first:
mvn install -N
and only then the build as explained before.
If you are an eclipse user, just run:
mvn eclipse:eclipse
from the root folder of jgrasstools. This will create the eclipse projects that can then be imported into eclipse through:
File -> Import -> General -> Existing Projects into Workspace
Netbeans should by default be able to recognize the maven project structure, so you should be able to import the project easily.
(If a netbeans user would be so kind to send me instructions, I will be glad to add them here)
To get started with maven you could visit the maven quickstart guide.
You can use JGrasstools inside your code the plain java way as a library.
To help you getting started, we created a small maven project with a couple of examples that make use of JGrasstools as a library.
The examples lives in the code repository. Just check it out and modify it to your needs.