简体   繁体   English

通过ANT和Eclipse创建jar

[英]Creation of jar via ANT vs Eclipse

I was wondering if I could get any input on this: I am trying to create a jar that needs to be deployed on to radio head unit, I tried creating it by exporting it through Eclipse. 我想知道我是否可以获得任何输入:我正在尝试创建一个需要部署到无线电主机单元的jar,我尝试通过Eclipse导出它来创建它。 But I was told the right way to do it was through Apache Ant. 但我被告知正确的方法是通过Apache Ant。 Why is that? 这是为什么? (this is a LWUIT xlet coded in JAVA) (这是一个用JAVA编码的LWUIT xlet)

The biggest reasons to have a build script would be automation and reproducible. 拥有构建脚本的最大原因是自动化和可重现。 Your going to have a hard time having a continuous integration or build machine hitting the button in eclipse. 你将很难在eclipse中持续集成或构建机器按下按钮。
your ant build script will be put into source control which will prevent changes in your eclipse settings from causing changes in the ouput of your project. 您的ant构建脚本将被放入源代码控制中,这将阻止您的eclipse设置更改导致项目输出的更改。 You're also going to have consistency when others build your code - especially with different IDEs. 当其他人构建您的代码时,您也将保持一致性 - 尤其是在使用不同的IDE时。

I do like ant, but it's not 'the right way'. 我喜欢蚂蚁,但这不是“正确的方式”。 maven and gradle are both worth exploring. maven和gradle都值得探索。

Ant, or Maven maybe (building and managing the project). Ant或Maven可能(构建和管理项目)。 This would be preferred, because it could then be run on a Continuous Integration server like Jenkins. 这将是首选,因为它可以在像Jenkins这样的持续集成服务器上运行。

Other than that it would be easier to use another IDE like Netbeans if you would want that. 除此之外,如果你想要的话,使用像Netbeans这样的另一个IDE会更容易。

Maven might need some plugin for what you are doing, so I'd check on that before considering it. Maven可能需要一些插件来处理你正在做的事情,所以在考虑之前我会检查一下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM