eclipse - 最佳实践 : sharing files between projects in Eclipse

标签 eclipse projects-and-solutions workspace

我正在使用 Eclipse (Helios 3.6.2) 和 Android SDK。

有没有办法在不使用符号链接(symbolic link)的情况下完成此任务?

Template Project: this is the "Main" Project. All other projects will derive from this. 
- src
  - A.java
  - B.java
- layout
  - j.xml
  - l.xml
- drawable
  - x.png
  - y.png


Customer 1 Project:
- src
  - A.java (from template)
  - B.java (not from template. custom file used only in this project)
- layout
  - j.xml  (from template)
  - l.xml  (not from template. custom file used only in this project)
- drawable
  - x.png  (from template)
  - y.png  (not from template. custom file used only in this project)


Customer 2 Project:
- src
  - A.java (from template)
  - B.java (from template)
- layout
  - j.xml  (from template)
  - l.xml  (from template)
- drawable
  - x.png  (not from template. custom file used only in this project)
  - y.png  (not from template. custom file used only in this project)


Customer "N" Project:
  and so on with many combinations of using/not using from template...
  (This is for illustration only. My real projects have hundreds of files of course)

我是 Eclipse 的新手。在 VisualStudio 中,我可以通过引用添加文件来做到这一点。我在 Eclipse 中找不到类似的东西。

最佳答案

您可以提供项目引用,但我认为这不是您正在寻找的。所以这里有一个简短的解释: 您当前的工作区中必须有Customer 1 ProjectTemplate Project。然后在Package Explorer中右键单击Customer 1 Project并选择Build Path ->Configure Build Path...这里转到项目 选项卡并选择添加...。在此处选择您的模板项目

如果来自 Customer 1 ProjectB.javaTemplate Project 位于同一个包中(它可能是)。因此您必须为该类选择另一个名称。

关于eclipse - 最佳实践 : sharing files between projects in Eclipse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8257229/

相关文章:

java - 我无法运行java应用程序

c# - 如何打开之前下载的项目?

c# - 将 C# 解决方案中的嵌入式资源存储在 *.zip 存档中是否有效?

jenkins - 如何在 Jenkins 上更改工作区并构建记录根目录?

java - Eclipse 的工作区 : Shall I put my images in 'src' or 'bin' folder?

java - Eclipse 插件外的 Eclipse 工作区引用

java - Eclipse显示奇怪的[DEBUG],我想禁用它

java - 如何 : install JOGL for Eclipse in Mac OSX 10. 6?

java - 使用包含在 testng 中断言

visual-studio-2008 - 关于 Visual Studio 解决方案文件中的前导换行符