Skip to content

maven-publish integration in multi-module project #1131

Closed
@geoHeil

Description

@geoHeil

I have a multi modue project in gradle.

Ideally, I want to apply the changelog plugin only once - to prevent: diffplug/spotless-changelog#24

But if I do this, the maven-publish task fails and only sets a version of undefined.

However, if I apply changelog to all projects the maven-publish task works nicely, but I can no longer execute the version bump task.
The workaround suggested here: diffplug/spotless-changelog#25 respectively

String kind
if (project.name == 'plugin-gradle') {
kind = 'gradle'
} else if (project.name == 'plugin-maven') {
kind = 'maven'
} else if (project.name.startsWith('eclipse')) {
kind = 'ext-' + project.name
} else {
assert project == rootProject
kind = 'lib'
}
// the root project and plugins have their own changelogs
apply plugin: 'com.diffplug.spotless-changelog'
spotlessChangelog {
changelogFile 'CHANGES.md'
// need -Prelease=true in order to do a publish
appendDashSnapshotUnless_dashPrelease=true
tagPrefix "${kind}/"
commitMessage "Published ${kind}/{{version}}" // {{version}} will be replaced
}
is not what I want. Rather a single changelog for the overall modules in the project i.e. single application.

How can this be achieved?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions