https://github.com/adamko-dev/vcs-mvn-publish
A Gradle plugin for publishing Maven release to a Git branch - quick and easy Maven hosting
https://github.com/adamko-dev/vcs-mvn-publish
Last synced: 13 days ago
JSON representation
A Gradle plugin for publishing Maven release to a Git branch - quick and easy Maven hosting
- Host: GitHub
- URL: https://github.com/adamko-dev/vcs-mvn-publish
- Owner: adamko-dev
- Created: 2022-10-12T07:25:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-14T19:49:00.000Z (over 3 years ago)
- Last Synced: 2025-02-25T13:29:34.942Z (over 1 year ago)
- Language: Kotlin
- Homepage:
- Size: 810 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `vcs-mvn-publish`
Publish Maven artifacts to a Git repository.
Artifacts are published to a separate branch, so development branches remain clean.
Simpler than figuring out publishing to Maven Central!
### Status
`vcs-mvn-publish` is a proof-of-concept. There are no tests. Use at your own risk.
### Quick start
First, set up a regular Gradle project, and configure the
[Maven Publish Plugin](https://docs.gradle.org/current/userguide/publishing_maven.html).
Next, add the `vcs-mvn-publish` plugin, and register a Git repo.
```kotlin
buildscript {
plugins {
repositories {
maven("https://raw.githubusercontent.com/adamko-dev/vcs-mvn-publish/artifacts/m2")
}
}
}
plugins {
id("dev.adamko.vcs-mvn-publish") version "main-SNAPSHOT"
java
`maven-publish`
}
vcsMvnPublish {
gitPushToRemoteEnabled.set(false) // disable auto-push, so we can check it works first
gitRepo("artifacts") // 'artifacts' will be the remote branch
}
```
Then, run the publishing task
```shell
./gradlew gitRepoPublish
```
Check that there's a Maven repo in `$projectDir/.gradle/vcs-mvn-publish/artifacts/`.
Are all the published artifacts there?
If you're happy, then enable auto-push, and re-run `./gradlew gitRepoPublish`.
### Multiple subprojects
To publish multiple subprojects to the Git repository, just add `vcs-mvn-publish` to all relevant
subprojects, and to the root project.