[英]Java Build; with these requirements, what would be a good choice?
This is in regards to building a Java Project. 这与构建Java项目有关。
So I'm a bit confused on my options here. 所以我对这里的选择有些困惑。
My requirements (it's a small project): 我的要求(这是一个小项目):
Needs to compile Java project with specific/custom compiler arguments 需要使用特定/自定义编译器参数来编译Java项目
Project has native libs that need to be included 项目具有需要包含的本机库
need to compile javascript->java class via Rhino javascript compiler (https://developer.mozilla.org/en/Rhino/JavaScript_Compiler) 需要通过Rhino javascript编译器(https://developer.mozilla.org/en/Rhino/JavaScript_Compiler)编译javascript-> java类
After the build I need to run another command: ProGuard (http://proguard.sourceforge.net/) 构建后,我需要运行另一个命令:ProGuard(http://proguard.sourceforge.net/)
run javadocs 运行javadocs
Package everything up in Jar (also including external data, ie, images, xml, ini, etc) 将所有内容打包到Jar中(还包括外部数据,例如图像,xml,ini等)
Build/create a .jnlp web start. 生成/创建一个.jnlp网络启动。
Available under both Win and Linux would be optimal. 在Win和Linux下都可用是最佳选择。
this is a hobby project, so don't want to spend weeks learning/managing the build system. 这是一个业余项目,所以不想花数周的时间来学习/管理构建系统。 At most an 8-12 hour investment start to finish (otherwise it's just better to keep doing everything by hand). 最多只需要8到12个小时就可以完成投资(否则最好继续手工做所有事情)。
btw, my IDE is Eclipse if it matters; 顺便说一句,如果重要的话,我的IDE是Eclipse; a nice integrated plugin would be nice - but not required. 一个不错的集成插件会不错-但不是必需的。
So far I think Ant and Maven are the main two build systems in use. 到目前为止,我认为Ant和Maven是使用中的两个主要构建系统。 It's very unclear to me though which one I should use or how they differ? 我不清楚我应该使用哪一个,或者它们之间有何不同?
The other option would be 'make' under linux (or maybe cygwin). 另一个选项是在Linux(或可能是cygwin)下的“ make”。 I've only used it once, but seemed pretty quick to get going/working. 我只使用过一次,但看起来很快就可以开始工作。 Is that a good option for Java or this project? 对于Java或该项目,这是一个不错的选择吗? Any downsides to make? 有什么缺点吗? Why don't more java developer's use it? 为什么不更多的Java开发人员使用它?
Other options? 还有其他选择吗?
In a nutshell: spend your 12 hours learning and using Ant. 简而言之:花12个小时学习和使用Ant。
Maven has a good feel out-of-the box, super-easy to get going and with the neat dependency management, but down the line tweaking the pom.xml (your project's maven build file) to fit your needs will require more fiddling with than if you used Ant. Maven具有开箱即用的良好感觉,使用整洁的依赖项管理非常容易上手,但是根据需要调整线pom.xml(项目的maven构建文件)以适应您的需求将需要更多的摆弄。比起您使用Ant而言。
To address some of your specific requirements: 要满足您的一些特定要求:
<compilerarg>
elements with the <javac>
task 您可以将<compilerarg>
元素与<javac>
任务一起使用 <sysproperty>
and key="java.library.path"
对于本机库,可以使用以下命令添加它们: <sysproperty>
和key="java.library.path"
<javadoc>
task out of the box for Javadoc Ant附带了<javadoc>
任务 <jar>
Ant task is extremely easy to use to package everything up <jar>
Ant任务非常易于使用,可以打包所有内容 <jw:jnlpwar>
task available from the [Ant Web Start Task project] at (http://ant-jnlp-war.sourceforge.net) [Ant Web Start Task project]中有一个<jw:jnlpwar>
任务,网址为(http://ant-jnlp-war.sourceforge.net) It may not do fancy dependency management out-of-the-box like Maven (although for that you can integrate Ant with Ivy) but it certainly provides you with all the flexibility you'll ever need, and you won't find yourself "fighting" the build tool configuration file as it's fairly common with Maven. 它可能不会像Maven那样开箱即用地进行依赖管理(尽管您可以将Ant与Ivy集成在一起),但是它无疑为您提供了所需的所有灵活性,而且您不会发现自己“与“构建工具配置文件”相对应,因为它在Maven中相当普遍。
I should probably just mention the 2 new names in Java build (and CI) tools: Hudson and Jenkins . 我可能应该只提到Java构建(和CI)工具中的两个新名称: Hudson和Jenkins 。 They're fairly recent and may be interesting to look at, but I would definitely not recommend them to you and your project at this early stage. 它们是相当新的,可能看起来很有趣,但是我绝对不会在早期阶段将它们推荐给您和您的项目。
Note: apologies for the lack of real links (only allowed 2 links atm) 注意:缺少实际链接的道歉(仅允许2个链接atm)
Maven is the best choice here as it has integration for all of these Maven是这里的最佳选择,因为它集成了所有这些功能
so go for it . 所以去吧 。
Here, quick links for you to save an extra hour to spend on learning maven ;) 在这里,快速链接可为您节省额外的时间来学习Maven;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.