Skip to content

Commit a4e28a5

Browse files
committed
Fix code block markdown in gradle packages doc
1 parent c7847dc commit a4e28a5

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

content/packages/using-github-packages-with-your-projects-ecosystem/configuring-gradle-for-use-with-github-packages.md

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -120,50 +120,50 @@ publishing {
120120

121121
##### Example using Kotlin DSL for multiple packages in the same repository
122122

123+
```shell
124+
plugins {
125+
`maven-publish` apply false
126+
}
127+
128+
subprojects {
129+
apply(plugin = "maven-publish")
130+
configure<PublishingExtension> {
131+
repositories {
132+
maven {
133+
name = "GitHubPackages"
134+
url = uri("https://{% if currentVersion == "free-pro-team@latest" %}maven.pkg.github.com{% else %}<em>REGISTRY-URL</em>{% endif %}/<em>OWNER</em>/<em>REPOSITORY</em>")
135+
credentials {
136+
username = project.findProperty("gpr.user") as String? ?: System.getenv("<em>USERNAME</em>")
137+
password = project.findProperty("gpr.key") as String? ?: System.getenv("<em>TOKEN</em>")
138+
}
139+
}
140+
}
141+
publications {
142+
register<MavenPublication>("gpr") {
143+
from(components["java"])
144+
}
145+
}
146+
}
147+
}
148+
```
149+
150+
#### Authenticating with the `GITHUB_TOKEN`
151+
152+
{% data reusables.package_registry.package-registry-with-github-tokens %}
153+
154+
For more information about using `GITHUB_TOKEN` with Maven, see "[Publishing Java packages with Maven](/actions/language-and-framework-guides/publishing-java-packages-with-maven#publishing-packages-to-github-packages)."
155+
156+
### Publishing a package
157+
158+
{% data reusables.package_registry.default-name %} For example, {% data variables.product.prodname_dotcom %} will publish a package named `com.example.test` in the `OWNER/test` {% data variables.product.prodname_registry %} repository.
159+
160+
{% data reusables.package_registry.viewing-packages %}
161+
162+
{% data reusables.package_registry.authenticate-step %}
163+
2. After creating your package, you can publish the package.
164+
123165
```shell
124-
plugins {
125-
`maven-publish` apply false
126-
}
127-
128-
subprojects {
129-
apply(plugin = "maven-publish")
130-
configure<PublishingExtension> {
131-
repositories {
132-
maven {
133-
name = "GitHubPackages"
134-
url = uri("https://{% if currentVersion == "free-pro-team@latest" %}maven.pkg.github.com{% else %}<em>REGISTRY-URL</em>{% endif %}/<em>OWNER</em>/<em>REPOSITORY</em>")
135-
credentials {
136-
username = project.findProperty("gpr.user") as String? ?: System.getenv("<em>USERNAME</em>")
137-
password = project.findProperty("gpr.key") as String? ?: System.getenv("<em>TOKEN</em>")
138-
}
139-
}
140-
}
141-
publications {
142-
register<MavenPublication>("gpr") {
143-
from(components["java"])
144-
}
145-
}
146-
}
147-
}
148-
```
149-
150-
#### Authenticating with the `GITHUB_TOKEN`
151-
152-
{% data reusables.package_registry.package-registry-with-github-tokens %}
153-
154-
For more information about using `GITHUB_TOKEN` with Maven, see "[Publishing Java packages with Maven](/actions/language-and-framework-guides/publishing-java-packages-with-maven#publishing-packages-to-github-packages)."
155-
156-
### Publishing a package
157-
158-
{% data reusables.package_registry.default-name %} For example, {% data variables.product.prodname_dotcom %} will publish a package named `com.example.test` in the `OWNER/test` {% data variables.product.prodname_registry %} repository.
159-
160-
{% data reusables.package_registry.viewing-packages %}
161-
162-
{% data reusables.package_registry.authenticate-step %}
163-
2. After creating your package, you can publish the package.
164-
165-
```shell
166-
$ gradle publish
166+
$ gradle publish
167167
```
168168

169169
### Installing a package

0 commit comments

Comments
 (0)