|"Java Build Path / Order and Export" propery [message #540753]
||Thu, 17 June 2010 05:22
| vlad.balan Missing name
Registered: June 2010
could somone show an example scenario when the "Order and Export" is useful? The Export part of it.
Doc says "Source folders are always exported, and can not be deselected". This is pretty clear: when this project is added in another project's build path it contributes its classes to that project's classpath. This is the expected behaviour of adding this project to the other's classpath.
But also says that "Exported entries are visible to projects that require the project."
So what happens if checking other entries in this list, besides the projects source folder. Like for example, checking here some other projects that this project depends on, not only its source folders.
When could it be useful?
Is this kind of checking useful when this project is referenced by Java, Web or EAR projects?
And how it should be referenced for the expected effect to happen? As a Java Build Path entry, as a Project References entry or as a Java EE Module Dependecy entry?
[Updated on: Thu, 17 June 2010 05:26]
Report message to a moderator
|Re: "Java Build Path / Order and Export" propery [message #541750 is a reply to message #540753]
||Tue, 22 June 2010 08:22
| Mauro Molinari
Registered: July 2009
Il 17/06/2010 11.22, vlad.balan ha scritto:|
> But also says that "Exported entries are visible to projects that
> require the project."
> So what happens if checking other entries in this list, besides the
> projects source folder. Like for example, checking here projects that
> this project depends on.
> When could it be useful?
Suppose Project A depends on Project B (so it has B in Java Build Path |
Now suppose Project C depends on Project A (so it has A in Java Build
Path | Projects).
In this situation classes in B are not visible in C unless A exports B.
The same applies to JAR files: if A depends on JAR J1 and C depends on
A, C cannot use classes of J1 unless A exports J1 (or C explicitely
depends on J1 too).
> Is it useful for Web or EAR projects?
It's useful just to compose the classpath of a project, but if you are
looking for something that not only contributes to the classpath but is
also deployed with the dependent project, you should better use the Java
EE Module Dependecies page (renamed "Deployment Assemlby" in Helios).
Powered by FUDForum
. Page generated in 0.02827 seconds