This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 195928 - <resource><directory>.</><includes>...</></> should be ignored
Summary: <resource><directory>.</><includes>...</></> should be ignored
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
: 198020 (view as bug list)
Depends on:
Blocks: 99588 188323 198361
  Show dependency tree
 
Reported: 2011-02-24 09:47 UTC by Jan Lahoda
Modified: 2011-05-23 23:16 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2011-02-24 09:47:45 UTC
[custom build based on 641f8e8ce852, with some testing patches]

Steps to reproduce:
1. Checkout of:
https://svn.apache.org/repos/asf/felix/trunk
revision 1073924
2. Clean userdir, no $HOME/.m2
3. Open trunk/shell, wait until the project is reloaded and scanning finishes.
4. The project's node is marked as erroneous.
5. None of the project's children node is marked with an error badge.
6. Expand the "Other Sources" node - it becomes marked with an error badge.

The source path of the main sources is:
.../trunk/shell/src/main/java
.../trunk/shell/src/main/scala
.../trunk/shell/src/main/groovy
.../trunk/shell/src/main/resources
.../trunk/shell

So the whole project is parsed as a consequence. But, the classpath corresponding to .../trunk/shell does not contain junit, so the tests approached through this source root cannot be successfully parsed, leading to the error badge (which is valid from the Java infra point of view, as it corresponds to the data it gets from the project).

I am not completely sure why why the "Other Sources" node is not marked with an error badge at first, but it appears that it does not ask the annotators to annotate its icon in this case (I have a debug message in AnnotatedAbstractNode.annotateImpl and it is not called in this case). After the node is expanded, it asks the annotators with these files:
.../trunk/shell/src/main/resources
.../trunk/shell
and so the results is that the icon is badged with the error badge (as .../trunk/shell is a source root with errors).
Comment 1 Jesse Glick 2011-02-28 16:36:56 UTC
The problem is in felix/pom/pom.xml:

            <resource>
                <directory>.</directory>
                <targetPath>META-INF</targetPath>
                <includes>
                    <include>changelog.txt</include>
                </includes>
            </resource>

If you comment that out, and use a snapshot parent dep, then the project is fine. I guess resource dirs with an include should be ignored for purposes of ClassPath.SOURCE.
Comment 2 Jesse Glick 2011-05-11 01:20:48 UTC
(In reply to comment #1)
> resource dirs with an include should be ignored for purposes of
> ClassPath.SOURCE.

Rather: resource dirs using targetPath should be ignored for ClassPath.SOURCE and SOURCES_TYPE_JAVA. They may be displayed in the logical view so long as includes are honored (bug #99588).
Comment 3 Jesse Glick 2011-05-11 01:26:12 UTC
(In reply to comment #2)
> SOURCES_TYPE_JAVA

SOURCES_TYPE_RESOURCES, that is.
Comment 4 Jesse Glick 2011-05-11 01:43:32 UTC
core-main #abfecb6424ce
Comment 5 Quality Engineering 2011-05-11 19:40:11 UTC
Integrated into 'main-golden', will be available in build *201105111436* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/abfecb6424ce
User: Jesse Glick <jglick@netbeans.org>
Log: #195928: <resource><directory>.</><includes>...</></> should be ignored
Comment 6 Jesse Glick 2011-05-23 23:16:13 UTC
*** Bug 198020 has been marked as a duplicate of this bug. ***