简体   繁体   English

在Eclipse中的其他用户库中添加用户库

[英]Adding User Libraries in another user libraries in eclipse

GIVEN: 给予:
I have one User library as "PrimaryLib" which contains 9 jars, then I created "SecondaryLib" user library which contains 3 jars. 我有一个用户库,其中包含9个jars,作为“ PrimaryLib”,然后创建了包含3个jars的“ SecondaryLib”用户库。

My Question: 我的问题:
Now I want to add PrimaryLib in SecondaryLib so that my SecondaryLib user library will have total 12 jars(I don't want to select those 9 jars again, I want to just select PrimaryLib user library), How to do that? 现在,我想在SecondaryLib中添加PrimaryLib,以便我的SecondaryLib用户库总共有12个jar(我不想再次选择这9个jar,我只想选择PrimaryLib用户库),该怎么做?

Not sure if "libraries" is the "answer" to your situation. 不知道“图书馆”是否是您所处情况的“答案”。

You could control that using project exports - you have a central project that uses both libraries; 您可以使用项目导出来控制-您有一个使用两个库的中央项目; and you define its export to show all 12 JARs. 并定义其导出以显示所有12个JAR。

Then other users just "include" that project, and they are happy to go. 然后其他用户只是“包含”该项目,他们很高兴继续前进。 And when you add another library, or want to change the exported JARs ... you just change your project setup. 而且,当您添加另一个库或要更改导出的JAR时,只需更改项目设置即可。

In other words: for eclipse, quote A user library is a set of JAR files . 换句话说:对于eclipse,请引用用户库是一组JAR文件 Meaning: a library contains JARs - not other libraries. 含义:一个库包含JAR,而不是其他库。

If you want to "provide" a certain set of JARs, that should be "accessible" together, than the easiest way to get there is to 如果您要“提供”一组特定的JAR,应该可以一起“访问”,而最简单的方法是:

  1. Create a new project; 创建一个新项目; and in the "Build path settings" of that new project: 并在该新项目的“构建路径设置”中:
  2. Add those libraries to the project that you are interested in 将那些库添加到您感兴趣的项目中
  3. Select those JARs on the "order and export" page 在“订购和出口”页面上选择那些JAR

And now, you can use that add that new project as dependency to all those projects that are need for those JARs. 现在,您可以使用该添加新项目作为对那些JAR所需的所有那些项目的依赖。

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

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