The most effective and reproducible way to build the project with Maven
See original GitHub issueWhy?
mvn is non-hermetic and currently the best way I know to build the project is:
mvn clean && mvn package || mvn package || mvn package
It seems to progressively generate more and more code for peers to “see” more and more code during subsequent compilation attempts. Surely other developers build the project in a different way. It would be amazing to learn how.
How?
- The community shares their know-how about using maven
Old issue
Why?
mvn package builds don’t seem to be hermetic and while most of the errors I worked around by running mvn package over and over again, the “fix point” seems to currently be the following:
[INFO] Running org.mage.test.cards.flipcoin.FlipCoinTest
FATAL 2022-03-11 15:16:28,008 Error loading card: mage.cards.e.EHondaSumoChampion (SLD) =>[main] CardImpl.createCard
java.lang.Error: Unresolved compilation problem:
CardsInTargetPlayerHandCount cannot be resolved to a variable
and
[ERROR] org.mage.test.cards.single.m11.InfernoTitanTest.test_MustAbleToTargetPlaneswalkers Time elapsed: 0.001 s <<< ERROR!
java.lang.Error:
Unresolved compilation problem:
Config2 cannot be resolved to a variable
There are a lot of test failures, basically if something refers to Config2, it fails.
How?
~- [ ] Those who were able to build the project with mvn should share their recipes of doing so, especially ensuring that card tests run, since I got just the last two build items to build!~
~- [ ] The know-how from the community should then be adopted in the automated, reproducible build process, per devops methodology.~
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (4 by maintainers)

Top Related StackOverflow Question
xmage consists of several subpackages which are tightly interlinked with each other–e.g.
Mage.ClientandMage.Serverboth depend on the rules engine inMage, the card and set classes inMage.Sets, and whatever the hell is inMage.Common. The supported way to build the project is all at once viamvn installin the project root directory–building the client or server packages individually doesn’t make sense.@alexander-novo VSCode just worked for patching the code, with go to definition and all, I think.
Regarding building, I ended up just using perl hack I mentioned before.
You can check out my issues/8749. It has flake.nix which makes sure perl script just works. Takes two ish minutes to run, but it’s ok, because tests fail fast, and also, you get a bundle in the project directory you can host on a server and share with your group.