Release 1.13.6 Docker Artifact
[aai/aai-common.git] / README.md
1 # AAI-Common
2
3 ## Introduction
4 `AAI-Common` is a collection of common utility modules used by the other AAI components (`AAI-Resources` and `AAI-Traversal`). These utilities include `aai-schema`, which contains the schema oxm and xsd files; `aai-annotations`, which enables the annotations on the schema files; and `aai-core`, which includes various java packages used by all AAI microservices. `AAI-Resources` and `AAI-Traversal` are already configured to pull these dependencies using maven. For more information on `AAI-Resources` and `AAI-Traversal`, please see the `README.md` files in their respective repositories. This readme only covers AAI-Common.
5
6 ## Getting started
7
8 ### Prerequisites
9
10 The AAI services have some prerequisite requirements that must be met before being able to compile and test the services.
11 As with any other ONAP service, you need the [ONAP `settings.xml` file](https://git.onap.org/oparent/plain/settings.xml) in your `~/.m2/` folder.
12
13 In addition, the AAI services are still based on Java 8. As such, you can either
14
15 - globally define java 8 to be the standard jdk for the system (i.e `echo -e '\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/' >> ~/.bashrc`)
16 - define it locally for each command (i.e `JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/ mvn install -DskipTests`)
17 - configure it in your IDE
18
19 ### Install
20 A `mvn install` will build all modules make them locally available on your system:
21 ```sh
22 mvn install -Dcheckstyle.skip
23 ```
24
25 ## Test
26 Run all tests
27 ```sh
28 mvn test -Dcheckstyle.skip
29 ```
30 Run a test class
31 ```sh
32 mvn test -Dcheckstyle.skip -DfailIfNoTests=false -Dtest=PserverTest
33 ```
34 ```sh
35 cd aai-core/
36 mvn test -Dcheckstyle.skip -Dtest=PserverTest
37 ```
38
39 ## Docker build
40 ```sh
41 mvn clean install -P docker -Dcheckstyle.skip -DskipTests
42 ```
43
44 ## Debugging
45 If your IDE supports it, then use the built-in way to debug run a single test. Should that not be possible, you can attach your IDE to the debug port opened by maven via:
46 ```sh
47 mvn test -Dcheckstyle.skip -Dtest=PserverTest -Dmaven.surefire.debug
48 ```
49 This will open up a debug connection on port `5005`.T
50 The process of connecting to this port is IDE-specific.
51 For VSCode for example you have to create a `.vscode/launch.json` in the project with the following content:
52 ```json
53 {
54   "version": "0.2.0",
55   "configurations": [
56     {
57       "type": "java",
58       "name": "Debug (attach)",
59       "request": "attach",
60       "hostName": "localhost",
61       "port": 5005,
62       "internalConsoleOptions": "neverOpen",
63       "projectName": "aai-core"
64     }
65   ]
66 }
67 ```