Thanks Fred.
I refactored WebUtils.getWebRootFolders().
Now it eliminates derived folders and in case of availability of new WTP 3.3.1 API it also puts the default root folder to the very beginning of the list.

On 09/20/2011 03:44 PM, Fred Bricon wrote:
- You'd better check if the folder is not derived (cause it doesn't need 
to be target/*) to get a valid candidate (maven's build output directory 
is derived)
- WTP 3.2.5/3.3.1 introduces a new tag="defaultRootSource" attribute for 
virtual folders in .component (see the upstream change in 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=121460 and its attached 
patch : https://bugs.eclipse.org/bugs/attachment.cgi?id=201282&action=diff)
If you can't lock down the WTP version, you can call the new API using 
reflection like : 
https://github.com/sonatype/m2eclipse-wtp/commit/96acdcafaa233ebf00d3eb8dac00fe7f0d21d616#L5R560

HIH

Fred Bricon

On 21/09/2011 00:35, Alexey Kazakov wrote:
Hi guys!

We keep bumping into issues with multiple web root folders for mavenized
projects.
The resent ones are found by Max in VPE.
There are a few places where we have to handle multiple web roots: code
completion, validation, openOns, VPE, ...
In most cases it's enough just to look at all the roots but in some
cases we should avoid looking at target folder. For instance it's better
not to use "target" folder in validation.
So far we have to hardcode "target" name and don't use it when it's
critical. But of course it's not a perfect solution.
No we have a utility method
org.jboss.tools.jst.web.WebUtils.getWebRootFolders(IProject project,
boolean ignoreTarget) which we use to get all the relevant roots.
Fred, Rob, do we have any way to distinguish such a folder?
_______________________________________________
jbosstools-dev mailing list
jbosstools-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jbosstools-dev
_______________________________________________
jbosstools-dev mailing list
jbosstools-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jbosstools-dev