开发者

Eclipse: Is there a way to create dependencies between source folders?

开发者 https://www.devze.com 2023-02-23 07:10 出处:网络
I have a Web Project with two source folders in Eclipse. Folder A, depends on Folder B being compiled. Is there a way to create this dependency in Eclipse, without having to create separate projects f

I have a Web Project with two source folders in Eclipse. Folder A, depends on Folder B being compiled. Is there a way to create this dependency in Eclipse, without having to create separate projects for each fold开发者_如何学JAVAer? I know projects can be set up to depend on one another, but I am not looking to do that.


The eclipse compiler automatically manages dependencies at the source level within all source folders of a project, you don't have to do anything special.

Edit: You answer "you would not be able to have Folder B reference classes in Folder A" to a comment - that's kinda the opposite of a dependency. And no, I'm pretty sure you cannot enforce that within a single eclipse project.


You can create a ant task to do that for you


You can have two programs in the same Eclipse project, with two separate main methods. You can then make two separate Run Configurations.

Before running you can then build the project. Building the project will automatically build both programs in the project, so you wont have to remember to manually build your second program.

0

精彩评论

暂无评论...
验证码 换一张
取 消