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 244804 - Do not use Compile on Save with closed projects
Summary: Do not use Compile on Save with closed projects
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Tomas Stupka
Depends on: 237528
  Show dependency tree
Reported: 2014-05-30 09:04 UTC by zdenek.bzoch
Modified: 2014-07-15 14:36 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description zdenek.bzoch 2014-05-30 09:04:46 UTC
I encounter the same problems with NetBeans 8.0 patch 1.1

Also some class not found errors appear in the new version.

It seems that NetBeans remember, that I had some project opened and it tries to search the compiled classes in its directory, instead of using the JAR from Maven repository. 

This is extremely painful, when you sometimes open source code of some commonly used project like Hibernate ORM - I definitely don't want NetBeans to try using compiled classes from a local copy.

+++ This bug was initially created as a clone of Bug #237528 +++

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 Tomas Stupka 2014-06-13 13:09:23 UTC
i was able to reproduce as described in the scenario above but only with 7.4 (maven 2.86.1). 
After running an update (maven 2.86.3) the problem was gone and neither did it appear in 8.0 (1.1, maven 2.103.1) or in the current daily builds.

there seems to be more to the issue.

please check the version of the maven module in the builds where you are able to reproduce

what kind of maven projects are we talking about - plain java projects, or maybe a web app ?

anything else?
Comment 2 Tomas Stupka 2014-07-15 14:36:43 UTC
any update on this?