Very good question.
The best would be if we could add Vassal as a maven dependency, then maven would take care of all the other dependencies. It should be possible already, but only under certain conditions:
- the Vassal jar is installed in the local maven repository, a “mvn install” does this
- alternatively both Vassal and the module need to be open at the same time in the same Eclipse workspace and the Eclipse option “resolve workspace artifacts” needs to be enabled, it is enabled by default I think but better double-check, and this is not a very maven-y way since it depends on Eclipse
But at the moment this is only a crude workaround for what maven is really able to do, and only works on the computers of those that have maven installed and mess around with the Vassal code. For it to become a really neat feature for module developers, we still need to do the following:
- decide a proper naming scheme for the groupId and artifactId, right now it’s more or less a placeholder which I have not given much thought, a proper one would be something like “org.vassalengine:vassal-app” (groupId:artifactId)
- switch to the version number in maven as the leading version number of Vassal, at the moment the maven version number is parallel to the “real” version number that is set manually and/or by using this ‘git describe --tags’ command
- split the one single-module project into a multi-module project, have the actual Vassal jar as one of the sub-modules, since this is the one that the modules will need, the rest has to do with building the release package and is irrelevant for the modules
- set maven to build a source and/or a javadoc package in addition to the plain jar
- start uploading our releases (the jar+src+javadoc, minus the rest) to mavencentral
- at this point module designers will be able to simply add a maven dependency to their project, just like the dependencies that we have in our pom.xml, their maven will download the Vassal jar and all transitive dependencies, they IDEs will resolve the javadoc and the sourcecode if they want to jump into the Vassal code straight from their IDE, just like we can jump into the source code of our dependencies now
- once we have this, we can setup a template/skeleton project and hand it out to module designers, where the pom.xml will already contain the main fields and run out of the box, with comments describing what fields they need to change, perhaps 1-2 example classes
I am working on this as I am writing this, I already converted it to a multi-module project and the jar that is needed for modules is singled out in it’s own maven artifact.
I would like to hear your feedback on some of these bullet points, mainly the switch to the maven version number, going “full opensource” by publishing the artifacts on mavencentral (never done this before but it shouldn’t be too complicated, here is an official guide maven.apache.org/repository/guid … pload.html), and what naming scheme would be appropriate, my suggestion is:
- group id: “org.vassalengine”
- artifact id: “vassal-app”
Reason for “vassal-app” is, if (big BIG if, I know
) we ever manage to split the application into something approaching MVC, we could keep “vassal-app” for the overall thing, and make new ones named “vassal-core” or “vassal-api” or something, then tell the module designers that they can switch to “vassal-core” in new versions of their modules.
Alternatively, we can split it in another way: split up the API that modules can use from the API that they can not / should not use, e.g. it makes no sense for modules to use/extend/overwrite classes like ModuleManager, Player and Editor, these could stay in “vassal-app” and the classes that modules can use as their API could go into “vassal-core”.
But this is very longterm, right now let’s decide whether we want to publish the artifacts on mavencentral, make up a nice naming scheme and make a neat skeleton module for module designers.