VASSAL in Maven

I expect to get mixed reviews on a proposal to move VASSAL into Maven, but Maven is where the open source world has moved. I believe that the cost of switching is worth the benefits of moving the build to Maven.

There are different degrees to which you can depend on Maven. A non-intrusive starting point would be to rely on Maven just to compile and run your tests; retaining the current make-based build engine for building the released executables.

One very nice aspect of Maven is that it forces you to declare what VERSION of each jar your system depends on, and WHERE one can get that jar. E.g. right now in the VASSAL lib folder I see something called “wizard.jar”. What version is it? Where do I download it? Maven makes all that explicit. You see, when you build using Maven, you don’t distribute your jars with the source–you just distribute your source and a “pom” that describes what jar versions that source depends on and where to get them. And the really beautiful thing about it is that Maven automatically calculates all the version dependencies for you and downloads the dependent jars automatically for you. Kind of like how CPAN works. It’s pretty damn awesome.

Anyway, I don’t expect to convert you any time soon, but I thought I should get the conversation started.

It took me about 2 hours to get VASSAL building successfully using Maven. For the record, attached is the pom file I created to get it to work. Hunting down maven repositories for all the jars was some serious sleuthing work… I was working from the VASSAL trunk.

The biggest impact to making this change, even the testing change, is that Maven requires main java source to be in src/main/java and test java source to be in src/test/java. Moving source folders around is incompatible with maintaining multiple outstanding branches. So I suspect it would be a major effort for us to make this switch considering how many outstanding branches there are right now.

-K

Thus spake fil512:

I expect to get mixed reviews on a proposal to move VASSAL into Maven,
but Maven is where the open source world has moved. I believe that the
cost of switching is worth the benefits of moving the build to Maven.

I would guess that it’s because none of the other devs have had time to
look into what it would involve yet. That’s the usual reason for not
getting objections on any given proposal. :slight_smile:

VERSION of each jar your system depends on, and WHERE one can get that
jar. E.g. right now in the VASSAL lib folder I see something called
“wizard.jar”. What version is it? Where do I download it?

You wondered that too? :slight_smile:

That particular JAR is one I’ve had in my sights for elimination for
ages now…

Maven. For the record, attached is the pom file I created to get it to
work. Hunting down maven repositories for all the jars was some serious
sleuthing work… I was working from the VASSAL trunk.

Thanks for doing this.

The biggest impact to making this change, even the testing change, is
that Maven requires main java source to be in src/main/java and test
java source to be in src/test/java. Moving source folders around is
incompatible with maintaining multiple outstanding branches. So I
suspect it would be a major effort for us to make this switch
considering how many outstanding branches there are right now.

Why isn’t it possible to base the directory structure wherever you want?
E.g., say trunk/src/main/java and trunk/src/main/java?


J.

Not sure what you’re asking here.

Are you suggesting it wouldn’t be a big deal to move the folders where VASSAL keeps its source, or are you asking whether Maven would accept the source folders being in non-standard locations. If the former, then that’s terrific news! If the latter, then the short answer is that Maven has a mechanism for specifying other source folders, but it’s broken. If you’re doing Maven, the source needs to be in src/main/java and src/test/java.

One of the reasons Maven is so successful is that every Maven project has an identical layout. Being able to assume a specific project layout allows tools and extensions to do some really powerful things.

-K

Thus spake fil512:

Are you suggesting it wouldn’t be a big deal to move the folders where
VASSAL keeps its source, or are you asking whether Maven would accept
the source folders being in non-standard locations. If the former, then
that’s terrific news! If the latter, then the short answer is that
Maven has a mechanism for specifying other source folders, but it’s
broken. If you’re doing Maven, the source needs to be in src/main/java
and src/test/java.

I’m not asking either of these things. What I’m asking is how Maven
finds the root directory for your trunk. If it expects to see your trunk
under src, then what’s the problem with having other src directories in
directories which the siblings of src’s parent?

If that’s not possible, then how are you suposed to do branches with
Maven?


J.

Oh, sorry, I confused things when I mentioned an interaction between Maven and svn. The only point I was trying to make there is that moving source folders around can be a pain for someone trying to do a merge. The point I was trying to make about Maven and source folders is independent of subversion. Maven has a concept of a project, and that project has a root folder. Maven expects source to be under src/main/java under that project root folder.

Specifically for VASSAL, if we were to switch to Maven, we’d need to move VASSAL-src/trunk/src/VASSAL to VASSAL-src/trunk/src/main/java/VASSAL and similarly for the test code. Is that clearer?