## Page Guide

- **Use Cases**: For configuring the license certificate after professional-edition deployment, and for pulling professional-edition private dependencies during secondary development.
- **Prerequisites**: You have obtained the private repository access token and the commercial license certificate, and confirmed that the current deployment version matches the certificate.
- **Operation Path**: Configure the Maven private key → pull private dependencies → install the license certificate → configure the certificate name → restart the service and verify.
- **Acceptance Criteria**: Dependencies download normally, the license prompt on the platform home page disappears, and professional-edition features can be entered and used normally.

::: tip Commercial License Steps

1. Obtain the private key from the private repository and configure it in Maven.
2. Contact customer service to obtain the certificate, then install and configure the license certificate in the frontend.
   :::

## 1. Configure The Maven Repository Private Key

### 1.1. Obtain The GitLab Private Token

Log in to the private repository, click the avatar -> Preferences -> Access Tokens -> fill in the name and expiration time, select all permissions -> click the Create button. Set a longer expiration time to keep it valid for a long time.

<img alt="1. Obtain the GitLab private token page screenshot" src="../../../../business/v2/install/images/license/maven.png" style="border:1px solid #ccc;border-radius:1px;" loading="lazy" />

<img alt="1. Obtain the GitLab private token page screenshot" src="../../../../business/v2/install/images/license/maven03.png" style="border:1px solid #ccc;border-radius:1px;" loading="lazy" />

### 1.2. Configure The Private Key In Maven

**Note:** If pulling with your own installed Maven fails, switch to the Maven bundled with IDEA.

* Open the Maven settings.xml file.

The default IDEA configuration file is located at `IntelliJ IDEA 2024.1\plugins\maven\lib\maven3\conf`, or under your own specified Maven installation directory.

<img alt="2. Configure the private key in Maven screenshot" src="../../../../business/v2/install/images/license/maven01.png" style="border:1px solid #ccc;border-radius:1px;" loading="lazy" />

* Fill in the Maven private key configuration. Only the value part needs to be modified and must start with fastbee-; be careful not to pick the wrong one. Keep the name part as default.

```xml
  <servers>
    <server>
      <id>gitlab-maven</id>
      <configuration>
        <httpHeaders>
          <property>
            <name>Private-Token</name>
            <value>fastbee-xxxxxx</value>
          </property>
        </httpHeaders>
      </configuration>
    </server>
  </servers>
```

::: tip Note

1. After the Maven private key is filled in successfully, check whether other mirror sources are configured in the settings.xml file. If so, comment them out, otherwise pulling from the FastBee private repository may fail.
2. If pulling from the private repository still fails after configuration, copy the configured settings.xml file, create a new Maven repository, reconfigure Maven in IDEA, and then pull again.
   :::
   <img alt="2. Configure the private key in Maven screenshot" src="../../../../business/v2/install/images/license/maven04.png" style="border:1px solid #ccc;border-radius:1px;" loading="lazy" />    

<img alt="2. Configure the private key in Maven screenshot" src="../../../../business/v2/install/images/license/maven05.png" style="border:1px solid #ccc;border-radius:1px;" loading="lazy" />  

If pulling from the private repository still fails with the above configuration, download the jar package of the corresponding version from the code repository address, manually copy it to the local repository, and refresh with the Maven bundled with IDEA.\ <img alt="2. Configure the private key in Maven screenshot" src="../../../../business/v2/install/images/license/maven06.png" style="border:1px solid #ccc;border-radius:1px;" loading="lazy" />\ <img alt="2. Configure the private key in Maven screenshot" src="../../../../business/v2/install/images/license/maven07.png" style="border:1px solid #ccc;border-radius:1px;" loading="lazy" />\ <img alt="2. Configure the private key in Maven screenshot" src="../../../../business/v2/install/images/license/maven08.png" style="border:1px solid #ccc;border-radius:1px;" loading="lazy" />

* Common library imported successfully

<img alt="2. Configure the private key in Maven screenshot" src="../../../../business/v2/install/images/license/maven02.png" style="border:1px solid #ccc;border-radius:1px;" loading="lazy" />

## 2. License Certificate Installation

### 2.1. Install And Configure The License Certificate

![Install the certificate](https://www.fastbee.cn/doc/assets/license004.DKAXIl5T.png)
![Install the certificate](https://www.fastbee.cn/doc/assets/license003.BfQ9zOyB.png)
![Install the certificate](https://www.fastbee.cn/doc/assets/license006.DErd5Hb3.png)

### 2.2. Local Run And Packaging Configuration

::: tip
The certificate name must be configured in the yml file.
:::

For local runs, the default certificate path is in the classpath of the project path. For docker-compose deployment to a server, keep the default prod configuration.

::: code-group

```yml [Configure the path and certificate name in application-dev.yml]
license:
  subject: you_license_name
  licensePath: classpath:license.lic
  publicKeysStorePath: classpath:publicCerts.keystore
```

```yml [Configure the path and certificate name in application-prod.yml]
license:  
  subject: you_license_name
  licensePath: /license/license.lic
  publicKeysStorePath: /license/publicCerts.keystore
```

:::

### 2.3. Notes For Upgrading From Old Versions

For systems deployed with Docker Compose, add the certificate directory mapping to the script, and upload the public key and certificate from the project's docker directory to the corresponding directory on the server.

![Modify the script](https://www.fastbee.cn/doc/assets/license001.BRUH6DE8.png)
