• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

skeeto/sample-java-project: Example Ant-based Java project

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

skeeto/sample-java-project

开源软件地址:

https://github.com/skeeto/sample-java-project

开源编程语言:

Java 100.0%

开源软件介绍:

Sample Java Project

This is a reference for setting up a new Ant-based Java project. It contains most of the little Ant tricks I've learned over the years. When I start a new Java project I clone this repository, remove sections of build.xml that I don't care about for that particular project, set the project properties, clear out the sample sources, and get to work.

Setup

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).

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 affect any other targets.

There is a "hotswap" target for replacing live code while an application is running. You'll need the hotswap Ant extension installed to use it. This target is to be used alongside the "run-hotswap" target, which enables hotswapping in the JVM. You can demo this for yourself by running "run-hotswap" in a terminal, editing the printed string in the code, and running "hotswap" in another terminal. The printed message in the running program should change to the new string.

Bundles

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

Philosophy

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 or dependency manager. It's the system or dependency manager that provides the libraries. Anyone who has the proper development environment set up -- one that works across many projects -- should be able to clone the repository and do a build simply by running the build program with no special arguments. There should be no need to edit or install anything into the project space for the initial build.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Seazean/JavaNote: 发布时间:2022-06-22
下一篇:
ironhack-labs/lab-javascript-basic-algorithms: An exercise designed to learn bas ...发布时间:2022-06-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap