How Do I Automatically Generate A .jar File In An Eclipse Java Project

前端 未结 5 1740
失恋的感觉
失恋的感觉 2020-12-04 16:22

I have an Eclipse Java project. It contains a folder named \"dist\". In that folder is a .jar file.

How can I set things up in this project to make sure th

5条回答
  •  情书的邮戳
    2020-12-04 17:09

    Create a J2EE Utility project (Util). It lets you create an association with a J2EE project (ProjectX). When you edit the properties of ProjectX to depend upon the Util project, it shows Util as Util.jar. With the dependency declared, Eclipse will build the Util.jar when it has to build the Util project. If you have auto-build active for the Util project, the .jar file will be kept in sync each time the project is built. If your target project isn't a J2EE one, you can still use this solution but use a dummy J2EE parent project.

    Here is the link to the help page for using the ANT task for building a .zip file from within Eclipse: http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.pde.doc.user/tasks/pde_feature_generating_ant.htm

    An alternate solution is to use the Zip plugin. We used this over 5 years ago but stopped when WSAD included support for dependent projects as .jar files.

提交回复
热议问题