Create account / Log in

Just Enough Maven

Discussion area for the development team.

Moderators: uckelman, Tim M

Just Enough Maven

Postby tinjaw » July 30th, 2020, 2:49 pm

Any suggestions on getting from zero to using Maven enough to build VASSAL? YouTube videos?
User avatar
Posts: 39
Joined: April 10th, 2020, 12:11 pm

Re: Just Enough Maven

Postby Flint1b » July 30th, 2020, 5:32 pm

Look at this, note the order in which these phases run: ... -of-phases

Then play around with the project:
- clean phase deletes all build-time artifacts (bytecode-compiled code etc)
- validate phase is where we run the checkstyle plugin to check code formatting
- compile phase is where we compile "src/main/"
- test is where we compile and run "src/test"
- package is where the .jar gets built and saved under target/
- verify.. I think we don't do anything during that phase
- install is where the .jar, source-jar and javadoc-jar gets copied into the local maven repository

As a contributor you only really need the phases up to "test" or rarely "package". If you edit code and do a PR, you do a "mvnw clean test" locally, this ensures your code compiles, checkstyle formatting rules are not violated, and unit tests are green.

Also important are these directories:
- src/main/java is where the main java code is which is shipped to the user
- src/main/resources is where resources are e.g. translations, i.e. non-java code that is shipped to the user
- src/test/java & src/test/resources - same as above but for test code, this is not shipped to the user later
- target/ this is where maven puts everything it creates, compiled .class files, resources are copied into this, the .jar is created here, various intermediary files, reports etc, target/ is never committed to git
User avatar
Posts: 464
Joined: May 19th, 2020, 12:27 am
Location: Colonia Agrippina

Re: Just Enough Maven

Postby Cattlesquat » July 30th, 2020, 6:35 pm

Yeah run through the git setup in the wiki first if you haven't:

After that you'll really just need the "./mvnw clean test" command as far as Maven goes, at least in terms of your "minimal getting started" desire.
User avatar
Posts: 1112
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Return to Developers

Who is online

Users browsing this forum: No registered users and 2 guests