Skip to content

Commit c272389

Browse files
authored
repo sync
2 parents 218b894 + 7616cab commit c272389

2 files changed

Lines changed: 33 additions & 11 deletions

File tree

content/packages/guides/configuring-apache-maven-for-use-with-github-packages.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ You can authenticate to {% data variables.product.prodname_registry %} with Apac
3030

3131
In the `servers` tag, add a child `server` tag with an `id`, replacing *USERNAME* with your {% data variables.product.prodname_dotcom %} username, and *TOKEN* with your personal access token.
3232

33-
In the `repositories` tag, configure a repository by mapping the `id` of the repository to the `id` you added in the `server` tag containing your credentials. Replace {% if enterpriseServerVersions contains currentVersion or currentVersion == "github-ae@latest" %}*HOSTNAME* with the host name of {% data variables.product.product_location %}, {% endif %}*REPOSITORY* with the name of the repository you'd like to publish a package to or install a package from, and *OWNER* with the name of the user or organization account that owns the repository. Because uppercase letters aren't supported, you must use lowercase letters for the repository owner even if the {% data variables.product.prodname_dotcom %} user or organization name contains uppercase letters.
33+
In the `repositories` tag, configure a repository by mapping the `id` of the repository to the `id` you added in the `server` tag containing your credentials. Replace {% if enterpriseServerVersions contains currentVersion or currentVersion == "github-ae@latest" %}*HOSTNAME* with the host name of {% data variables.product.product_location %}, {% endif %}, and *OWNER* with the name of the user or organization account that owns the repository. Because uppercase letters aren't supported, you must use lowercase letters for the repository owner even if the {% data variables.product.prodname_dotcom %} user or organization name contains uppercase letters.
3434

3535
If you want to interact with multiple repositories, you can add each repository to separate `repository` children in the `repositories` tag, mapping the `id` of each to the credentials in the `servers` tag.
3636

@@ -134,10 +134,9 @@ If you would like to publish multiple packages to the same repository, you can i
134134

135135
For more information on creating a package, see the [maven.apache.org documentation](https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html).
136136

137-
1. Edit the `distributionManagement` element of the *pom.xml* file located in your package directory, replacing {% if enterpriseServerVersions contains currentVersion or currentVersion == "github-ae@latest" %}*HOSTNAME* with the host name of {% data variables.product.product_location %}, {% endif %}`OWNER` with the name of the user or organization account that owns the repository and `REPOSITORY` with the name of the repository containing your project.
138-
{% if enterpriseServerVersions contains currentVersion %}
139-
If your instance has subdomain isolation enabled:
140-
{% endif %}
137+
1. Edit the `distributionManagement` element of the *pom.xml* file located in your package directory, replacing {% if enterpriseServerVersions contains currentVersion or currentVersion == "github-ae@latest" %}*HOSTNAME* with the host name of {% data variables.product.product_location %}, {% endif %}`OWNER` with the name of the user or organization account that owns the repository and `REPOSITORY` with the name of the repository containing your project.{% if enterpriseServerVersions contains currentVersion %}
138+
139+
If your instance has subdomain isolation enabled:{% endif %}
141140
```xml
142141
<distributionManagement>
143142
<repository>
@@ -146,8 +145,7 @@ For more information on creating a package, see the [maven.apache.org documentat
146145
<url>https://{% if currentVersion == "free-pro-team@latest" %}maven.pkg.github.com{% else %}maven.HOSTNAME{% endif %}/OWNER/REPOSITORY</url>
147146
</repository>
148147
</distributionManagement>
149-
```
150-
{% if enterpriseServerVersions contains currentVersion %}
148+
```{% if enterpriseServerVersions contains currentVersion %}
151149
If your instance has subdomain isolation disabled:
152150
```xml
153151
<distributionManagement>
@@ -157,10 +155,9 @@ For more information on creating a package, see the [maven.apache.org documentat
157155
<url>https://HOSTNAME/_registry/maven/OWNER/REPOSITORY</url>
158156
</repository>
159157
</distributionManagement>
160-
```
161-
{% endif %}
162-
2. Publish the package.
163-
158+
```{% endif %}
159+
{% data reusables.package_registry.checksum-maven-plugin %}
160+
1. Publish the package.
164161
```shell
165162
$ mvn deploy
166163
```
@@ -183,6 +180,7 @@ To install an Apache Maven package from {% data variables.product.prodname_regis
183180
</dependency>
184181
</dependencies>
185182
```
183+
{% data reusables.package_registry.checksum-maven-plugin %}
186184
3. Install the package.
187185

188186
```shell
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{%- if currentVersion == "github-ae@latest" %}
2+
1. In the `plugins` element of the *pom.xml* file, add the [checksum-maven-plugin](http://checksum-maven-plugin.nicoulaj.net/index.html) plugin, and configure the plugin to send at least SHA-256 checksums.
3+
```xml
4+
<plugins>
5+
<plugin>
6+
<groupId>net.nicoulaj.maven.plugins</groupId>
7+
<artifactId>checksum-maven-plugin</artifactId>
8+
<version>1.9</version>
9+
<executions>
10+
<execution>
11+
<goals>
12+
<goal>artifacts</goal>
13+
</goals>
14+
</execution>
15+
</executions>
16+
<configuration>
17+
<algorithms>
18+
<algorithm>SHA-256</algorithm>
19+
</algorithms>
20+
</configuration>
21+
</plugin>
22+
</plugins>
23+
```
24+
{%- endif %}

0 commit comments

Comments
 (0)