Skip to content

Commit 44092a1

Browse files
committed
Remove sonatype methods deprecated in 3.2.0
1 parent 15150c1 commit 44092a1

File tree

8 files changed

+6
-102
lines changed

8 files changed

+6
-102
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ subprojects {
9090
importOrderFile rootProject.file('.spotless/kyori.importorder')
9191
trimTrailingWhitespace()
9292
endWithNewline()
93-
indentWithSpaces(2)
93+
leadingTabsToSpaces(2)
9494
}
9595
}
9696
}

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,6 @@ public MavenArtifactRepository snapshots() {
4747
});
4848
}
4949

50-
@Override
51-
public MavenArtifactRepository ossSnapshots() {
52-
return this.repositories.maven(repo -> {
53-
repo.setName("sonatypeSnapshots");
54-
repo.setUrl("https://oss.sonatype.org/content/repositories/snapshots/");
55-
repo.mavenContent(MavenRepositoryContentDescriptor::snapshotsOnly);
56-
});
57-
}
58-
59-
@Override
60-
public MavenArtifactRepository snapshotsOn(final int host) {
61-
return this.repositories.maven(repo -> {
62-
repo.setName("sonatypeSnapshots");
63-
repo.setUrl(formatOssHost(host));
64-
repo.mavenContent(MavenRepositoryContentDescriptor::snapshotsOnly);
65-
});
66-
}
67-
6850
static String formatOssHost(final int host) {
6951
if (host < 1) {
7052
throw new IllegalArgumentException("Only hosts numbered >= 1 are supported, but " + host + " was provided");

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

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -43,45 +43,4 @@ public interface SonatypeRepositories {
4343
* @since 3.2.0
4444
*/
4545
MavenArtifactRepository snapshots();
46-
47-
/**
48-
* Add the Sonatype OSS snapshot repository to this project.
49-
*
50-
* <p>The URL for this repository is {@literal https://oss.sonatype.org/content/repositories/snapshots/}.</p>
51-
*
52-
* @return the created repository
53-
* @since 2.1.0
54-
* @deprecated replaced by {@link #snapshots()} due to the new Central publishing system
55-
*/
56-
@Deprecated
57-
MavenArtifactRepository ossSnapshots();
58-
59-
/**
60-
* Add the new Sonatype OSS snapshot repository to this project.
61-
*
62-
* <p>The URL for this repository is {@literal https://s01.oss.sonatype.org/content/repositories/snapshots/}.</p>
63-
*
64-
* @return the created repository
65-
* @since 2.1.0
66-
* @deprecated replaced by {@link #snapshots()} due to the new Central publishing system
67-
*/
68-
@Deprecated
69-
default MavenArtifactRepository s01Snapshots() {
70-
return this.snapshotsOn(1);
71-
}
72-
73-
/**
74-
* Add a specific numbered Sonatype OSS snapshots host to this project.
75-
*
76-
* <p>The URL for this repository is {@code https://s<host>.oss.sonatype.org/content/repositories/snapshots/}.</p>
77-
*
78-
* <p>As of this writing, only one host exists -- {@code s01}.</p>
79-
*
80-
* @param host the host number
81-
* @return the created repository
82-
* @since 2.1.0
83-
* @deprecated replaced by {@link #snapshots()} due to the new Central publishing system
84-
*/
85-
@Deprecated
86-
MavenArtifactRepository snapshotsOn(int host);
8746
}

indra-common/src/test/resources/net/kyori/indra/javac8Build/in/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ group 'com.example'
66
version '1.0.0-SNAPSHOT'
77

88
repositories {
9-
sonatype.ossSnapshots()
10-
sonatype.s01Snapshots()
9+
sonatype.snapshots()
1110
}
1211

1312
indra {

indra-common/src/test/resources/net/kyori/indra/kotlinBuildscript/in/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ group = "com.example"
66
version = "1.0.0-SNAPSHOT"
77

88
repositories {
9-
sonatype.ossSnapshots()
9+
sonatype.snapshots()
1010
}
1111

1212
sourceSets {

indra-common/src/test/resources/net/kyori/indra/simpleBuild/in/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ group 'com.example'
66
version '1.0.0-SNAPSHOT'
77

88
repositories {
9-
sonatype.ossSnapshots()
10-
sonatype.s01Snapshots()
9+
sonatype.snapshots()
1110
}
1211

1312
indra {
@@ -16,4 +15,4 @@ indra {
1615
publishing true
1716
}
1817
mitLicense()
19-
}
18+
}

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,5 @@
2929
* @since 2.0.0
3030
*/
3131
public interface IndraSonatypePublishingExtension {
32-
/**
33-
* Use an alternate host for the Sonatype OSSRH.
34-
*
35-
* @param name the prefix to use -- for example, to use {@code s01.oss.sonatype.org}, the name should be {@code s01}
36-
* @since 2.0.0
37-
* @deprecated No longer relevant with the new Central publishing system
38-
*/
39-
@Deprecated
40-
void useAlternateSonatypeOSSHost(final String name);
32+
4133
}

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

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,39 +24,12 @@
2424
package net.kyori.indra.sonatype.internal;
2525

2626
import io.github.gradlenexus.publishplugin.NexusPublishExtension;
27-
import io.github.gradlenexus.publishplugin.NexusRepository;
28-
import java.net.URI;
2927
import javax.inject.Inject;
3028
import net.kyori.indra.sonatype.IndraSonatypePublishingExtension;
3129

3230
public class IndraSonatypePublishingExtensionImpl implements IndraSonatypePublishingExtension {
33-
private static final String SONATYPE_REPO = "sonatype";
34-
35-
private final NexusPublishExtension nexusExtension;
3631

3732
@Inject
3833
public IndraSonatypePublishingExtensionImpl(final NexusPublishExtension nexusExtension) {
39-
this.nexusExtension = nexusExtension;
40-
}
41-
42-
@Deprecated
43-
@Override
44-
public void useAlternateSonatypeOSSHost(final String name) {
45-
final NexusRepository repo = this.nexusExtension.getRepositories().maybeCreate(SONATYPE_REPO);
46-
47-
repo.getNexusUrl().set(this.nexusUrl(name));
48-
repo.getSnapshotRepositoryUrl().set(this.snapshotUrl(name));
49-
}
50-
51-
private String domain(final String prefix) {
52-
return String.format("https://%soss.sonatype.org/", prefix == null || prefix.isEmpty() ? "" : prefix + '.');
53-
}
54-
55-
private URI nexusUrl(final String prefix) {
56-
return URI.create(this.domain(prefix) + "service/local/");
57-
}
58-
59-
private URI snapshotUrl(final String prefix) {
60-
return URI.create(this.domain(prefix) + "content/repositories/snapshots/");
6134
}
6235
}

0 commit comments

Comments
 (0)