You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Revert some changes on this branch from main to provide configuration for both traditional build scripts and Centralizing Repository Declarations, instead of favoring the latter
Copy file name to clipboardExpand all lines: content/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry.md
+16-20Lines changed: 16 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ category:
37
37
38
38
{% data reusables.package_registry.required-scopes %}
39
39
40
-
You can authenticate to {% data variables.product.prodname_registry %} with Gradle using either Gradle Groovy or Kotlin DSL. To publish packages, edit your _build.gradle_ file (Gradle Groovy) or _build.gradle.kts_ file (Kotlin DSL) to include your {% data variables.product.pat_v1 %}. To use packages as dependencies, declare the repository and credentials in your _settings.gradle_ file (Gradle Groovy) or _settings.gradle.kts_ file (Kotlin DSL). You can also configure Gradle Groovy and Kotlin DSL to recognize a single package or multiple packages in a repository.
40
+
You can authenticate to {% data variables.product.prodname_registry %} with Gradle using either Gradle Groovy or Kotlin DSL by editing your _build.gradle_ file (Gradle Groovy) or _build.gradle.kts_ file (Kotlin DSL) file (or _settings.gradle_/_settings.gradle.kts_ if you use [Centralizing Repository Declarations](https://docs.gradle.org/current/userguide/centralizing_repositories.html)) to include your {% data variables.product.pat_v1 %}. You can also configure Gradle Groovy and Kotlin DSL to recognize a single package or multiple packages in a repository.
41
41
42
42
{% ifversion ghes %}
43
43
Replace REGISTRY_URL with the URL for your instance's Maven registry. If your instance has subdomain isolation enabled, use `maven.HOSTNAME`. If your instance has subdomain isolation disabled, use `HOSTNAME/_registry/maven`. In either case, replace HOSTNAME with the host name of your {% data variables.product.prodname_ghe_server %} instance.
@@ -169,10 +169,10 @@ subprojects {
169
169
170
170
## Using a published package
171
171
172
-
To use a published package from {% data variables.product.prodname_registry %}, add the package as a dependency and declare the repository in your project. Gradle recommends declaring repositories in your settings script with `dependencyResolutionManagement`. For more information, see [Declaring dependencies](https://docs.gradle.org/current/userguide/declaring_dependencies.html) and [Centralizing repository declarations](https://docs.gradle.org/current/userguide/centralizing_repositories.html) in the Gradle documentation.
172
+
To use a published package from {% data variables.product.prodname_registry %}, add the package as a dependency and add the repository to your project. For more information, see [Declaring dependencies](https://docs.gradle.org/current/userguide/declaring_dependencies.html) and [Centralizing Repository Declarations](https://docs.gradle.org/current/userguide/centralizing_repositories.html) in the Gradle documentation.
173
173
174
174
{% data reusables.package_registry.authenticate-step %}
175
-
1. Add the package dependencies to your _build.gradle_ file (Gradle Groovy) or _build.gradle.kts_ file (Kotlin DSL) file.
175
+
1. Add the package dependencies to your _build.gradle_ file (Gradle Groovy) or _build.gradle.kts_ file (Kotlin DSL).
176
176
177
177
Example using Gradle Groovy:
178
178
@@ -190,19 +190,17 @@ To use a published package from {% data variables.product.prodname_registry %},
190
190
}
191
191
```
192
192
193
-
1. Add the repository to your _settings.gradle_ file (Gradle Groovy) or _settings.gradle.kts_ file (Kotlin DSL) using a`dependencyResolutionManagement` block.
193
+
1. Add the repository to your _build.gradle_ file (Gradle Groovy) or _build.gradle.kts_ file (Kotlin DSL) file, or to your _settings.gradle_ file (Gradle Groovy) or _settings.gradle.kts_ file (Kotlin DSL) in the`dependencyResolutionManagement` block if you [Centralizing Repository Declarations](https://docs.gradle.org/current/userguide/centralizing_repositories.html).
0 commit comments