Skip to content

Commit 07629fa

Browse files
committed
Update for Maven Central changes
1 parent a2ec539 commit 07629fa

File tree

6 files changed

+39
-7
lines changed

6 files changed

+39
-7
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
}
1010

1111
group = "net.kyori"
12-
version = "3.1.4-SNAPSHOT"
12+
version = "3.2.0-SNAPSHOT"
1313
description = "KyoriPowered organizational build standards and utilities"
1414

1515
subprojects {

indra-common/src/main/java/net/kyori/indra/internal/SonatypeRepositoriesImpl.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* This file is part of indra, licensed under the MIT License.
33
*
4-
* Copyright (c) 2020-2022 KyoriPowered
4+
* Copyright (c) 2020-2025 KyoriPowered
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -38,6 +38,15 @@ public SonatypeRepositoriesImpl(final RepositoryHandler repositories) {
3838
this.repositories = repositories;
3939
}
4040

41+
@Override
42+
public MavenArtifactRepository snapshots() {
43+
return this.repositories.maven(repo -> {
44+
repo.setName("sonatypeSnapshots");
45+
repo.setUrl("https://central.sonatype.com/repository/maven-snapshots/");
46+
repo.mavenContent(MavenRepositoryContentDescriptor::snapshotsOnly);
47+
});
48+
}
49+
4150
@Override
4251
public MavenArtifactRepository ossSnapshots() {
4352
return this.repositories.maven(repo -> {

indra-common/src/main/java/net/kyori/indra/repository/SonatypeRepositories.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* This file is part of indra, licensed under the MIT License.
33
*
4-
* Copyright (c) 2020-2022 KyoriPowered
4+
* Copyright (c) 2020-2025 KyoriPowered
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -34,14 +34,26 @@
3434
public interface SonatypeRepositories {
3535
String EXTENSION_NAME = "sonatype";
3636

37+
/**
38+
* Add the Sonatype snapshot repository to this project.
39+
*
40+
* <p>The URL for this repository is {@literal https://central.sonatype.com/repository/maven-snapshots/}.</p>
41+
*
42+
* @return the created repository
43+
* @since 3.2.0
44+
*/
45+
MavenArtifactRepository snapshots();
46+
3747
/**
3848
* Add the Sonatype OSS snapshot repository to this project.
3949
*
4050
* <p>The URL for this repository is {@literal https://oss.sonatype.org/content/repositories/snapshots/}.</p>
4151
*
4252
* @return the created repository
4353
* @since 2.1.0
54+
* @deprecated replaced by {@link #snapshots()} due to the new Central publishing system
4455
*/
56+
@Deprecated
4557
MavenArtifactRepository ossSnapshots();
4658

4759
/**
@@ -51,7 +63,9 @@ public interface SonatypeRepositories {
5163
*
5264
* @return the created repository
5365
* @since 2.1.0
66+
* @deprecated replaced by {@link #snapshots()} due to the new Central publishing system
5467
*/
68+
@Deprecated
5569
default MavenArtifactRepository s01Snapshots() {
5670
return this.snapshotsOn(1);
5771
}
@@ -66,6 +80,8 @@ default MavenArtifactRepository s01Snapshots() {
6680
* @param host the host number
6781
* @return the created repository
6882
* @since 2.1.0
83+
* @deprecated replaced by {@link #snapshots()} due to the new Central publishing system
6984
*/
85+
@Deprecated
7086
MavenArtifactRepository snapshotsOn(int host);
7187
}

indra-publishing-sonatype/src/main/java/net/kyori/indra/sonatype/IndraSonatypePublishingExtension.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* This file is part of indra, licensed under the MIT License.
33
*
4-
* Copyright (c) 2020-2022 KyoriPowered
4+
* Copyright (c) 2020-2025 KyoriPowered
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -34,6 +34,8 @@ public interface IndraSonatypePublishingExtension {
3434
*
3535
* @param name the prefix to use -- for example, to use {@code s01.oss.sonatype.org}, the name should be {@code s01}
3636
* @since 2.0.0
37+
* @deprecated No longer relevant with the new Central publishing system
3738
*/
39+
@Deprecated
3840
void useAlternateSonatypeOSSHost(final String name);
3941
}

indra-publishing-sonatype/src/main/java/net/kyori/indra/sonatype/IndraSonatypePublishingPlugin.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* This file is part of indra, licensed under the MIT License.
33
*
4-
* Copyright (c) 2020-2022 KyoriPowered
4+
* Copyright (c) 2020-2025 KyoriPowered
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -25,6 +25,7 @@
2525

2626
import io.github.gradlenexus.publishplugin.NexusPublishExtension;
2727
import io.github.gradlenexus.publishplugin.NexusPublishPlugin;
28+
import java.net.URI;
2829
import java.time.Duration;
2930
import net.kyori.indra.IndraPlugin;
3031
import net.kyori.indra.IndraPublishingPlugin;
@@ -52,7 +53,10 @@ public void apply(final @NotNull Project project, final @NotNull PluginContainer
5253
plugins.apply(NexusPublishPlugin.class);
5354

5455
extensions.configure(NexusPublishExtension.class, extension -> {
55-
extension.getRepositories().sonatype();
56+
extension.getRepositories().sonatype(repo -> {
57+
repo.getNexusUrl().set(URI.create("https://ossrh-staging-api.central.sonatype.com/service/local/"));
58+
repo.getSnapshotRepositoryUrl().set(URI.create("https://central.sonatype.com/repository/maven-snapshots/"));
59+
});
5660

5761
// Bump out timeouts for days when OSSRH is slow
5862
extension.getClientTimeout().set(Duration.ofMinutes(5));

indra-publishing-sonatype/src/main/java/net/kyori/indra/sonatype/internal/IndraSonatypePublishingExtensionImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* This file is part of indra, licensed under the MIT License.
33
*
4-
* Copyright (c) 2020-2022 KyoriPowered
4+
* Copyright (c) 2020-2025 KyoriPowered
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -39,6 +39,7 @@ public IndraSonatypePublishingExtensionImpl(final NexusPublishExtension nexusExt
3939
this.nexusExtension = nexusExtension;
4040
}
4141

42+
@Deprecated
4243
@Override
4344
public void useAlternateSonatypeOSSHost(final String name) {
4445
final NexusRepository repo = this.nexusExtension.getRepositories().maybeCreate(SONATYPE_REPO);

0 commit comments

Comments
 (0)