You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge upgrade branch: Sonatype Central Portal migration
Merge upgrade branch with complete Sonatype Central Portal migration:
- Upgrade to Gradle 7.6.4 with updated dependencies
- Migrate publishing to Central Portal with gradle-nexus plugin 2.0.0
- Add CLAUDE.md documentation
This brings full Central Portal support with JDK 11+ build requirement
while maintaining Java 8 compatibility for plugin users.
@@ -4,110 +4,143 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
5
5
## Project Overview
6
6
7
-
This is a Gradle settings plugin that enables build caching with a Hazelcast node as the backend. The plugin implements Gradle's BuildCacheService interface using Hazelcast's distributed map as storage.
8
-
9
-
**Key characteristics:**
10
-
- Settings plugin (not a project plugin) - applied in `settings.gradle`, not `build.gradle`
11
-
- Disables local cache by default since Hazelcast serves as both local and remote cache
12
-
- Supports multiple Hazelcast hosts via comma-separated host list
13
-
- Uses Hazelcast client (not embedded node) to connect to external Hazelcast cluster
7
+
This is a Gradle settings plugin that enables build caching using Hazelcast as the cache backend. The plugin allows Gradle builds to store and retrieve task outputs from a distributed Hazelcast cluster, speeding up builds across multiple machines or build agents.
14
8
15
9
## Build Commands
16
10
17
11
```bash
18
12
# Build the plugin
19
13
./gradlew build
20
14
21
-
# Run tests (includes integration tests with embedded Hazelcast)
15
+
# Run tests
22
16
./gradlew test
23
17
24
-
# Run single test class
25
-
./gradlew test --tests "IntegrationTest"
26
-
27
-
# Run single test method
28
-
./gradlew test --tests "IntegrationTest.no task is re-executed when inputs are unchanged"
18
+
# Clean build artifacts
19
+
./gradlew clean
29
20
30
-
# Check for dependency vulnerabilities
21
+
# Check for dependency vulnerabilities (OWASP)
31
22
./gradlew dependencyCheckAnalyze
32
23
33
24
# Check for dependency updates
34
-
./gradlew dependenceUpdates
25
+
./gradlew dependenceiesUpdates
26
+
```
35
27
36
-
# Publish to local Maven repo
28
+
## Publishing Commands
29
+
30
+
```bash
31
+
# Publish to local Maven repository for testing
37
32
./gradlew publishToMavenLocal
38
33
39
-
# Release (tags, publishes to Sonatype)
40
-
./gradlew release
34
+
# Release workflow (requires credentials and JDK 11+)
35
+
./gradlew release # This creates a git tag, publishes, and closes the staging repository
36
+
37
+
# Publish manually to Central Portal (for testing)
38
+
./gradlew publishToSonatype
39
+
40
+
# Close staging repository (after publishToSonatype)
41
+
./gradlew closeSonatypeStagingRepository
42
+
43
+
# Release to Maven Central (manually after closing - requires separate invocation)
The release process is automated using the `net.researchgate.release` plugin. After release, the `afterReleaseBuild` task automatically publishes and closes the staging repository using gradle-nexus/publish-plugin 2.0.0. You must then manually release via the Portal UI at [central.sonatype.com/publishing/deployments](https://central.sonatype.com/publishing/deployments) or run `releaseSonatypeStagingRepository` separately.
- The `host` property supports comma-separated values for multiple Hazelcast nodes
60
68
61
-
3.**HazelcastBuildCacheServiceFactory** (inner class in HazelcastPlugin)
62
-
- Creates Hazelcast client with configured addresses (host:port)
63
-
- Returns `MapBasedBuildCacheService` using Hazelcast's distributed map
64
-
- Gradle's `MapBasedBuildCacheService` handles serialization and key-value storage
69
+
### Key Design Decisions
65
70
66
-
### Test Structure
71
+
1.**Settings Plugin**: This is a settings plugin (not a project plugin), so it's applied in `settings.gradle` rather than `build.gradle`. This is required because build cache configuration happens at settings evaluation time.
67
72
68
-
-**IntegrationTest.groovy**: Spock integration tests using GradleRunner
69
-
-**HazelcastService.java**: JUnit rule that starts/stops embedded Hazelcast for tests
- Uses custom port (5710) to avoid conflicts with running Hazelcast instances
73
+
2.**MapBasedBuildCacheService**: The plugin leverages Gradle's built-in `MapBasedBuildCacheService` which wraps any `java.util.Map` implementation. The Hazelcast `IMap` is a distributed map that naturally fits this pattern.
72
74
73
-
## Project Configuration
75
+
3.**Client Connection**: Uses Hazelcast client mode (not embedded), connecting to an external Hazelcast cluster. The connection is established once per build when the factory creates the service.
-**Hazelcast 3.10.2** (client and full distribution for tests)
77
+
4.**Multiple Hosts**: The factory parses the comma-separated host list and appends the port to each host address before configuring the Hazelcast client's network config.
79
78
80
-
## Publishing
79
+
## Testing
81
80
82
-
The plugin publishes to:
83
-
1.**Gradle Plugin Portal** (via `repo.gradle.org/gradle` with Artifactory)
84
-
2.**Maven Central** (via Central Portal at `central.sonatype.com`)
Credentials are sourced from (in order of precedence):
123
+
1. Gradle properties in `~/.gradle/gradle.properties`:
124
+
-`sonatypeUsername` - User token username from central.sonatype.com/account
125
+
-`sonatypePassword` - User token password from central.sonatype.com/account
126
+
2. Environment variables:
127
+
-`ORG_GRADLE_PROJECT_sonatypeUsername`
128
+
-`ORG_GRADLE_PROJECT_sonatypePassword`
129
+
130
+
**Important**: Central Portal tokens are different from legacy OSSRH tokens. Generate new tokens at https://central.sonatype.com/account
131
+
132
+
### Publication Artifacts
133
+
134
+
Artifacts include:
135
+
- Main JAR (from Java component)
136
+
- Sources JAR
137
+
- Javadoc JAR
104
138
105
-
Note: OSSRH (oss.sonatype.org) was shut down on June 30, 2025. All publishing now goes through Central Portal.
139
+
Signing is required only for release versions (non-SNAPSHOT).
106
140
107
-
##Important Implementation Details
141
+
### Migration Notes
108
142
109
-
- Plugin must be applied in `settings.gradle` (not `build.gradle`) because it configures build cache during settings evaluation
110
-
- Hazelcast client connection is created once per build, map name identifies the cache
111
-
- Multiple hosts support allows failover: "host1,host2,host3" all use same port
112
-
- MapBasedBuildCacheService is Gradle's built-in implementation - we just provide the Map
113
-
- Local cache disabled to avoid double-caching (Hazelcast already provides fast access)
143
+
This project has been migrated from the legacy OSSRH system to Sonatype Central Portal (as of 2025). The OSSRH service was sunset on June 30, 2025. Key changes:
144
+
- New authentication tokens required from central.sonatype.com
145
+
- Publishing workflow now uses staging repositories with explicit close/release steps
146
+
- Publication timeline: ~15 minutes after release for artifacts to appear on Maven Central
0 commit comments