kelnos / scala-cross-maven-plugin

Maven plugin to help rewrite POMs for cross-compiled Scala libraries
BSD 3-Clause "New" or "Revised" License
8 stars 2 forks source link

Build all profiles in one run #18

Closed asm0dey closed 3 years ago

asm0dey commented 3 years ago

What is the correct way to build all profiles in one run? Say I have a project with 2.11 and 2.12 support and want to publish both versions to maven central. What is the correct way to do this?

kelnos commented 3 years ago

I don't think maven allows you to do this all in one run.

asm0dey commented 3 years ago

OK, thanks

kelnos commented 3 years ago

I usually drop a Makefile in the root of my projects that runs the corresponding maven command for all profiles. For example:

SCALA_VERSIONS := 2.11 2.12

deploy:
    for scala_version in $(SCALA_VERSIONS); do \
        mvn deploy -Pscala-$$scala_version || exit 1; \
    done

Then I can run make deploy.

asm0dey commented 3 years ago

There is a trouble with deploy to central, which is it sets up new tag and version on each release

kelnos commented 3 years ago

Ah, that makes sense. Unfortunately I don't know of a good solution here, unless you can somehow separate out the tagging and version bumping with the actual build and deploy.

kelnos commented 3 years ago

This is really ugly, but I suppose you could delete the tag and roll back the version bump after each deploy (except leave it there after the final deploy).