Skip to content

Enhance Maven workflow and update dependencies for compatibility#107

Merged
mercyblitz merged 26 commits intorelease-1.xfrom
dev-1.x
Apr 28, 2026
Merged

Enhance Maven workflow and update dependencies for compatibility#107
mercyblitz merged 26 commits intorelease-1.xfrom
dev-1.x

Conversation

@mercyblitz
Copy link
Copy Markdown
Contributor

This pull request introduces several improvements and updates across the build, release workflow, documentation, and core modules. The most notable changes include enhancements to the Maven build and publish workflows (including automated release notes generation with Copilot), dependency and compatibility updates, and minor codebase and documentation refinements.

Build and Release Workflow Enhancements:

  • Added explicit permissions settings to the .github/workflows/maven-build.yml and .github/workflows/maven-publish.yml files to adhere to GitHub Actions best practices. [1] [2]
  • Increased the max-parallel build matrix concurrency to 7 in the Maven build workflow for faster CI execution.
  • Automated release notes generation in the Maven publish workflow using GitHub Copilot, which summarizes commits since the previous release and appends the notes to release-notes.md. This summary is then used for GitHub Releases.
  • Updated the Maven publish workflow to commit both pom.xml and release-notes.md after publishing, ensuring release notes are tracked in version control.
  • Added models: read permission to the release job for secure access to Copilot Models API.

Dependency and Compatibility Updates:

  • Updated Maven wrapper to use Maven 3.9.15 from Maven Central, replacing the previous Aliyun mirror and older version.
  • Bumped microsphere-spring.version property in the parent POM to 0.1.14 for dependency alignment.
  • Updated documentation and dependency tables to reflect the latest released versions (0.2.11 and 0.1.11).

Codebase and Configuration Improvements:

  • Refactored ActuatorAutoConfiguration to use a string-based conditional bean check for MeterRegistry, improving compatibility across Spring Boot versions and removing a direct dependency on the class. [1] [2] [3]
  • Updated related tests to cover the new constant and ensure strong type checking for the MeterRegistry class name. [1] [2] [3] [4] [5]
  • Changed the method for determining the current Spring Boot version in SpringBootVersion to use ofVersion, improving accuracy and maintainability. [1] [2]
  • Simplified property setting in SpringApplicationUtilsTest for clarity.
  • Removed unnecessary test dependency exclusions in microsphere-spring-boot-core/pom.xml for cleaner configuration.

Documentation and Readability:

  • Improved formatting and clarity in README.md, including breaking long lines, removing extra blank lines, and updating instructions for new versions. [1] [2] [3]

Minor Cleanups:

  • Minor whitespace and formatting adjustments in POM files for consistency. [1] [2] [3]

