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 245155 - Broken sources after creating HTML+Java project for the first time
Summary: Broken sources after creating HTML+Java project for the first time
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 8.0.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on: 246147
Blocks:
  Show dependency tree
 
Reported: 2014-06-20 11:15 UTC by Jaroslav Tulach
Modified: 2014-08-23 04:54 UTC (History)
2 users (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 Jaroslav Tulach 2014-06-20 11:15:58 UTC
I believe this is something between Java/Maven and possibly also my usage of it. If you install HTML/Java Project support (rev. 2.1) into NetBeans 8.0 (from its official plugin portal update center) you get a new project wizard. Once you use it you get a project which contains a lot of errors. This is unfortunate, the IDE should know the project is not yet compiled and does not have full set of dependencies and should delay its processing.

To reproduce:
0. Cleanup your local Maven repository:
  $ rm -r ~/.m2/repository/org/netbeans/html/ 
  $ rm -r ~/.m2/repository/org/apidesign/html/
1. get NetBeans 8.0
2. visit Tools/Plugins/Available ones/ and install HTML/Java Project support
3. Use New Project and select HTML5 category and HTML project with Java logic
4. click through the wizard and select Finish

Once the project is opened in the list of projects and once the background scanning finishes, there are errors reported (can see both source files and both test files showing an error badge in the projects view).

If I do

5. clean/build on the project

the errors may go away (today the disappeared, I remember few situations when they didn't). But it is unfortunate newly generated project is marked as erroneous - there should be a way around that.
Comment 1 Jaroslav Tulach 2014-06-20 11:18:01 UTC
As a possible solution I'd like to remind my proposal to have "essential ClassPath elements" and the Maven support marking all its JARs inside local maven repository as necessary. Java support would then disable any compilation attempts when essential cp element was missing.
Comment 2 Tomas Zezula 2014-06-20 11:54:12 UTC
As far as I remember Milos did some changes into Mvn Project to support it without a need of a new API (the broken cp should not be registered into GPR).
We need to investigate what's already done.
Comment 3 Jaroslav Tulach 2014-07-14 15:03:32 UTC
Will GPR help with a file opened in an editor? I had a feeling such file's classpath is constructed and used regardless if it is in GPR or not.
Comment 4 Tomas Zezula 2014-07-14 16:49:16 UTC
Yes, classpath is constructed but it's translated by java source to empty classpath unless the root is scanned (was registered in GPR).
Comment 5 Tomas Zezula 2014-07-30 20:42:02 UTC
I've attached a patch to API review #246147.
Comment 6 Tomas Zezula 2014-08-21 12:05:44 UTC
Fixed jet-main 82910b5636e9
Comment 7 Quality Engineering 2014-08-23 04:54:56 UTC
Integrated into 'main-silver', will be available in build *201408230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/82910b5636e9
User: Tomas Zezula <tzezula@netbeans.org>
Log: #245155:Broken sources after creating HTML+Java project for the first time