# 製作你的第一個擴充插件

{% hint style="warning" %}
在開始本教程前，請先確保你以完成以下步驟。

1. 已安裝 Maven 或 其他 依賴整合工具 (Build-automation utility)
2. 已安裝 git
3. 已安裝 Intellj IDEA 或 其他 擁有 VCS 操作的 整合開發環境 (IDE)
   {% endhint %}

{% hint style="info" %}
以下範例將使用如下環境

* Intellij IDEA 作為 整合開發環境
* Maven 作為 依賴整合工具
  {% endhint %}

首先，進入 [擴充插件 範本 的 Github 頁面](https://github.com/ELDEpendenci-Addons/Template-For-ELDependenci-Addon)。&#x20;

其次，點擊 Use This Template 創建新 專案。

![點擊 Use This Template 創建專案](https://2755384241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJQ1cQ1lCNpkF7cMJ_v%2F-MK4-e-59RjW9_DoSkB_%2F-MK4Au1WH1YszTW6o7zA%2Fuse-template.png?alt=media\&token=b87c4385-6279-4f41-bde5-80391da6fb1f)

![輸入你的專案名稱並按下創建專案。](https://2755384241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJQ1cQ1lCNpkF7cMJ_v%2F-MK4-e-59RjW9_DoSkB_%2F-MK4BAWWBsP8qErJm28I%2Fcreate-addon-repo.png?alt=media\&token=3f655fbc-ba2c-4d5a-a554-10303679eeb4)

創建後將出現如下頁面

![](https://2755384241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJQ1cQ1lCNpkF7cMJ_v%2F-MK4-e-59RjW9_DoSkB_%2F-MK4EMSznPqKSAe3OzwY%2Fmy-repo.png?alt=media\&token=5dcd9974-0ce8-43f6-97e1-13222cc2c946)

然後，用以下任一方式把你的專案 clone 到你的 IDE下。

{% tabs %}
{% tab title="使用 瀏覽器擴充" %}
欲要使用瀏覽器擴充下載源碼，請先下載[瀏覽器擴充](https://blog.jetbrains.com/blog/2020/04/07/toolbox-browser-extension-on-self-hosted-github-gitlab-bitbucket-instances/)。

然後，按下 你欲 使用的 IDE 按鈕 進行下載。

![此處使用 Intellj IDEA 按鈕進行下載。](https://2755384241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJQ1cQ1lCNpkF7cMJ_v%2F-MK4-e-59RjW9_DoSkB_%2F-MK4E_baAGelxTrN733K%2Fclone-with-extension.png?alt=media\&token=4092d378-21c7-4484-9734-ff357018aceb)
{% endtab %}

{% tab title="使用 git 指令進行下載" %}
{% hint style="info" %}
此處將以 https clone 作為範例。
{% endhint %}

首先，複製你的 git 連結。

![](https://2755384241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJQ1cQ1lCNpkF7cMJ_v%2F-MK4-e-59RjW9_DoSkB_%2F-MK4FEPrQ0kdJGKpc7Qi%2Fclone-with-https.png?alt=media\&token=8f5de7bb-ae6f-4ec7-af3e-355747c26912)

然後，輸入如下的指令

```bash
# 連結為你所複製的 git 連結
git clone https://github.com/eric2788/MyAddon.git
```

打開你的 Intellij IDEA 並創建已存在源碼的專案。

<div align="left"><img src="https://2755384241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJQ1cQ1lCNpkF7cMJ_v%2F-MK4-e-59RjW9_DoSkB_%2F-MK4FtBRVxT5PDrupCBr%2Fcreate-from-existing.png?alt=media&#x26;token=f6db10cb-471f-4e64-a9b6-d3cda2b1c00f" alt=""></div>

最後定位你 git clone 的位置，並以 Maven 載入專案。
{% endtab %}

{% tab title="使用 IDE 的 VCS 下載" %}
{% hint style="info" %}
此處將以 https clone 作為範例。
{% endhint %}

首先，複製你的 git 連結。

![](https://2755384241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJQ1cQ1lCNpkF7cMJ_v%2F-MK4-e-59RjW9_DoSkB_%2F-MK4FEPrQ0kdJGKpc7Qi%2Fclone-with-https.png?alt=media\&token=8f5de7bb-ae6f-4ec7-af3e-355747c26912)

然後，打開 Intellij IDEA 並以VCS 創建專案

<div align="left"><img src="https://2755384241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJQ1cQ1lCNpkF7cMJ_v%2F-MK4-e-59RjW9_DoSkB_%2F-MK4GxVF1uFpR3gMYlO-%2Fimage.png?alt=media&#x26;token=2b4a6fe9-dfee-46f1-9cb7-1549750e5de7" alt="點擊如上"></div>

貼上你所複製的 git 連結

![](https://2755384241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJQ1cQ1lCNpkF7cMJ_v%2F-MK4-e-59RjW9_DoSkB_%2F-MK4HAdlAqZkKH_EPCrY%2Fimage.png?alt=media\&token=d511bfa0-c650-44ea-aa91-282118604627)

完成後按 Clone 進行下載。
{% endtab %}
{% endtabs %}

這樣，一個擴充插件的範本就被成功下載了。

![](https://2755384241-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJQ1cQ1lCNpkF7cMJ_v%2F-MK4-e-59RjW9_DoSkB_%2F-MK4IDCbd-vZf9G3rF2a%2Fimage.png?alt=media\&token=d6a5035b-5d08-49ad-a4f1-90e12e4d4ddc)

{% hint style="success" %}
這是一個已經寫好的範本，因此你可以直接使用 `mvn package` 指令 或 到右側 maven 版面 按下 package 進行 建置，完成後打開 /target/ 就能找到成功建置的jar了。
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://eric2788.gitbook.io/eldependenci/extensions/how-to-make-addon.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
