简体   繁体   English

有没有办法从Java Eclipse项目导出Makefile?

[英]Is there a way to export a Makefile from a Java Eclipse project?

So I have this Java project made up of several classes, some external JAR files and an executable Java program. 所以我有这个Java项目由几个类,一些外部JAR文件和一个可执行的Java程序组成。 I would like to export the whole code and external JARS to an external directory and to produce a Makefile to build the program with all the dependencies. 我想将整个代码和外部JARS导出到外部目录,并生成一个Makefile来构建包含所有依赖项的程序。 Is there an automated way to do it? 有自动化的方法吗?

Thank you 谢谢
Tunnuz Tunnuz

I think I understand the question. 我想我理解这个问题。 Of course if you use an external build system like maven or ant, then we are decoupling the build process from the IDE. 当然,如果您使用外部构建系统(如maven或ant),那么我们将构建过程与IDE分离。 (But in some cases the IDE does integrate pretty closely with the build tool.) (但在某些情况下,IDE确实与构建工具紧密集成。)

But if you want to continue building using eclipse and to generate an ant file one fine day, then there is a tool for that. 但是如果你想继续使用eclipse进行构建并在一天之内生成一个ant文件,那么就有了一个工具。 Its called EBuild . 它叫做EBuild It leverages all the classpath information that eclipse already has and builds an generic ant file out of it. 它利用了eclipse已经拥有的所有类路径信息,并从中构建了一个通用的ant文件。

Do you use maven ? 你用maven吗? If so this can be easily achieved with maven assembly. 如果是这样,这可以通过maven组装轻松实现。

If not, you can use ant to bundle exactly what you need. 如果没有,您可以使用ant来准确地捆绑您需要的内容。

When you right-click your project in Eclipse, there is an option called "Export". 在Eclipse中右键单击项目时,会出现一个名为“Export”的选项。 It can create build.xml for ant for your project. 它可以为您的项目创建ant的build.xml。

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

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