Skip to content

Публикация в maven central + обновление зависимостей#31

Merged
theshadowco merged 9 commits intodevelopfrom
feature/publishToMavenCentral
Aug 22, 2025
Merged

Публикация в maven central + обновление зависимостей#31
theshadowco merged 9 commits intodevelopfrom
feature/publishToMavenCentral

Conversation

@theshadowco
Copy link
Copy Markdown
Member

No description provided.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 22, 2025

Walkthrough

Миграция процесса публикации: удалены signing и nexusStaging, добавлен JReleaser с конфигурацией подписи и деплоя (Maven Central release, Nexus2 snapshots) и локальным staging-репозиторием. Обновлены POM (issueManagement, ciManagement) и версии плагинов FreeFair. Обновлены Gradle Wrapper (8.14.3) и скрипты gradlew/gradlew.bat.

Changes

Cohort / File(s) Summary
Публикация и подпись (JReleaser)
build.gradle.kts
Заменён io.codearte.nexus-staging на org.jreleaser; удалены блоки signing и nexusStaging; добавлен блок jreleaser (signing, deploy для release/snapshot с использованием build/staging-deploy); публикация в локальный staging-URL; добавлены POM issueManagement/ciManagement; обновлены FreeFair плагины; добавлен импорт Active.*
Gradle Wrapper конфигурация
gradle/wrapper/gradle-wrapper.properties
Обновление Gradle до 8.14.3; добавлен validateDistributionUrl=true; прочие параметры без изменений.
Unix запускаемый скрипт
gradlew
Новый SPDX заголовок; улучшено определение APP_HOME; добавлен DEFAULT_JVM_OPTS ("-Xmx64m" "-Xms64m"); более надёжная проверка java; обновлены комментарии и подавления shellcheck; корректировки сбора аргументов JVM.
Windows запускаемый скрипт
gradlew.bat
Добавлен SPDX заголовок; сообщения об ошибках JAVA_HOME перенаправлены в stderr; оформление сообщений обновлено, логика прежняя.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Developer
  participant Gradle as Gradle (publish)
  participant FS as Local Staging (build/staging-deploy)
  participant JR as JReleaser
  participant MC as Maven Central (Release)
  participant NX as Nexus2 (Snapshots)

  Dev->>Gradle: run publish
  Gradle->>FS: Upload artifacts + POM
  note right of FS: Локальный staging-репозиторий

  Dev->>JR: run jreleaser deploy
  JR->>JR: Sign artifacts (armored, active=ALWAYS)
  alt Release
    JR->>MC: Publish via Publisher API<br/>(active=RELEASE)
  else Snapshot
    JR->>NX: Publish snapshot<br/>(active=SNAPSHOT, rules applied)
  end
  JR-->>Dev: Deployment result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

В норе скриптов я стук да стук,
JReleaser — новый друг!
В staging зёрна артефактов — хрум,
Подпись шёлестит: шурш—бум-бум.
Градль хвостиком махнёт: «Вперёд!»
А в Central зайчик след ведёт. 🐇📦✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/publishToMavenCentral

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
build.gradle.kts (1)

182-209: Проверка секретных файлов пройдена – конфиденциальные данные не найдены

По результатам проверки в репозитории:

  • Отдельных файлов jreleaser.{yml,yaml,toml,properties} не обнаружено: конфигурация задаётся напрямую в build.gradle.kts, что соответствует использованию Kotlin DSL.
  • Строк с признаками секретов (JRELEASER_, GPG, SONATYPE) в конфигурационных файлах нет.
  • В .gitignore отсутствуют исключения для создаваемых JReleaser артефактов.

Рекомендуется добавить в .gitignore исключения для временных каталогов и файлов, чтобы:

  • не заливать в репозиторий сгенерированные staging-файлы
  • исключить локальные GPG-ключи и кеш

Пример добавляемых строк в .gitignore:

# JReleaser staging artifacts
/build/staging-deploy/

# Локальные GPG-ключи и кеш
/.gnupg/
/secring.gpg
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 09c0b7c and 09e34b3.

⛔ Files ignored due to path filters (4)
  • .github/workflows/publish-to-maven-central.yml is excluded by !**/*.yml
  • .github/workflows/publish-to-sonatype.yml is excluded by !**/*.yml
  • .idea/compiler.xml is excluded by !**/*.xml
  • gradle/wrapper/gradle-wrapper.jar is excluded by !**/*.jar, !**/*.jar
📒 Files selected for processing (4)
  • build.gradle.kts (3 hunks)
  • gradle/wrapper/gradle-wrapper.properties (1 hunks)
  • gradlew (5 hunks)
  • gradlew.bat (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build (21, macOS-latest)
  • GitHub Check: build (21, windows-latest)
  • GitHub Check: build (17, windows-latest)
🔇 Additional comments (14)
gradle/wrapper/gradle-wrapper.properties (2)

3-3: Обновление до Gradle 8.14.3 выглядит корректно

Обновление с версии 8.12 до 8.14.3 должно быть безопасным, так как это минорное обновление в рамках той же мажорной версии.


5-5: Хорошее улучшение безопасности с validateDistributionUrl

Добавление validateDistributionUrl=true повышает безопасность, проверяя URL дистрибутива при загрузке.

gradlew.bat (3)

16-16: Добавление SPDX идентификатора лицензии

Добавление SPDX-License-Identifier улучшает машиночитаемость информации о лицензии.


48-52: Правильное перенаправление ошибок в stderr

Перенаправление сообщений об ошибках в stderr (1>&2) соответствует стандартным практикам обработки ошибок в скриптах.


62-66: Консистентная обработка ошибок для недействительного JAVA_HOME

Аналогично предыдущему блоку, перенаправление в stderr обеспечивает правильную обработку ошибок.

gradlew (4)

18-18: Добавление SPDX идентификатора лицензии

Добавление SPDX-License-Identifier соответствует изменениям в gradlew.bat.


88-89: Корректная обработка CDPATH

Перенаправление вывода cd в /dev/null предотвращает проблемы, когда установлена переменная CDPATH.


204-205: Добавление DEFAULT_JVM_OPTS с разумными значениями

Установка памяти JVM в 64MB для wrapper'а является разумным выбором, так как сам wrapper не требует много памяти.


136-142: Улучшенная проверка наличия Java

Использование command -v вместо which более портативно и соответствует POSIX стандартам.

build.gradle.kts (5)

3-3: Импорт для JReleaser конфигурации

Импорт Active.* необходим для использования констант ALWAYS, RELEASE, SNAPSHOT в конфигурации JReleaser.


114-116: Изменение репозитория публикации на локальный staging

Переход на локальный staging директорий (build/staging-deploy) - это правильный подход для JReleaser, который затем сам загрузит артефакты в Maven Central.


167-176: Добавление обязательных метаданных для Maven Central

Добавление issueManagement и ciManagement секций требуется для валидации POM при публикации в Maven Central.


12-15: Версия плагина org.jreleaser корректна
На Gradle Plugin Portal указано, что последняя стабильная версия плагина org.jreleaser для Gradle — 1.19.0 (релиз 30 июня 2025 г.), что соответствует версии, указанной в сборке. (plugins.gradle.org, mvnrepository.com)


193-193: Проверка корректности API-URL для публикации в Maven Central Portal

  • В файле build.gradle.kts (строка 193) убедитесь, что для Sonatype задан правильный endpoint:
    url = "https://central.sonatype.com/api/v1/publisher"
    stagingRepository("build/staging-deploy")
  • Проверьте, что ваш namespace (например, io.github.<yourusername>) зарегистрирован и верифицирован через Sonatype Central Portal.
  • Убедитесь, что Sonatype credentials (логин/пароль или токен) настроены в ~/.gradle/gradle.properties или через переменные окружения.

Эти настройки необходимы для успешной публикации артефактов через JReleaser.

@theshadowco theshadowco merged commit f10cc62 into develop Aug 22, 2025
15 checks passed
@theshadowco theshadowco deleted the feature/publishToMavenCentral branch August 22, 2025 09:13
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.

2 participants