Skip to content

GoudSagar/sample-java-project

Repository files navigation

This is just a reference for setting up a new Java project. It
contains some of the little Ant tricks I've learned.

Building this project requires that Ivy be available to Ant. All you
need is ivy.jar in Ant's classpath (in your $CLASSPATH, $ANT_HOME/lib,
or ~/.ant/lib).

You will need to have Astyle installed and in your path for the
"format" target to work. If it's missing, that's fine. It won't affect
any other targets.

Ant will be looking for Checkstyle, which provides the "check"
target. Except the extra target, I think it should work without
it. Like a hardcore bureaucrat, Checkstyle will harshly criticize your
code, requiring you to add every bit of excessive and needless
boilerplate. That can keep some idle hands pretty busy.

Ant will be looking for ProGuard, which provides the "optimize"
target. You should still be able to build the project without it. Only
the "optimize" target will not work.

There is a "hotswap" target for replacing live code while an
application is running. You'll need the hotswap Ant extension
installed in Ant's classpath to use it. It's to be used alongside the
"run-hotswap" target, which enables hotswapping in the
JVM. Hotswapping has no practical use in this particular sample
project because it exits immediately.

Note that ProGuard and Checkstyle are needed only in the build
classpath, not your project's classpath. That means you probably don't
want them in lib/. Like Ivy, they should be where Ant can get to them.

I hate coding absolute paths in my build script and I hate including
built files as part of the base project. My philosophy is that the
*environment* should be set up so that the tool can easily find the
external resources they need (JUnit, etc.) from the system, not within
the project. It's the system that provides the libraries. Anyone who
has the proper development environment set up -- one that carries
across many projects -- should be able to clone the repository and do
the build without editing anything or installing anything else into
the project space.

About

Example Ant-based Java project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%