Update zh tw languages and fix some broken links

This commit is contained in:
Lunny Xiao
2026-07-01 14:47:51 -07:00
parent 9558006c39
commit a084bdb556
842 changed files with 31137 additions and 31065 deletions

View File

@@ -6,18 +6,18 @@ sidebar_position: 60
---
# Maven 软件包注册
# Maven 套件註冊
您的用户或组织发布 [Maven](https://maven.apache.org) 软件包
您的使用者或組織發佈 [Maven](https://maven.apache.org) 套件
## 要求
要使用 Maven 软件包注册表,您可以使用 [Maven](https://maven.apache.org/install.html) 或 [Gradle](https://gradle.org/install/)。
以下例使用 `Maven``Gradle Groovy`
要使用 Maven 套件註冊表,您可以使用 [Maven](https://maven.apache.org/install.html) 或 [Gradle](https://gradle.org/install/)。
以下例使用 `Maven``Gradle Groovy`
## 配置软件包注册
## 設定套件註冊
注册软件包注册表,首先需要将访问令牌添加到 [`settings.xml`](https://maven.apache.org/settings.html) 文件中:
註冊套件註冊表,首先需要將存取權杖添加到 [`settings.xml`](https://maven.apache.org/settings.html) 文件中:
```xml
<settings>
@@ -37,7 +37,7 @@ sidebar_position: 60
</settings>
```
后在项目`pom.xml` 文件中添加以下部分:
後在專案`pom.xml` 文件中添加以下部分:
```xml
<repositories>
@@ -58,14 +58,14 @@ sidebar_position: 60
</distributionManagement>
```
| 参数 | 描述 |
| 參數 | 描述 |
| -------------- | ------------------------------------------------------------------------------------- |
| `access_token` | 您的[个人访问令牌](development/api-usage.md#通过-api-认证) |
| `owner` | 软件包的所有者 |
| `access_token` | 您的[個人存取權杖](development/api-usage.md) |
| `owner` | 套件的所有者 |
### Gradle variant
如果您计划在项目中添加自 Gitea 例的一些软件包,请将其添加到 repositories 部分中:
如果您計劃在專案中添加自 Gitea 例的一些套件,請將其添加到 repositories 部分中:
```groovy
repositories {
@@ -74,11 +74,11 @@ repositories {
}
```
在 Groovy gradle 中,您可以在发布部分中包含以下本:
在 Groovy gradle 中,您可以在發佈部分中包含以下本:
```groovy
publishing {
// 其他发布设
// 其他發佈設
repositories {
maven {
name = "Gitea"
@@ -97,35 +97,35 @@ publishing {
}
```
## 发布软件包
## 發佈套件
发布软件包,只需行以下命令:
發佈套件,只需行以下命令:
```shell
mvn deploy
```
或者,如果您使用的是 Gradle使用 `gradle` 命令和 `publishAllPublicationsToGiteaRepository`
或者,如果您使用的是 Gradle使用 `gradle` 命令和 `publishAllPublicationsToGiteaRepository`
```groovy
./gradlew publishAllPublicationsToGiteaRepository
```
如果您想要将预构建的软件包发布到注册表中,可以使用 [`mvn deploy:deploy-file`](https://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html) 命令:
如果您想要將預構建的套件發佈到註冊表中,可以使用 [`mvn deploy:deploy-file`](https://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html) 命令:
```shell
mvn deploy:deploy-file -Durl=https://gitea.example.com/api/packages/{owner}/maven -DrepositoryId=gitea -Dfile=/path/to/package.jar
```
| 参数 | 描述 |
| 參數 | 描述 |
| ------- | -------------- |
| `owner` | 软件包的所有者 |
| `owner` | 套件的所有者 |
如果存在相同名和版本的软件包,您无法发布该软件包。您必须先删除现有的软件包
如果存在相同名和版本的套件,您無法發佈該套件。您必須先刪除現有的套件
## 安装软件包
## 安裝套件
从软件包注册表中安 Maven 软件包,请在项目`pom.xml` 文件中添加新的依赖项
從套件註冊表中安 Maven 套件,請在專案`pom.xml` 文件中添加新的依賴項
```xml
<dependency>
@@ -135,19 +135,19 @@ mvn deploy:deploy-file -Durl=https://gitea.example.com/api/packages/{owner}/mave
</dependency>
```
`Gradle Groovy`似的操作如下:
`Gradle Groovy`似的操作如下:
```groovy
implementation "com.test.package:test_project:1.0.0"
```
后运行:
後運行:
```shell
mvn install
```
## 支的命令
## 支的命令
```
mvn install