github-actions Bot and others added 25 commits April 8, 2026 12:34
Add a <repositories> section to microsphere-spring-boot-parent/pom.xml registering the Spring Portfolio milestone repository (id: spring-milestone, url: https://repo.spring.io/milestone). This enables resolving Spring milestone artifacts from the parent POM.
Update maven-publish workflow to generate release notes via a Copilot/Models API step. Adds limited permissions (contents: read for build and models: read for the publish job), a Python-based step that collects commits since the previous tag, calls the model to produce concise markdown release notes, appends them to release-notes.md and writes /tmp/current-release-notes.md for the release step. The Create Release step now uses --notes-file and the job also stages release-notes.md so it gets committed after publishing.
Avoid a direct compile-time dependency on Micrometer by replacing @ConditionalOnBean(MeterRegistry.class) with @ConditionalOnBean(type = METER_REGISTRY_CLASS_NAME). Added a string constant METER_REGISTRY_CLASS_NAME (with javadoc) and removed the MeterRegistry import so the conditional is resolved by class name at runtime.
Import MeterRegistry and add assertions in ActuatorAutoConfigurationTest to verify the METER_REGISTRY_CLASS_NAME constant equals the expected fully-qualified name ("io.micrometer.core.instrument.MeterRegistry") and matches MeterRegistry.class.getName(). This strengthens the test by ensuring the constant correctly references the MeterRegistry class name.
Update README: bump branch table versions for 0.2.x and 0.1.x to 0.2.11 and 0.1.11, respectively. Apply minor formatting fixes (adjust blank lines around badges and code blocks, and wrap the 'Before you log a bug' line) to improve readability.
Delete the <repositories> section from microsphere-spring-boot-parent/pom.xml, removing the spring-milestone repository entry (id: spring-milestone, url: https://repo.spring.io/milestone). This cleans up the parent POM to avoid relying on the Spring milestone repository during builds.
Remove the `permissions: contents: read` block from the build job in the maven-publish workflow. This simplifies the workflow by relying on repository/default permissions instead of an explicit read permission; no other functional changes were made.
Add explicit GitHub Actions permissions block to the Maven workflow, granting read-only access to repository contents. This limits the workflow's token scope and ensures the job has the necessary read access for checkout and related steps.
Give the build job read access to repo contents and improve release notes generation. The AI prompt was expanded to include more structured sections (New Features, Bug Fixes, Documentations, Dependency Updates, Test Improvements, Build and Workflow Enhancements, Other Changes). A Full Changelog link is now generated and appended to the repository NOTES file and the temporary release notes file. Also normalize newlines and use the raw inputs.revision (no implicit "v" prefix) when checking/creating GitHub releases, plus small whitespace/end-of-file fixes.
Change .mvn/wrapper/maven-wrapper.properties to point to Apache's official distribution URL and upgrade the Maven binary from 3.9.9 to 3.9.14 (dlcdn.apache.org). This ensures the wrapper fetches the official Apache Maven 3.9.14 release instead of the previous mirror.
Update the parent POM version from 0.2.6 to 0.2.7 to pick up the latest changes from io.github.microsphere-projects:microsphere-build (build fixes/dependency updates).
Update the <microsphere-spring.version> property in the parent POM from 0.1.9 to 0.1.11 so child modules use the newer microsphere-spring release.
Bump Maven distribution from 3.9.14 to 3.9.15 and update the wrapper distributionUrl to use the Maven Aliyun mirror in .mvn/wrapper/maven-wrapper.properties. This ensures the project uses Maven 3.9.15 and can fetch the binary from an alternate mirror.
Update .mvn/wrapper/maven-wrapper.properties to point distributionUrl to repo1.maven.org (Maven Central) instead of the previous aliyun mirror. Ensures the Maven wrapper downloads the official Apache Maven distribution from Maven Central.
Reduce the GitHub Actions build matrix to Java 8 and 11 and add strategy.max-parallel: 7 to cap concurrent jobs. This lowers CI resource usage and shortens run time by removing additional Java versions and limiting parallelism.
Update microsphere-spring.version in microsphere-spring-boot-parent/pom.xml from 0.1.11 to 0.1.13 to pick up the latest microsphere-spring fixes and improvements.
Delete exclusion entries for org.apache.zookeeper:zookeeper and org.apache.curator (curator-recipes, curator-test) from the io.github.microsphere-projects:microsphere-spring-test test dependency in pom.xml. This allows the previously excluded Curator/Zookeeper test artifacts to be pulled in transitively and available on the test classpath.
Update <microsphere-spring.version> from 0.1.13 to 0.1.14 and remove the junit-bom import from dependencyManagement. Keeps Spring Boot dependency imports intact; no other functional changes.
Add an import for org.junit:junit-bom to the parent POM's dependencyManagement, using ${junit-jupiter.version} to centrally manage JUnit/Jupiter dependency versions across modules. This ensures consistent test dependency versions alongside the existing Spring Boot BOM imports.
Replace the CURRENT enum initialization to use Version.ofVersion(SpringBootVersion.class) instead of parsing the runtime version string. Adds a static import for ofVersion and switches from org.springframework.boot.SpringBootVersion.getVersion() to class-based resolution, making version detection more robust and consistent with Version utilities.
Include ActuatorAutoConfigurationTest.class in the classes arrays for the MeterRegistryPresent and MeterRegistryAbsent @SpringBootTest cases so the test class is loaded into the application context during those tests. This ensures the test's configuration/beans are available when running the actuator-related test scenarios.
Replace MockEnvironment.setProperty with withProperty in SpringApplicationUtilsTest.testGetLoggingLevel to set the logging level. This updates the test to use the current MockEnvironment API (avoids deprecated call and supports fluent usage).
Expand the GitHub Actions maven-build workflow matrix to include JDK 17, 21, and 25 in addition to existing 8 and 11. This updates CI to build and test the project against newer Java releases to ensure compatibility.
Add Spring milestone repository and update release notes generation
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ Complexity Δ
...tuate/autoconfigure/ActuatorAutoConfiguration.java 100.00% <ø> (ø) 2.00 <0.00> (ø)
.../io/microsphere/spring/boot/SpringBootVersion.java 100.00% <100.00%> (ø) 18.00 <0.00> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud
Copy link
Copy Markdown

@mercyblitz mercyblitz merged commit bb06c0a into release-1.x Apr 28, 2026
72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant