| 1 | --- |
| 2 | layout: docs |
| 3 | title: Building from sources |
| 4 | prev_section: support |
| 5 | next_section: contributing |
| 6 | permalink: /docs/building/ |
| 7 | --- |
| 8 | |
| 9 | Building OWNER from the sources has some advantages. For instance you can get |
| 10 | the latest features still under development on GitHub master branch. |
| 11 | |
| 12 | Building OWNER requires following software being installed and configured in |
| 13 | your system: |
| 14 | |
| 15 | - [JDK](http://docs.oracle.com/javase/7/docs/webnotes/install/) 7 or superior. |
| 16 | - [Maven](http://maven.apache.org/download.cgi#Installation_Instructions) 3.0.5 |
| 17 | or superior (Maven 2 should also be ok). |
| 18 | - [GIT](http://git-scm.com/book/en/Getting-Started-Installing-Git) any recent version should be ok. |
| 19 | |
| 20 | Java 5 and 6 are supported until OWNER 1.0.9. |
| 21 | With OWNER 1.0.10 we introduced Java 9 support and we dropped Java 5 and 6 support, so if you use JDK prior to 7 you |
| 22 | need to use OWNER 1.0.9. |
| 23 | |
| 24 | Then follow these steps: |
| 25 | |
| 26 | ```bash |
| 27 | # Download the sources |
| 28 | $ git clone https://github.com/lviggiano/owner.git owner |
| 29 | $ cd owner |
| 30 | # Compile, execute test, and generate the artifacts |
| 31 | $ mvn install |
| 32 | ``` |
| 33 | |
| 34 | This will build and install OWNER jars in your local maven repository. |
| 35 | At the end of the process, you should find the generated artifacts in the |
| 36 | `target` subdirectory. |
| 37 | |
| 38 | <div class="note"> |
| 39 | <h5>GIT URLs</h5> |
| 40 | <p> |
| 41 | The above examples uses the https url to clone the GIT repository, alternatively |
| 42 | - if your firewall allows - you can use the GIT native URL that may be |
| 43 | faster: git://github.com/lviggiano/owner.git. |
| 44 | </p> |
| 45 | </div> |
| 46 | |
| 47 | |
| 48 | Building with support for Java 8 and superior |
| 49 | --------------------------------------------- |
| 50 | |
| 51 | Since version 1.0.6 OWNER supports some language features introduced by Java 8 and superior, |
| 52 | such as [`default` methods][def-methods] in interfaces. |
| 53 | |
| 54 | The support classes for these features are encapsulated in the maven module called `owner-java8` that gets |
| 55 | included into the build process only when maven is invoked from JDK 8. |
| 56 | |
| 57 | [def-methods]: http://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html |
| 58 | |
| 59 | |
| 60 | Building a specific version |
| 61 | --------------------------- |
| 62 | |
| 63 | The `git clone` command downloads the full repository with the complete history |
| 64 | on your local computer. That also contains tags for the released versions. |
| 65 | |
| 66 | For instance, if I want to build the version 1.0.2 |
| 67 | |
| 68 | ```bash |
| 69 | # as example, this time we use the git:// URL |
| 70 | $ git clone git://github.com/lviggiano/owner.git owner |
| 71 | $ cd owner |
| 72 | # show all available tags |
| 73 | $ git tag -l |
| 74 | owner-1.0 |
| 75 | owner-1.0.1 |
| 76 | owner-1.0.2 |
| 77 | owner-1.0.3 |
| 78 | ... |
| 79 | $ git checkout owner-1.0.2 |
| 80 | HEAD is now at d2e4bbf... [maven-release-plugin] prepare release owner-1.0.2 |
| 81 | $ mvn install |
| 82 | ``` |
| 83 | |
| 84 | Please refer to [GIT documentation](http://git-scm.com/documentation) to learn |
| 85 | how to work with tags. |
| 86 | |
| 87 | |
| 88 | Running the tests |
| 89 | ----------------- |
| 90 | |
| 91 | OWNER codebase is very compact and fully tested. |
| 92 | |
| 93 | To execute the tests, you need maven properly installed and configured in your |
| 94 | system, then run the following command from the project root: |
| 95 | |
| 96 | ``` |
| 97 | $ mvn test |
| 98 | ``` |
| 99 | |
| 100 | |
| 101 | Continuous Integration |
| 102 | ---------------------- |
| 103 | |
| 104 | You can access latest builds from |
| 105 | [Jenkins](https://aeonbits.ci.cloudbees.com/job/owner-api/) and |
| 106 | [Travis](https://travis-ci.org/lviggiano/owner) websites. |
| 107 |