Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » ClasspathContainer not being observed for dependencies
ClasspathContainer not being observed for dependencies [message #251284] Wed, 06 February 2008 17:36 Go to next message
Eclipse UserFriend
Hello,

We have several large Eclipse projects that have a dependency on each
other. Project A depends on Project B, B on C, and so on. Each project
gets published as it's own JAR (A.jar, B.jar, etc.)

To make it so developers do not need to have all projects open at once, I
am creating a classpath container comparable to the PDE Required Plugins
container. If project B is open in the workspace, project A will depend
on that project, if B is not open, project A will depend on the JAR
contents of project B.

I examined the org.eclipse.pde.core plugin to see how they do it, and a
classpath container seems the trick. I have created my plugin and it
successfully tracks whether the project or it's JAR should be in the
classpath.

When I expand the contents of this classpath container via Package
Explorer view, I can see that it toggles correctly if the dependency
project is open or if it should use point to the jar.

Things compile just fine until I decide to close Project B. At that
point, I see my classpath container references B.jar (and no longer
project B), but I still get build errors to the effect "The project was
not built due to "Resource /B is not open"...

Again, the classpath container clear no longer has the project in the
classpath. It is clearly pointing to B.jar (I did step through
debugging), but something seems to have cached that dependency
relationship and is not observing what the classpath container says at
that point in time.

Am I missing something?
Re: ClasspathContainer not being observed for dependencies [message #251314 is a reply to message #251284] Fri, 08 February 2008 09:28 Go to previous message
Eclipse UserFriend
James Leone wrote:
> Hello,
>
> We have several large Eclipse projects that have a dependency on each
> other. Project A depends on Project B, B on C, and so on. Each project
> gets published as it's own JAR (A.jar, B.jar, etc.)
>
> To make it so developers do not need to have all projects open at once,
> I am creating a classpath container comparable to the PDE Required
> Plugins container. If project B is open in the workspace, project A
> will depend on that project, if B is not open, project A will depend on
> the JAR contents of project B.
>
> I examined the org.eclipse.pde.core plugin to see how they do it, and a
> classpath container seems the trick. I have created my plugin and it
> successfully tracks whether the project or it's JAR should be in the
> classpath.
>
> When I expand the contents of this classpath container via Package
> Explorer view, I can see that it toggles correctly if the dependency
> project is open or if it should use point to the jar.
> Things compile just fine until I decide to close Project B. At that
> point, I see my classpath container references B.jar (and no longer
> project B), but I still get build errors to the effect "The project was
> not built due to "Resource /B is not open"...
>
> Again, the classpath container clear no longer has the project in the
> classpath. It is clearly pointing to B.jar (I did step through
> debugging), but something seems to have cached that dependency
> relationship and is not observing what the classpath container says at
> that point in time.
>
> Am I missing something?
It sounds like a bug. You should enter a bug report against JDT/Core.
Don't forget to include the build number and steps to reproduce. For
example, a small plugin defining a classpath container similar to yours
would help.

Jerome
Previous Topic:escaping string literals
Next Topic:Unbound classpath container: 'Default System Library'
Goto Forum:
  


Current Time: Thu Apr 24 23:55:15 EDT 2025

Powered by FUDForum. Page generated in 0.02663 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top