Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

teste

License

NotificationsYou must be signed in to change notification settings

nelmajordao/teste

Repository files navigation

# Sample Java Project

This is a reference for setting up a new Ant-based Java project. Itcontains most of the little Ant tricks I've learned over theyears. When I start a new Java project I clone this repository, removesections of build.xml that I don't care about for that particularproject, set the project properties, clear out the sample sources, andget to work.

## Setup

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

## Dependencies

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 affectany other targets.

There is a "hotswap" target for replacing live code while anapplication is running. You'll need the hotswap Ant extensioninstalled to use it. This target is to be used alongside the"run-hotswap" target, which enables hotswapping in the JVM. You candemo this for yourself by running "run-hotswap" in a terminal, editingthe printed string in the code, and running "hotswap" in anotherterminal. The printed message in the running program should change tothe new string.

## Bundles

Take note of the sample pom.xml file. This is not actually for Mavenbuilds -- this is an Ant project afterall -- but for publishing buildsfor a Maven repository. It's packed up by the "bundle" target, whichcreates a bundle.jar containing your project's signed artifacts. Touse the "bundle" target you need to have GnuPG set up in your path, agenerated key pair, and a running gpg-agent, unless you like typingyour passphrase a bunch of times in a row.

## Philosophy

I hate coding absolute paths in my build script and I hate includingbuilt files as part of the base project. My philosophy is that theenvironment should be set up so that the tool can easily find theexternal resources they need (JUnit, etc.) from the system ordependency manager. It's the system or dependency manager thatprovides the libraries. Anyone who has the proper developmentenvironment set up -- one that works across many projects -- should beable to clone the repository and do a build simply by running thebuild program with no special arguments. There should be no need toedit or install anything into the project space for the initial build.


[8]ページ先頭

©2009-2025 Movatter.jp