Skip to content

Commit 90ab8f7

Browse files
committed
ci(maven): extend settings.xml with GitHub Packages support
Add GitHub repository-specific deployment configuration and enable resolving from GitHub Packages. Update Sonatype repository property names for consistency.
1 parent e3aff1a commit 90ab8f7

1 file changed

Lines changed: 41 additions & 6 deletions

File tree

.mvn/settings.xml

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
<username>__SERVER_USERNAME__</username>
1212
<password>__SERVER_PASSWORD__</password>
1313
</server>
14+
<!-- GitHub Packages server: uses GitHub Actions default env vars -->
15+
<server>
16+
<id>github</id>
17+
<!-- In GitHub Actions, these env vars are available by default -->
18+
<username>${env.GITHUB_ACTOR}</username>
19+
<password>${env.GITHUB_TOKEN}</password>
20+
</server>
1421
</servers>
1522

1623
<profiles>
@@ -19,12 +26,15 @@
1926
<properties>
2027
<!-- Speed up snapshot updates in CI -->
2128
<maven.wagon.http.pool>false</maven.wagon.http.pool>
22-
<altSnapshotDeploymentRepository>
23-
snapshots-repo::default::https://central.sonatype.com/repository/maven-snapshots/
24-
</altSnapshotDeploymentRepository>
25-
<altDeploymentRepository>
26-
releases-repo::default::https://central.sonatype.com/repository/maven-releases/
27-
</altDeploymentRepository>
29+
<mavenAltSnapshotDeploymentRepository>
30+
maven-snapshots-repo::default::https://central.sonatype.com/repository/maven-snapshots/
31+
</mavenAltSnapshotDeploymentRepository>
32+
<mavenAltDeploymentRepository>
33+
maven-releases-repo::default::https://central.sonatype.com/repository/maven-releases/
34+
</mavenAltDeploymentRepository>
35+
<spectrayanDeploymentRepository>
36+
spectrayan-repo::default::https://maven.pkg.github.com/spectrayan/spectrayan/
37+
</spectrayanDeploymentRepository>
2838
</properties>
2939
<repositories>
3040
<repository>
@@ -36,6 +46,19 @@
3646
<snapshots>
3747
<enabled>false</enabled>
3848
</snapshots>
49+
</repository>
50+
<!-- GitHub Packages: resolves from the current repository's package registry -->
51+
<repository>
52+
<id>github</id>
53+
<name>GitHub Packages</name>
54+
<!-- Uses GitHub Actions env var GITHUB_REPOSITORY = owner/repo -->
55+
<url>https://maven.pkg.github.com/spectrayan/spectrayan</url>
56+
<releases>
57+
<enabled>true</enabled>
58+
</releases>
59+
<snapshots>
60+
<enabled>true</enabled>
61+
</snapshots>
3962
</repository>
4063
<repository>
4164
<name>Central Portal Snapshots</name>
@@ -60,6 +83,18 @@
6083
<enabled>false</enabled>
6184
</snapshots>
6285
</pluginRepository>
86+
<!-- Allow plugins to also be resolved from GitHub Packages when needed -->
87+
<pluginRepository>
88+
<id>github</id>
89+
<name>GitHub Packages</name>
90+
<url>https://maven.pkg.github.com/spectrayan/spectrayan</url>
91+
<releases>
92+
<enabled>true</enabled>
93+
</releases>
94+
<snapshots>
95+
<enabled>true</enabled>
96+
</snapshots>
97+
</pluginRepository>
6398
</pluginRepositories>
6499
</profile>
65100
</profiles>

0 commit comments

Comments
 (0)