此内容没有您所选择的语言版本。
1.3. Creating a Project
It is possible to create a project either in the Project Authoring perspective of Business Central or using the REST API calls.
Creating a Project in Business Central
Note that only users with the admin
role in Business Central can create projects.
Procedure: Using Business Central to Create a Project
-
In Business Central, go to Authoring
Project Authoring. - In the Project Explorer, select the organizational unit and the repository in which you want to create the project.
On the perspective menu, click New Item
Project. The New Project dialog window opens.
Define the Project General Settings and Group artifact version details of the new project. These parameters are stored in the
pom.xml
Maven configuration file.See the detailed description of the parameters:
-
Project Name: name of the project (for example
MortgageProject
). - Project Description: description of the project, which may be useful for the project documentation purposes.
-
Group ID: group ID of the project (for example
org.mycompany.commons
). -
Artifact ID: artifact ID unique in the group (for example
myframework
). Avoid using a space or any other special character that might lead to an invalid name. -
Version: version of the project (for example
2.1.1
).
-
Project Name: name of the project (for example
Click Finish.
The project screen view is updated with the new project details as defined in the
pom.xml
file. You can switch between project descriptor files and edit their content by clicking the Project Settings: Project General Settings button at the top of the project screen view.
Creating a Project Using the REST API
Note that only users with the rest-all
or rest-project
role can create projects.
To create a project in the repository, issue the POST
REST API call. Details of the project are defined by the corresponding JSON entity.
Input parameter of the call is an Entity
instance. The call returns a CreateProjectRequest
instance.
Example 1.1. Creating a Project Using the Curl Utility
Example JSON entity containing details of a project to be created:
Execute the following command:
curl -X POST 'localhost:8080/business-central/rest/repositories/REPOSITORY_NAME/projects/' -u USERNAME:PASSWORD -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"name":"MortgageProject","description":null,"groupId":"org.mycompany.commons","version":"2.1.1"}'
curl -X POST 'localhost:8080/business-central/rest/repositories/REPOSITORY_NAME/projects/' -u USERNAME:PASSWORD -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"name":"MortgageProject","description":null,"groupId":"org.mycompany.commons","version":"2.1.1"}'
For further information, refer to chapter Knowledge Store REST API, section Repository Calls of the Red Hat JBoss BPM Suite Development Guide.