Skip to content

Fix code block markdown in gradle packages doc #264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,50 +120,50 @@ publishing {

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

```shell
plugins {
`maven-publish` apply false
}

subprojects {
apply(plugin = "maven-publish")
configure<PublishingExtension> {
repositories {
maven {
name = "GitHubPackages"
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>")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("<em>USERNAME</em>")
password = project.findProperty("gpr.key") as String? ?: System.getenv("<em>TOKEN</em>")
}
}
}
publications {
register<MavenPublication>("gpr") {
from(components["java"])
}
}
}
}
```

#### Authenticating with the `GITHUB_TOKEN`

{% data reusables.package_registry.package-registry-with-github-tokens %}

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)."

### Publishing a package

{% 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.

{% data reusables.package_registry.viewing-packages %}

{% data reusables.package_registry.authenticate-step %}
2. After creating your package, you can publish the package.

```shell
plugins {
`maven-publish` apply false
}

subprojects {
apply(plugin = "maven-publish")
configure<PublishingExtension> {
repositories {
maven {
name = "GitHubPackages"
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>")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("<em>USERNAME</em>")
password = project.findProperty("gpr.key") as String? ?: System.getenv("<em>TOKEN</em>")
}
}
}
publications {
register<MavenPublication>("gpr") {
from(components["java"])
}
}
}
}
```

#### Authenticating with the `GITHUB_TOKEN`

{% data reusables.package_registry.package-registry-with-github-tokens %}

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)."

### Publishing a package

{% 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.

{% data reusables.package_registry.viewing-packages %}

{% data reusables.package_registry.authenticate-step %}
2. After creating your package, you can publish the package.

```shell
$ gradle publish
$ gradle publish
```

### Installing a package
Expand Down