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 243879 - pom projects and findbugs - no classes found exception (compile on save)
Summary: pom projects and findbugs - no classes found exception (compile on save)
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-17 07:22 UTC by toben
Modified: 2016-07-07 08:38 UTC (History)
0 users

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 toben 2014-04-17 07:22:20 UTC
If I activate your "compile on save" feature using a maven - java project. Netbeans creates within my pom - project (<packaging>pom</packaging>) the following folder structure:

target/classes
   .netbeans_automatic_build
target/test-classes
   .netbeans_automatic_build

As I said, it is a pom (my root project). There are no sources. So this seems to be a bug.

The real problem is, that FindBugs does not differe between pom and jar packaged projectes. It simply looks for classes and test-classes folders. FindBugs stops with this exception:

... Can not execute Findbugs: Findbugs needs sources to be compiled. Please build project before executing sonar and check the location of compiled classes.

The problem is definitly due to the existing classes and test-classes folders. If I deactivate "compile on save" for my pom project. The folders are not generated and Findbugs works as expected.
Comment 1 toben 2014-04-17 08:23:21 UTC
As for now I am not anymore sure about the findbug failure. I updated Sonar to 4.2 and it seems to be an official problem with this release.

Nevertheless IMHO the directory structure is not correct for a pom - project.
Comment 2 Milos Kleint 2014-04-20 15:41:10 UTC
having a target/classes folder present in itself should in no way be harmful, if it is I would suggest it's the fault of sonar/findbugs. 
It could be argued that sonar/findbugs should also know about the pom packaging and avoid reading target/classes there.

In general I cannot really make any assumptions about what project packagings are containing what content, the project configuration we read is everywhere the same. I could for sure do it for pom packaging alone, but I'm not convinced that's the correct approach.
Comment 3 Martin Balin 2016-07-07 08:38:12 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss