question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The most effective and reproducible way to build the project with Maven

See original GitHub issue

Why?

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:open
  • Created 2 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
awjacksoncommented, Mar 11, 2022

xmage consists of several subpackages which are tightly interlinked with each other–e.g. Mage.Client and Mage.Server both depend on the rules engine in Mage, the card and set classes in Mage.Sets, and whatever the hell is in Mage.Common. The supported way to build the project is all at once via mvn install in the project root directory–building the client or server packages individually doesn’t make sense.

0reactions
cognivorecommented, Jun 7, 2022

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Guide to Configuring for Reproducible Builds - Apache Maven
Enable Reproducible Builds mode for plugins, by adding project.build. ... The artifact:buildinfo goal proposes a command with path to files: just copy/paste ...
Read more >
Apache Maven Tutorial - Vogella.com
Apache Maven is an powerful build tool primary for Java software projects. ... these steps is that the build is reproducible, faster and...
Read more >
Reproducible builds with Maven : r/java - Reddit
This plugin worked by stripping nondeterministic information from generated artifacts such as ZIP, JAR, WAR and EAR files. But now the native ...
Read more >
JVM — reproducible-builds.org
Getting reproducible builds with Maven requires some plugins configuration: see Maven - Guide to Configuring for Reproducible Builds for more details. Gradle.
Read more >
jfrog/reproducible-build - GitHub
Maven Reproducible Builds · Example Maven Reproducible Building Using maven-jar-plugin, maven-source-plugin and maven-assembly-plugin 3.2. · Example Maven ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found