views:

342

answers:

3

For the past 2 years-(ish) I've been using Maven2 for my build/continuous integration solution. I used Ant a bit before that but really didn't get a lot of experience with it. Now I've taken a new job and the team I'm on now uses Ant.

What I'm wondering about is this:

In Maven we had directory conventions for seperating our java source and files and java test files (JUnit tests). It looked like this:

Project-
  -src/main/java
  -src/test/java

This way your tests are separate from your source/production code and won't be built/deployed as such.

Going over the Ant documentation I don't really see any convention for this. Am I missing something? Is there a similar convention in Ant?

+5  A: 

My experience with ant -- which is our primary build tool for Java source, so make of this what you will -- is that there are no such formal conventions. Many source projects I've seen organize things in a similar manner; JBoss uses <module>/src/main for sources, etc... Ant just uses whatever conventions you want, which makes it an ideal tool to integrate into a larger project building framework.

At any rate, the Maven conventions work just fine for Ant, so if you've already got them in place, just re-use the same structures. Not only is it easier for you to keep track of where things are, when you use a familiar structure, but if you ever decide to mavenize the project, you'll already be set.

Chris R
+2  A: 

A lot of ANT conventions/best practices are explained in ANT in Anger

Mads Hansen
A: 

An older resource but fine in my opinion are ant-best-practices.

Mnementh