diff --git a/.idea/libraries/bld.xml b/.idea/libraries/bld.xml index a203de8..fd3f0d0 100644 --- a/.idea/libraries/bld.xml +++ b/.idea/libraries/bld.xml @@ -2,12 +2,12 @@ - + - + diff --git a/README.md b/README.md index a603afc..0524535 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![bld](https://img.shields.io/badge/2.2.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld) [![Release](https://img.shields.io/github/release/rife2/bld.svg)](https://github.com/rife2/bld/releases/latest) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.uwyn.rife2/bld/badge.svg?color=blue)](https://maven-badges.herokuapp.com/maven-central/com.uwyn.rife2/bld) -[![Nexus Snapshot](https://img.shields.io/nexus/s/com.uwyn.rife2/bld?server=https%3A%2F%2Fs01.oss.sonatype.org%2F)](https://s01.oss.sonatype.org/content/repositories/snapshots/com/uwyn/rife2/bld/) +[![Nexus Snapshot](https://img.shields.io/nexus/s/com.uwyn.rife2/bld?server=https%3A%2F%2Fcentral.sonatype.com%2F)](https://central.sonatype.com/repository/maven-snapshots/com/uwyn/rife2/bld/) [![gradle-ci](https://github.com/rife2/bld/actions/workflows/bld.yml/badge.svg)](https://github.com/rife2/bld/actions/workflows/bld.yml) [![Tests](https://rife2.com/tests-badge/badge/com.uwyn.rife2/bld)](https://github.com/rife2/rife2/actions/workflows/bld.yml) diff --git a/core b/core index f8bde83..ac900b7 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit f8bde83ca806403dd8f37294239ac77dba8ad010 +Subproject commit ac900b7496ced0a2a38b3ceeba6ad57155e4c508 diff --git a/lib/bld/bld-wrapper.jar b/lib/bld/bld-wrapper.jar index f7ccd28..543dd09 100644 Binary files a/lib/bld/bld-wrapper.jar and b/lib/bld/bld-wrapper.jar differ diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties index 657bddf..07c72b7 100644 --- a/lib/bld/bld-wrapper.properties +++ b/lib/bld/bld-wrapper.properties @@ -8,4 +8,4 @@ bld.javaOptions= bld.javacOptions= bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES bld.sourceDirectories=core/src/bld/java -bld.version=2.2.1 \ No newline at end of file +bld.version=2.2.2-SNAPSHOT \ No newline at end of file diff --git a/src/bld/java/rife/BldBuild.java b/src/bld/java/rife/BldBuild.java index 9dc89af..7a91ebc 100644 --- a/src/bld/java/rife/BldBuild.java +++ b/src/bld/java/rife/BldBuild.java @@ -86,7 +86,7 @@ public class BldBuild extends AbstractRife2Build { publishOperation() .repository(version.isSnapshot() ? repository("rife2-snapshots") : repository("rife2-releases")) - .repository(version.isSnapshot() ? repository("sonatype-snapshots") : repository("sonatype-releases")) + .repository(version.isSnapshot() ? repository("central-snapshots") : repository("central-releases")) .repository(repository("github")) .info(new PublishInfo() .groupId("com.uwyn.rife2") diff --git a/src/main/java/rife/bld/dependencies/Repository.java b/src/main/java/rife/bld/dependencies/Repository.java index 42b020f..55ee6dc 100644 --- a/src/main/java/rife/bld/dependencies/Repository.java +++ b/src/main/java/rife/bld/dependencies/Repository.java @@ -32,6 +32,8 @@ public record Repository(String location, String username, String password) { public static final Repository SONATYPE_RELEASES_LEGACY = new Repository("https://oss.sonatype.org/service/local/staging/deploy/maven2/"); public static final Repository SONATYPE_SNAPSHOTS = new Repository("https://s01.oss.sonatype.org/content/repositories/snapshots/"); public static final Repository SONATYPE_SNAPSHOTS_LEGACY = new Repository("https://oss.sonatype.org/content/repositories/snapshots/"); + public static final Repository CENTRAL_RELEASES = new Repository("https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"); + public static final Repository CENTRAL_SNAPSHOTS = new Repository("https://central.sonatype.com/repository/maven-snapshots/"); public static final Repository RIFE2_RELEASES = new Repository("https://repo.rife2.com/releases/"); public static final Repository RIFE2_SNAPSHOTS = new Repository("https://repo.rife2.com/snapshots/"); @@ -98,6 +100,8 @@ public record Repository(String location, String username, String password) { case "SONATYPE_RELEASES_LEGACY" -> Repository.SONATYPE_RELEASES_LEGACY; case "SONATYPE_SNAPSHOTS" -> Repository.SONATYPE_SNAPSHOTS; case "SONATYPE_SNAPSHOTS_LEGACY" -> Repository.SONATYPE_SNAPSHOTS_LEGACY; + case "CENTRAL_RELEASES" -> Repository.CENTRAL_RELEASES; + case "CENTRAL_SNAPSHOTS" -> Repository.CENTRAL_SNAPSHOTS; default -> new Repository(locationOrName); }; } diff --git a/src/main/java/rife/bld/operations/PublishOperation.java b/src/main/java/rife/bld/operations/PublishOperation.java index a527f65..90040a2 100644 --- a/src/main/java/rife/bld/operations/PublishOperation.java +++ b/src/main/java/rife/bld/operations/PublishOperation.java @@ -133,7 +133,11 @@ public class PublishOperation extends AbstractOperation { var resolution = new VersionResolution(properties()); var resolver = new DependencyResolver(resolution, artifactRetriever(), List.of(repository), new Dependency(info().groupId(), info().artifactId(), info().version())); var snapshot_meta = resolver.getSnapshotMavenMetadata(); - snapshot_build_number = snapshot_meta.getSnapshotBuildNumber() + 1; + var build_number_meta = snapshot_meta.getSnapshotBuildNumber(); + if (build_number_meta == null) { + throw new DependencyException("Snapshot metadata build number doesn't exist."); + } + snapshot_build_number = build_number_meta + 1; } catch (DependencyException e) { // start the build number from the beginning System.out.println("Unable to retrieve previous snapshot metadata, using first build number."); @@ -161,7 +165,7 @@ public class PublishOperation extends AbstractOperation { .info(info()) .updated(moment) .build(), - info().version() + "/" + repository.getMetadataName(), true); + info().version() + "/" + repository.getMetadataName(), false); return actual_version; } @@ -493,9 +497,7 @@ public class PublishOperation extends AbstractOperation { response.statusCode() < 300) { System.out.print("done"); } else { - System.out.println("failed"); - System.out.println(response.body()); - System.out.print(response.headers().toString()); + System.out.print("failed"); throw new UploadException(url, response.statusCode()); } } finally { diff --git a/src/main/java/rife/bld/wrapper/Wrapper.java b/src/main/java/rife/bld/wrapper/Wrapper.java index 4185020..3164b5d 100644 --- a/src/main/java/rife/bld/wrapper/Wrapper.java +++ b/src/main/java/rife/bld/wrapper/Wrapper.java @@ -45,9 +45,9 @@ public class Wrapper { public static final String WRAPPER_PROPERTIES = WRAPPER_PREFIX + ".properties"; static final String MAVEN_CENTRAL = "https://repo1.maven.org/maven2/"; - static final String SONATYPE_SNAPSHOTS = "https://s01.oss.sonatype.org/content/repositories/snapshots/"; + static final String CENTRAL_SNAPSHOTS = "https://central.sonatype.com/repository/maven-snapshots/"; static final String DOWNLOAD_LOCATION = MAVEN_CENTRAL + "com/uwyn/rife2/bld/${version}/"; - static final String DOWNLOAD_LOCATION_SNAPSHOT = SONATYPE_SNAPSHOTS + "com/uwyn/rife2/bld/${version}/"; + static final String DOWNLOAD_LOCATION_SNAPSHOT = CENTRAL_SNAPSHOTS + "com/uwyn/rife2/bld/${version}/"; static final String BLD_CACHE = "bld.cache"; static final String BLD_FILENAME = "bld-${version}.jar"; static final String BLD_SOURCES_FILENAME = "bld-${version}-sources.jar";