...
Release trees are archived in this Git release repository and available for browsing:
https://gerrit.onap.org/r/#/admin/projects/portal/sdk
Downloading the SDK
Below is the link to SDK Sample App in gerrit repo. You can download the below sample app to bring up a simple demo webapp that brings many out of box features to integrate with ONAP Portal.
Prerequisites
- Java version 1.8
- Maven version 3.
- These instructions do not require any entries in a local Maven configuration file, which is stored below your home directory in file .m2/settings.xml. However, some people have reported problems caused by entries in their configuration files.
- Tomcat version 8
- MariaDB Server version 10.1.11-MariaDB, which includes Galera cluster support.
- Maven will automatically download required jar and pom files from the ONAP nexus repositories.
Basic Project setup - New install of ONAP SDK using Maven
- Create a new directory and download the ONAP SDK Sample App project within that new location; e.g C:\dev\ONAP_SDK
- In the newly created directory, first run maven on the "clean" goal (mvn clean). You should see no warnings, and eventually a build success message. This validates that you have maven working.
- Build the deployable WAR file using the "package" goal (mvn package). You will see some warnings about missing pom files, which can be ignored.
Eclipse Project setup
This section offers instructions for a clean/new install of the ONAP SDK in the Eclipse development environment.
Additional prerequisites:
- Eclipse for JEE Developers, version Mars. This distribution includes include the Web Tools Platform (WTP) plugins that recognize JSP files, and should also have the Maven (m2e) plugin installed by default. (Avoid using Eclipse for Java Developers.)
- At least 2 GB memory limit in Eclipse to allow the project validation to run to completion. To change the upper memory limit that Eclipse can use, edit the file eclipse.ini and under the -vmargs line look for an entry with -Xmx; the following entry allows 2GB: -Xmx2048m
Steps:
- Create a new directory and download the ONAP SDK Sample App project within that new location; e.g C:\dev\ONAP_SDK
- Import the project into your eclipse workspace: File → Import → Existing Maven project, browse to the newly created directory and click OK, it will show the pom.xml file, then click Finish.
- The first import and build will take some time while the Maven plugin downloads required dependencies and validates the project contents. If Eclipse runs out of memory, see above note in "additional prerequisites".
- Check the sanity of the project's Eclipse source classpath; deployment assembly folders are all properly set. The project classpath must reflect the Maven dependencies; depending on your location setup, your classpath may also include Server Runtime libraries (Tomcat for example).
- Run maven on the "clean" and then the "install" targets: First, right click on the project, pick Run As, pick Maven Clean. Second, again right click on the project, pick Run As, pick Maven Build..., enter "install" in the Goals field, then click the Run button.
Note 1: If Maven dependencies are not appearing in the classpath/libraries, there could be a need to update the maven project (Right click on the project → Maven Update)
Database setup
The application requires MariaDB (MySQL-compatible) database with a predefined set of tables; see the Prerequisites section above for the software versions needed. Note that many ONAP Portal SDK team members reuse existing databases for development and test, but this option is not available to developers outside the ONAP Portal team.
- Configure the server to ignore case on table names by setting the MySQL/MariaDB system variable called lower_case_table_names to value 1. Example line in the MySQL configuration file my.cnf within the [mysqld] section:
lower_case_table_names = 1
Create a database user, for example 'ecomp_sdk_user':
- mysql> create user 'ecomp_sdk_user'@'localhost' identified by 'ecomp_sdk_pass';
- Create a database, for example 'ecomp_sdk':
- mysql> create database 'ecomp_sdk';
Grant access to the newly created database. For example, if the database is created with the name of ‘ecomp_sdk’, login as root to your MySQL instance and grant full privileges on the database you created. Depending on your distribution, the command will look something like this:
mysql> grant all on ecomp_sdk.* to ‘ecomp_sdk_user’@'localhost';
Populate the database by first running the DDL and then DML scripts provided in folder db-scripts. There are 6 scripts included that can be used for SDK; only one DDL and one DML file is necessary at one time. Please see the table below to see which scripts your instance needs. You will need to revise the scripts to use the database name you chose above; all scripts use the database name "ecomp_sdk". For example:
- mysql> source EcompSdkDDLMySql.sql;
- mysql> source EcompSdkDMLMySql.sql
ECOMP SDK File Name | Purpose |
---|---|
EcompSdkDDLMySql.sql | Creates all tables required by the SDK web application. Use this when creating a new database. |
EcompSdkDDL_(verNNNN)_Add.sql | Adds tables required by the SDK web application for the specified release; e.g., 1610. Use this when upgrading from a previous release. |
EcompSdkDMLMySql.sql | Populates tables with all data required by the SDK web application. Use this when creating a new database. |
EcompSdkDML_(verNNNN)_Add.sql | Adds and modifies data rows used by the SDK web application for the specified release; e.g., 1610. Use this when upgrading from a previous release. |
EcompSdkTestDML.sql | Adds data rows that may help for testing the SDK web application. Partner applications should modify this to suit testing needs. |
cleanup_EcompSdk.sql | Removes tables and keys created in the original Fusion script (previous releases) that are no longer used. Alters some columns to reduce their sizes. Use this to clean up very old versions of the database. |