allegro / allegro/axion-release-plugin
Incomplete multi-module documentation
- Vorherrschende Sprache
- Groovy
- Sterne
- 641
- Forks
- 165
- Ø Merge
- 49 Min.
- Gemergte PRs (30 T.)
- 9
Beschreibung
Hello,
it is likely the multi-module project documentation is incomplete https://axion-release-plugin.readthedocs.io/en/latest/configuration/basic_usage/#multi-module-project
[Here](https://github.com/allegro/axion-release-plugin/issues/455#issuecomment-1126943741) for example I've asked sb about his Gradle config and it turns out you need the `scmVersion{}` not only in the root of the project but in the subprojects as well. But then Im wondering why you need it even in the root project, because it would generate a version for the root as well which in case of a monorepo makes no sense imo.
I think there should be a full example in the docs, especially if there are edge cases so people won't have to struggle for days to get it up and running. Would be great if the owners would add it.
My current setup looks like this (root build.gradle):
```
//tell the plugin that we want all modules to be affected that sit in the applications module
scmVersion {
monorepos {
projectDirs = project.subprojects.stream()
/*
* the variable name is a bit misleading - we need to give the plugin a list of modules
* that should NOT be used for the projectDirs property
*/
.filter(p -> "applications" != p.getParent().name)
.map(p -> p.name)
.collect(Collectors.toList())
}
}
/**
* we apply the plugin and the `scmVersion{}` config
* to all of the modules sitting in the applications directory
*/
subprojects.stream()
.filter(p -> "applications" == p.getParent().name)
.forEach(p -> {
p.configure(p) {
apply plugin: 'pl.allegro.tech.build.axion-release'
scmVersion {
useHighestVersion = true
versionCreator 'versionWithBranch'
repository {
pushTagsOnly = true
}
tag {
/*
* prevent conflicts with the plugin in case the project name
* has the same separator as the tag separator
* /
prefix = project.name.replace('-', '_')
versionSeparator = "-"
}
nextVersion {
suffix = 'alpha' // tag suffix
separator = '-'
}
checks {
aheadOfRemote = true
uncommittedChanges = true
snapshotDependencies = false
}
}
project.version = scmVersion.version
}
})
```
While it works locally, I think something is off / missing, as the task fails with an exception **pl.allegro.tech.build.axion.release.ReleaseFailedException (no error message)**
that does not tell me anything in **Github CI**
```
> Task :applications:my-application:release
Working on released version 0.1.0, nothing to release
Pushing all to remote: origin
12 actionable tasks: 12 executed
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':applications:my-application:release'.
> pl.allegro.tech.build.axion.release.ReleaseFailedException (no error message)
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org/
BUILD FAILED in 19s
```
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.