http://maven.apache.org/what-is-maven.html
Maven is a unified build environment java applications and a replacement for ant. I have been using it to manage my home game development projects for a few weeks now and it is surprisingly refreshing and automates many of the little things that drive me insane when building a java project.
Things that is does that I love:
- After specifying a dependency in the project definition (pom) maven will automatically download and link the jar into the classpath.
- Automatic generation of project files for eclipse and intellij idea
- Automatic running of unit tests
- Seperation of dependencies from build time to run time
- Test code built into it’s own jar (and excluded from release)
- Once set up, increases the speed of the workflow.
Now, if you decide to try maven there are a few things you need to know about the dependency mechanism, the most important being that most of the game library developers don’t use maven or have little idea about it’s existance and as such many of the required dependencies won’t be found. But I have remedied this by making my own repository for game development specific jar files.
So far all that is in the repository is LWJGL as that is what I use. To add this repository and link to the definitions add these lines to your pom:
<project ...>
...
<repositories>
<repository>
<id>stramits</id>
<name>stramits</name>
<url>http://www.maven.strumpy.org</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<type>jar</type>
<version>1.0beta</version>
</dependency>
<dependency>
<groupId>lwjgl</groupId>
<artifactId>lwjgl_util</artifactId>
<type>jar</type>
<version>1.0beta</version>
</dependency>
<dependency>
<groupId>lwjgl</groupId>
<artifactId>lwjgl_jinput</artifactId>
<type>jar</type>
<version>1.0beta</version>
</dependency>
</dependencies>
...
</project>
So far lwjgl is the only project in the repository, but I will be adding others at the request of the boards if they do not exist in the central maven repository.
I urge you all to give maven a go. It’s amazing for the development and build cycle. Even if you don’t end up using it it is good to know that it exists and whats it’s function is.
-Tim
Thanks for setting up LWGL for us. It may be a little while before I can try it out but I’ll let you know how it looks when I’ve had a chance.