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.
This is an extremely annoying bug. I also suspect it's a regression because it used to work in (recent) dev builds. Repro steps: 1. Create a Maven web project 2. Create multiple projects in the POM file 3. Set the current profile to FOO (where FOO is anything other than <default>) 4. Project -> Properties -> Run -> Server -> No server selected 5. Project -> Properties -> Actions -> Configuration = FOO -> Execute Goals: "jetty:run", Set Properties: "netbeans.deploy=true" 6. Run the main project 7. Netbeans will prompt "Select deployment server". 8. Select "Ignore, I don't want IDE managed deployment" and click OK 9. The project runs. 10. Bug #1: Notice how the active configuration changed from FOO to <default>. 11. Stop execution and go to step 6. 12. Bug #2: Notice how the dialog from #7 pops up again (Netbeans forgets your settings).
Created attachment 109890 [details] Testcase
Here are simpler repro steps: 1. Open the attached testcase project 2. Set Configuration to windows-i386-vs10-debug 3. Run the project 4. Select "Ignore, I don't want IDE managed deployment" and click OK 5. Notice how "configuration" jumps back to "<default>" 6. Notice how you have to select "Ignore, I don't want IDE managed deployment" if you run again.
I've reproduced this issue in Netbeans 7.0.1 final and 7.1 dev build 201108080600. Also, it's worth noting that the Maven project doesn't need to actually list the Jetty artifact as a dependency. It's sufficient to refer to the "jetty:run" goal.
Please try to give a more specific summary for new bugs.
You're right... I'll try to do a better job next time.
David, Any chance we can make this feature more consistent? Perhaps add a full-fledged "server" that users can select off "Project Properties -> Run -> Server" whose name is "Maven Server"?
Jesse, I think the problem here is in the maven module itself. o.n.m.maven.j2ee.ExecutionChecker.removeNetbeansDeployFromActionMappings() tries to remove a property in currently selected configuration but it cannot because there is no API for that. I started fixing this by adding public static NetbeansActionMapping getActiveMapping(String action, Project project, AbstractMavenActionsProvider config) { return ActionToGoalUtils.getActiveMapping(action, project, config); } to o.n.m.maven.api.customizer.ModelHandle and using it but that is still not enough. o.n.m.maven.spi.customizer.ModelHandleUtils.createModelHandle(Project) seems to ignore configurations as well. If my assessment is wrong pass it back please but it looks to me like maven.ee should just call something to persist server selection in active configuration.
(In reply to comment #6) > Any chance we can make this feature more consistent? Perhaps add a full-fledged > "server" that users can select off "Project Properties -> Run -> Server" whose > name is "Maven Server"? Sorry, I have absolutely no resources for that. But please file an issue requesting that and provide as much background and motivation for such feature as you can. I hope we soon get somebody to help with Maven.
Workaround for this bug is to just remove <netbeans.deploy>true</netbeans.deploy> from the nbactions-*.xml. (Works to do this from the Actions panel.) A possibly related problem is that selecting a configuration from the Actions panel has no effect. Who knows how long that has been broken. The action mapping / configuration code is rather complicated and did not originally come with any tests whatsoever.
Seems that ModelHandleUtils was unofficially deprecated but not actually replaced. I will kill it off. (In reply to comment #9) > A possibly related problem bug #201052
core-main #fcb2965c9226
> Sorry, I have absolutely no resources for that. But please file an issue requesting that and provide as much background and motivation for such feature as you can. I hope we soon get somebody to help with Maven. Done: bug #201054
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/fcb2965c9226 User: Jesse Glick <jglick@netbeans.org> Log: #200772: "Ignore, I don't want IDE managed deployment" resets active config to default
Possible candidate (and issue 200982) for 7.0.1 patch 1?
I do not think this is a great candidate for a patch update; it was a significant refactoring, including some incompatible changes to friend APIs. Rewriting it to use only compatible changes would require some extra work. Anyway the workaround is trivial. As far as bug #200982, I am nervous about putting such a complicated change of synchronization into a patch update since it is very hard to be sure it is right and does not introduce race conditions. Do you think the deadlock occurs commonly?
Make sense what you say Jesse. The deadlock happened to me always when I tried to reproduce the test case. But obviously it never happened to other people otherwise it would be filed and fixed already.
(In reply to comment #16) > obviously it never happened to other people > otherwise it would be filed and fixed already. Not sure. The deadlock I got had no visible UI manifestation, since the EDT was not involved. Even if the EDT does freeze, we have no reliable reporting infrastructure for that (see TimableEventQueue for the current modest attempt at recovering when a CLI command is invoked on a hung IDE), so a lot of such freezes may go unreported.
In my case UI froze. Always.
Mark it as a patch candidate if you think it is needed; a code review would be appreciated. Comments to go into that issue.
Jesse, What is the impact of removing <netbeans.deploy>true</netbeans.deploy>? What does this property do?
PS: I keep on running into UI deadlocks following the steps in comment #2 (about 20% of the time). I'm not sure if it's related to bug #200982 but if it is then +1 for adding it into patch 1.
(In reply to comment #20) > What is the impact of removing <netbeans.deploy>true</netbeans.deploy>? What > does this property do? Deploys to an IDE-configured server. When you click "Ignore..." you are asking the IDE to remove this property. (In reply to comment #21) > I keep on running into UI deadlocks following the steps in comment #2 > (about 20% of the time). I'm not sure if it's related to bug #200982 Check thread dumps and check in a dev build with the purported fix. Put comments on this topic in bug #200982, not here.
Verified fix in NetBeans IDE Dev (Build 201108190601).