description |
---|
Bootstrap your developer environment |
This section explains how to set up your environment to start contributing to Gravitee API Management (APIM) development.
You will need the following tools installed on your computer:
- Java (JDK >= 17)
- Maven
- Docker
- NPM (preferably managed with NVM)
Create a distribution
folder in the target
folder of each module. These distribution
folders contain a complete Management API and Gateway distribution (with default plugins) and should be used as the gravitee.home
environment variable.
-
Use the following code to clone the project in your workspace:
git clone https://github.com/gravitee-io/gravitee-api-management
-
Build APIM's Management API and Gateway components:
mvn clean install -T 2C
{% hint style="info" %}
Use -Dskip.validation=true
to skip license validation and Prettier checks
{% endhint %}
- Run
npm install
from thegravitee-api-management/gravitee-apim-console-webui
directory - Run
npm install
from thegravitee-api-management/gravitee-apim-portal-webui
directory
{% hint style="info" %}
Use nvm use
to switch to the appropriate version of NPM to build the UIs
{% endhint %}
Before starting APIM Management API and Gateway, run MongoDB and ElasticSearch, e.g., with Docker.
{% tabs %} {% tab title="MongoDB" %}
docker run -p 27017:27017 --name local-mongo -d mongo:3
{% endtab %}
{% tab title="ElasticSearch" %} {% code overflow="wrap" %}
docker run -d --name local-es7 -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.7.0
{% endcode %} {% endtab %} {% endtabs %}
{% tabs %}
{% tab title="CLI version" %}
Run ./gravitee
from the ${GRAVITEE_HOME}/bin
directory. ${GRAVITEE_HOME}
refers to the target/distribution
folder created previously when cloning the project.
{% endtab %}
{% tab title="IntelliJ configuration" %}
By default, the project includes the configuration Gateway - MongoDB
to run the Gateway.
-
Use classpath of module:
gravitee-apim-gateway-standalone-container
-
Main class:
io.gravitee.gateway.standalone.GatewayContainer
-
In the VM options, change the path to point to your project:
{% code overflow="wrap" %}
-Dgravitee.home="/home/user/dev/gravitee-api-management/gravitee-apim-gateway/gravitee-apim-gateway-standalone/gravitee-apim-gateway-standalone-distribution/target/distribution"
{% endcode %} {% endtab %} {% endtabs %}
{% tabs %}
{% tab title="CLI version" %}
Run ./gravitee
from the ${GRAVITEE_HOME}/bin
directory. ${GRAVITEE_HOME}
refers to the target/distribution
folder created previously when cloning the project.
{% endtab %}
{% tab title="IntelliJ configuration" %}
By default, the project includes the configuration Rest API - MongoDB
to run the Rest API.
-
Use classpath of module:
gravitee-apim-rest-api-standalone-container
-
Main class:
io.gravitee.rest.api.standalone.GraviteeApisContainer
. -
In the VM options, change the path to point to your project:
{% code overflow="wrap" %}
-Dgravitee.home="/home/user/dev/gravitee-api-management/gravitee-apim-rest-api/gravitee-apim-rest-api-standalone/gravitee-apim-rest-api-standalone-distribution/target/distribution"
{% endcode %} {% endtab %} {% endtabs %}
{% tabs %}
{% tab title="CLI version" %}
To start the UI, run npm run serve
from the gravitee-api-management/gravitee-apim-console-webui
directory.
{% endtab %}
{% tab title="IntelliJ configuration" %} Create a new Run configuration in IntelliJ:
- Click Run → Edit configurations → ✚ → npm
- Name it as required
- Choose package.json: gravitee-api-management/gravitee-apim-console-webui/package.json
- Select Command: run
- Select Script: serve
To npm install
, you can duplicate this configuration and choose Command > Install.
{% endtab %}
{% endtabs %}
{% tabs %}
{% tab title="CLI version" %}
To start the UI, run npm run serve
from the gravitee-api-management/gravitee-apim-portal-webui
directory.
{% endtab %}
{% tab title="IntelliJ configuration" %} Create a new Run configuration in IntelliJ:
- Click Run → Edit configurations → ✚ → npm
- Name it as required
- Choose package.json: gravitee-api-management/gravitee-apim-portal-webui/package.json
- Select Command: run
- Select Script: serve
To npm install
, you can duplicate this configuration and choose Command > Install.
{% endtab %}
{% endtabs %}
{% hint style="success" %} Congratulations, you are now ready to contribute to Gravitee! {% endhint %}