Skip to content

This project contains a maven archetype which help creating a new Bonita Rest API extension project.

License

Notifications You must be signed in to change notification settings

bonitasoft/bonita-rest-api-extension-archetype

Repository files navigation

Actions Status GitHub release Maven Central License: GPL v2

bonita-rest-api-extension-archetype

Disclaimer

  • Use a JRE/JDK 1.8 or Java 11 for Bonita 7.13+, Java 17 for Bonita 10.0+
  • Compatible with Bonita 7.12+

How to build the archetype

git clone https://github.com/bonitasoft/bonita-rest-api-extension-archetype.git
cd bonita-rest-api-extension-archetype
./mvnw clean install

How to use the archetype

mvn archetype:generate \
    -DarchetypeGroupId=org.bonitasoft.archetypes \
    -DarchetypeArtifactId=bonita-rest-api-extension-archetype \
    -DgroupId=org.company.api \
    -DartifactId=my-rest-api \
    -Dversion=0.0.1-SNAPSHOT \
    -Dlanguage=java \
    -DbonitaVersion=7.12.1 \
    -DapiName=myRestApi \
    -DpathTemplate=my-rest-api \
    -DapiDisplayName="My REST API" \
    -DurlParameters=p,c \
    -DhttpVerb=GET

Optionnal archetype parameters

Parameter Required Default value Description
-DbonitaVersion true You can choose the version of the dependent bonita artifacts. Minimum version is 7.12.1.
-Dsp false false If set to true, project will use Bonita subscription dependencies. This implies you have made bonita subscription artifacts available for maven (in your local repository or enterprise repository)
-Dlanguage true You can choose between groovy, java or kotlin.
-Dwrapper false true If set to true, project will setup a maven wrapper
-DapiName true Set the name of your api extension. You must enter an url friendly name without blanks.
-DapiDisplayName true A display name for your api extension (displayed in the portal for the administrator)
-DapiDesc false My Rest API extension description A short description of the purpose of your api extension (displayed in the portal for the administrator)
-DhttpVerb true The http verb of your api extension
-DpathTemplate true URL path template. Resulting url: ../API/extension/myRestExtApi
-DpermissionNames false myRestAPIPermission Define permission list (comma separated value), specify permissions a user need to have in order access this REST API extension
-DurlParameters false ! Define a list (comma separated value) of url parameters.

Release this project

A github action is used to perform release :

release build

  • This action is triggered when a push is performed on a branch 'release-xxx'
  • It generates the changelog since the last release, creates the github tag and release with the changelog as description, and push the release on our nexus repository.

So, to release a new version of the project, you have to:

  • Create a branch release-[version] on your local git repository
  • Update the version in the pom.xml (remove the -SNAPSHOT)
  • Push the branch

⚠️ Make sure that the release branch is final before to push it. If you have to update something on the release branch after the push, then you must first:

  • Delete the tag and the release on github
  • Remove the artifact from our nexus repository