Community
Participate
Working Groups
It would be great to be able to define that classes from a source folder should not be exported to other projects (Java Project->Properties->Order and Export page). This is specially relevant now that we have the ability to define different output folder. A typical scenario is to generate all the test classes in a specific folder but making them only local to the current project.
Source folders are implicitly exported as a whole to dependent projects. If you output to a specific folder, you may simply want to include this one folder as a class folder on the classpath of the dependent project. Does this do the trick ?
I don't think so and I guess I haven't explained myself properly... Let me try to do it again with an example. Consider this workspace jp1 (java project) - src (source folder) ... - src.test (source folder for test classes) ... - bin (default output) ... - bin.test (output for the test classes) jp2 (another Java project that depends on jp1) ... What I would like to do is to avoid the test classes from src.test to be available to jp2. Before M4 this would be probably impossible but now that we can specify different output folders I think this is quite easy (all Eclipse needs to do is to let the bin.test folder out of the jp2's classpath). If you agree that this is a nice feature I would recommend to present the output folders instead of the source folders in the last page of the Java Project properties.
Why don't you prereq "/jp1/bin" as a class library folder from jp2 build path ? Hiding project internals to dependent projects would be a nice enhancement. I am not convinced it should use output folders as the granularity, but rather exclusion patterns (thus I could hide '**/internal/**' to my dependents, or you could hide tests in a similar fashion). We have an open item for this already.
The idea would be to have jp1/bin as a class library folder to jp2 but *not* jp1/bin.test which would be restrict to jp1. Definitely we could mimic this using exclusion patterns, but I would rather generate all my "private" plugin classes into separate output folders defining that those folders are not exported. This would be aligned to the metaphore used by the plugins - in the runtime section of the plugin.xml we can define jars that are used by the plugin but not exported.
Will consider addition of exclusion filters to dependent projects at a later stage.
Should be fixed when bug 29865 is fixed.
*** This bug has been marked as a duplicate of 29865 ***
This feature would be particularly useful for Maven or other strategies that contain restrictions about what get exported to whichever project (so restriction on the "client" project don't work) and in a source folder granularity (not package). I agree with the initial report: the checkboxes on the Export tab should be editable by the end-user or a 3rd party plugin (such as m2e). If the output folder is important, we can simply go for the convention that all source folders compiling into the same output folder should have the same state regarding export/import.
The use case of test sources can be handled by the changes for bug 224708. For other cases, please create fresh, focused bugs if necessary. *** This bug has been marked as a duplicate of bug 224708 ***