This document describes how a developer's workstation can be setup.
- Linux or Windows
- Java 8
- Maven 3.x
There are several of ways to get code, e.g. download it as a zip file or clone the git repository.
git clone https://github.com/nordic-institute/REST-adapter-service.git
The code is located in the src
folder.
Rest Adapter Service uses Maven as the build management tool. In order to build the whole project and generate the war file (rest-adapter-service-xxx.war), you must run the maven command below from the src
directory.
mvn clean install
Running the above maven command generates the war file under the directory presented below:
src/target/rest-adapter-service-xxx.war
If running mvn clean install
generates the error presented below, there are two possible solutions.
[ERROR] Failed to execute goal on project rest-adapter-service: Could not resolve dependencies for project org.niis:rest-adapter-service:war:1.1.0-SNAPSHOT: Failed to collect dependencies at org.niis.xrd4j:common:jar:0.3.0: Failed to read artifact descriptor for org.niis.xrd4j:common:jar:0.3.0: Could not transfer artifact org.niis.xrd4j:common:pom:0.3.0 from/to niis-repo (https://artifactory.niis.org/xroad-maven-releases): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
Skip certificate validation:
mvn install -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
Import NIIS's Maven repository's certificate as a trusted certificate into cacerts
keystore. See full instructions. NIIS's Maven release repository's URL is https://artifactory.niis.org/xroad-maven-releases
.
The project can be imported into different IDEs. Required steps vary depending on the chosen IDE. Simple quick start is described for IntelliJ IDEA.
Opening the project in IDEA.
- Install Lombok plugin and Maven integration plugin, if you have not done it yet
- File -> New project from existing sources -> Choose pom.xml
- Rest of the options can be left at defaults
- Run maven task spring-boot:run to start up Rest Adapter
Once started up, Rest Adapter landing page can be found at
http://localhost:8080/rest-adapter-service/
and will contain links to Consumer and Provider endpoints in addition to the Provider wsdl.