So… as my understanding of how to get my little programming projects rolled out matures, I have discovered Apache Maven…. and it really is quite nice for getting everything I was doing manually for the projects, done automatically. Building, distributing, constructing a project reporting site, running tests (finally have some testing built into my apps), etc. All in all, a very useful all-inclusive tool. It has taken a little work to make everything run the way I was hoping it would run, but little by little, I’m getting there.
Read Time:3 Minute, 34 Second
So far, I’ve been using the gwt-syntaxhighlighter project as my testbed for maven, with plans on rolling out the concepts/methods I’ve used there to also be applied to the gwt-fontface project, and finally the ShowSort app.
.gwt.xml files needed for the final product) separate from the Java files, making it a little cleaner and easier to locate the java files I need to work on without a polluted directory structure.
Tying it all together with Maven’s SCM configuration, I was then able to have maven automatically push the new, updated source files to the source code repository whenever I release a new version. I use the SonaType OSS Maven artifact repository to release the jars into the Maven world, which is a nice convenient way for Maven users to be able to locate and use the gwt-syntaxhighlighter project and have it included into their own apps. Finally, I was able to rely on the Maven GWU Plugin to have it automatically upload the released jars up to the Google Code downloads. This means in one simple command, I can completely deploy the gwt-syntaxhighlighter project in an efficient and effective manner, getting the source code checked-in, and releasing the built jars into both the Maven central repository and into the Google Code downloads section for the project.
Finally, I tied in the Maven site generation system, which constructs a nice, simple website for the project. I have two sets of Java API documentation, the change log for the project, and a few other details all integrated into it, and have it all rigged up to be updated when I release a new version of the code.
Another thing Maven allowed for me to do, was to have a simple way to construct and run tests on the gwt-syntaxhighlighter module, checking to ensure that it works how I think it should be working. These tests end up being run automatically whenever I build the project, giving me a nice, comfortable feeling that the project will be running the way I hope it will be. Right now, the tests are probably not completely adequate, but I will be working over time to make them as robust as I can.
Since everything is tied directly into Maven, it should, theoretically, be possible for me to use any development environment (that supports Maven), so I’ll no longer need to worry about how the directory structure and set-up is for my project in Eclipse and then need to switch to NetBeans at some point or another… I can use either one at my leisure.