mage icon indicating copy to clipboard operation
mage copied to clipboard

Set maven-assembly-plugin version in the pom.xml

Open Susucre opened this issue 10 months ago • 10 comments

So for the alpha server I'm setting up, I am currently trying to build and package xmage from a docker.

I figured most of the things out, but I got an error on "mvn assembly:assembly" for both Mage.Client & Mage.Server: image

I checked my dev computer mvn version of maven-assembly-plugin is 2.2-beta-5, and I've not issue with the assembly goal with that one. And once I've set it up to that version in the Docker build in both pom.xml, there was no issue anymore and I was producing the expected .zip out of the build-and-package.pl script.

What is the most appropriate version of maven-assembly-plugin, I am really no expert of maven builds, should we set the version to a working one in the pom.xml files, or maybe support the latest maven-assembly-plugin?

Susucre avatar Apr 18 '24 12:04 Susucre

More details in #11599. Use assembly:single task instead.

JayDi85 avatar Apr 18 '24 13:04 JayDi85

Alright, so the perl files in the repo are the ones being outdated then.

Susucre avatar Apr 18 '24 13:04 Susucre

Yes, perl scripts are very old. 80% of that scripts are outdated and un-used (maybe @theelk801 uses some of it for issues generation).

last time I used a perl scripts — for de-server releases (build, version bump in pom files and new cards list gen from git history).

There are makefile for “modern way” builds, so you can try to use it: https://github.com/magefree/mage/blob/master/Makefile

JayDi85 avatar Apr 18 '24 13:04 JayDi85

the only perl script I use is the card generation one, the rest don't matter to me

theelk801 avatar Apr 18 '24 13:04 theelk801

Uhm with assembly:single there are no .jar for Mage.Client and Mage.Server. image

I suspect I need to tweak the build-and-package.pl a little more to use its produced .zip for the alpha server. The strange part is that on my dev computer build-and-package.pl produces the correct .zip, but maybe because I built the project in IntelliJ and not start from clean slate.

Susucre avatar Apr 18 '24 13:04 Susucre

I'll try from the Makefile. Thanks for the help.

Susucre avatar Apr 18 '24 13:04 Susucre

It uses same maven commands. Make sure you build and install all projects before assembly call (mvn install skiptestsxxx from root folder).

JayDi85 avatar Apr 18 '24 13:04 JayDi85

Well, make file uses good commands: mvn package assembly:single — must works fine.

JayDi85 avatar Apr 18 '24 13:04 JayDi85

Alright, that should works, was missing "package" in those commands too. image

I'll try to start the alpha server with that build, just to confirm. By the way my aim for this whole ordeal is a nightly alpha server, so need to make sure I can automate the build & package the whole way.

Susucre avatar Apr 18 '24 13:04 Susucre

Alright, I did succeed (I was also not properly changing the MageVersion number before the build). image

So I'll change the build-and-package.pl to call mvn package assembly:single -DskipTests instead of mvn assembly:assembly if no-one else is using those scripts.

Susucre avatar Apr 18 '24 14:04 Susucre