简体   繁体   English

Eclipse-项目引用另一个项目而不是.jar文件

[英]Eclipse - Project Referencing another Project instead of .jar File

I have a Java project in eclipse: 我在Eclipse中有一个Java项目:

Project A contains an Ivy dependency on Project B . Project A包含对Project B的常春藤依赖。

Locally, I checked out and made changes to Project B . 在本地,我签出并对Project B进行了更改。 I then wanted to test the new functionality from Project B in Project A , so I added Project B as a project dependency of Project A by adding it to the Java Build Path (Java Build Path->Projects->Add...). 那么我想从测试新的功能Project BProject A ,所以我加了Project B作为项目依赖Project A将它添加到Java构建路径(Java构建路径- >项目- >添加...)。

I no longer wish to have that dependency on Project A , but simply removing it from the Projects Build Path hasn't worked. 我不再希望对Project A具有这种依赖性,但是仅仅从Projects Build Path中删除它并没有起作用。 With that dependency removed, I would expect that any references to the new local code would result in a syntax error, since those changes have not been incorporated into a new artifact for Ivy to pull in. 删除该依赖项后,我希望对新本地代码的任何引用都将导致语法错误,因为这些更改尚未合并到Ivy可以插入的新工件中。

How can I remove any references to Project B from Project A ? 如何从Project A删除对Project B任何引用? I've tried deleting both projects and re-checking them out and that did not work. 我尝试删除两个项目,然后将它们重新签出,但没有用。

The way to resolve this issue is to: 解决此问题的方法是:

  1. Close Project B in eclipse. 在月食中关闭Project B
  2. On Project A run Project-Clean Project A运行Project-Clean
  3. Resolve Ivy dependencies on Project A 解决常春藤对Project A依赖

Now the dependencies from Project B should use the Ivy artifact rather than the local changes. 现在,来自Project B的依赖项应使用Ivy工件而不是本地更改。

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

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