Table of Contents |
---|
We recognize that there are different ways to set up a workspace and different tools that may be chosen. This is just one way to set things up.
Suggested Directory Structure
NOTE: You may have different versions of eclipse and java.
onap
.m2
apache-maven-3.3.9
camunda-modeler
eclipse-java-neon-3-linux-gtk-x86_64
jdk1.8.0_131
workspace
SO
docker-config
libs
so
Java
Download the latest Java 8 SE Development Kit from Oracle. Select a Linux x64 package.
Unpack it.
Maven
Maven Setup
Download an the Apache Maven 3.3.9 binary. NOTE: 3.3.9 is the recommended version, even though much higher versions are available.
Unpack it.
Eclipse
Download Eclipse for Linux. Select the 64-bit Eclipse IDE for Java EE Developers. Oxygen seems to be the latest version. These instructions were written for Neon.
Unpack it.
If you are behind a corporate firewall, set proxy environment variables needed in the next step by add-apt-repository:
export http_proxy="http://proxyhost:port"
export https_proxy="http://proxyhost:port"
Set up repository so you can get Oracle's JDK:
sudo apt install python-software-properties
sudo -E add-apt-repository ppa:webupd8team/java
sudo apt update
Create an SSH key to user with gerrit. Use no passphrase.
ssh-keygen -t rsa
Enter your SSH public key (id_rsa) into gerrit:
Browse to https://gerrit.onap.org
Log in
Open the menu next to your name (under the green search button)
Select "Settings"
In the "Settings" sidebar, click "SSH Public Keys"`
Click "Add Key..."
Paste the entire contents of $HOME/.ssh/id_rsa.pub
into the text area and click "Add".
Install the git-review package.
sudo apt update
sudo apt install git-review
Create $HOME/.gitconfig (replace highlighted values with your own information):
[user]
name = FirstName LastName
email = you@yourcompany.com
[core]
autocrlf = false
[merge]
tool = vimdiff
[gitreview]
username = YourLinuxFoundationId
If you're behind a corporate firewall and your proxy server has SOCKS support...
You may be able to use the SSH protocol with git, which is preferred versus HTTP. This method is known to work in the AT&T corporate network.
Install the socat package, which allows you to tunnel SSH connections through a proxy that supports SOCKS:
sudo apt update
sudo apt install socat
Create (or append to) $HOME/.ssh/config
(replace highlighted values with your information)
Host gerrit.onap.org
User userid
Hostname gerrit.onap.org
ProxyCommand socat - PROXY:host:%h:%p,proxyport=port
IdentityFile /home/userid/.ssh/id_rsa
ServerAliveInterval 10
Verify that you have connectivity to gerrit through the proxy. Answer "yes" to continue connecting, if prompted.
ssh -p 29418 gerrit.onap.org
If you're behind a corporate firewall and you need to use HTTPS...
...
Create an .m2
directory for maven and put settings.xml in it. Edit the local repository path in settings.xml to make it correct for your environment. Everything else should be OK.
Maven Run JUnit Tests
Code Block | ||
---|---|---|
| ||
# Run Tests
mvn clean test
# Run A Specific Test
mvn clean -Dtest=MsoVnfPluginAdapterImplTest test -e
# mvn clean -Dtest=<Java Class Name> test -e
# #### '-e' turns on Error Stack Traces
# Remote Debug A Specific Test - Setup IDE to connect to 5005
# #### Be sure to open port 5005 on your build system
mvn -Dmaven.surefire.debug -Dtest=MsoVnfPluginAdapterImplTest test -e
# Attach remote Debugger
## Eclipse https://dzone.com/articles/how-debug-remote-java-applicat
## IntelliJ https://stackoverflow.com/questions/21114066/attach-intellij-idea-debugger-to-a-running-java-process |
See https://maven.apache.org/surefire/maven-surefire-plugin/examples/debugging.html for more info.
Camunda Modeler
Download the Camunda Modeler. Select the Linux x64 package.
Unpack it.
Eclipse
Download Eclipse for Linux. Select the 64-bit Eclipse IDE for Java Developers. Oxygen seems to be the latest version. These instructions were written for Neon.
Unpack it.
In the eclipse directory, edit eclipse.ini
Add (or change) the -vm setting so that it points to your JDK.
Adjust the maximum heap space (2GB is recommended).
Example:
Eclipse Settings
Configure eclipse to use your external maven 3.3.9 installation:
Go to Window→Preferences→Maven→Installations
Click "Add" and browse to your apache-maven-3.3.9 directory. Click "OK" to select it.
Click "Finish"
Make sure the external installation is selected:
Configure eclipse to use your settings.xml
Go to Window→Preferences→Maven→User Settings
Type the full path to your settings.xml file into the "User Settings" box and click "OK".