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 237528

Summary: Do not use Compile on Save with closed projects
Product: projects Reporter: zdenek.bzoch
Component: MavenAssignee: Milos Kleint <mkleint>
Status: VERIFIED FIXED    
Severity: normal CC: markiewb, mmirilovic, musilt2
Priority: P2    
Version: 7.4   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 244804    

Description zdenek.bzoch 2013-10-23 09:00:09 UTC
Overview:
Compile of Save feature is used, even if the project of my Maven dependency is closed

Steps to Reproduce:
0) Enable compile on save (default from NB 7.4)
1) Have three open projects (one App & two dependencies - dependencyA, dependencyB)
2) Run App from IDE (compile on save is used, classes from dependencyA/target/classes & dependencyB/target/classes are used)
3) Close dependencyB project
4) Run App from IDE

Actual Results:
Compile on save is used, classes from dependencyA/target/classes & dependencyB/target/classes are used

Expected Results:
Only classes from dependencyA/target/classes are used, dependencyB is downloaded from Maven repository (either local or remote).

More Details:
Imagine that you have many projects, in different Git repositories. You are actively developing only small subset of them. But sometimes you need to fix some library, that you aren't developing so often, so you clone its Git, open it, fix it and close it. The library then lives its own life, you aren't even pulling its changes from its Git. After some time, weird NoClassDefFound errors may occur, when running App, and they dissappear, when you pull the dependency changes and build it inside IDE.


Build Date & Hardware:
Product Version: NetBeans IDE 7.4 (Build 201310111528)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 Milos Kleint 2013-10-23 11:18:00 UTC
I agree, limiting to open projects is an improvement over the current setup.

http://hg.netbeans.org/core-main/rev/2cff7bf4cef1

likely a candidate for a patch release if there is one
Comment 2 markiewb 2013-10-23 23:00:12 UTC
(In reply to Milos Kleint from comment #1)
> likely a candidate for a patch release if there is one

Do you like to mark it as 74patch-candidate ?
Comment 3 zdenek.bzoch 2013-10-25 11:09:36 UTC
(In reply to markiewb from comment #2)
> (In reply to Milos Kleint from comment #1)
> > likely a candidate for a patch release if there is one
> 
> Do you like to mark it as 74patch-candidate ?

That would be great. It makes CoS feature unusable and the only workaround is to disable it completely.
Comment 4 Tomas Danek 2013-11-06 14:46:16 UTC
verified in 20131104
Comment 5 Milos Kleint 2013-11-13 10:50:37 UTC
http://hg.netbeans.org/releases/rev/70eb75bcd408
Comment 6 Tomas Danek 2013-11-22 12:42:53 UTC
verified, class is loaded from jar in local repo once project gets closed.

Product Version: NetBeans IDE 7.4 (Build 201310111528)
Updates: NetBeans IDE is updated to version NetBeans 7.4 Patch 1
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Mac OS X version 10.9 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/tomas/Library/Application Support/NetBeans/7.4
Cache directory: /Users/tomas/Library/Caches/NetBeans/7.4