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 216000 - Run, Build, Clean on Maven EAR project should do action on -web and -ejb sub project as well
Summary: Run, Build, Clean on Maven EAR project should do action on -web and -ejb sub ...
Status: VERIFIED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Martin Janicek
URL:
Keywords:
: 218807 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-07-26 11:41 UTC by Jiri Skrivanek
Modified: 2012-10-24 14:09 UTC (History)
1 user (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 Jiri Skrivanek 2012-07-26 11:41:41 UTC
If you invoke Run, Build or Clean actions on -ear project node within Maven enterprise application, it executes the action just with -ear project. It has bad consequences that if you change something in -web or -ejb project it is not deployed and old version is deployed on Run. Try the following test case:

- have a GlassFish server registered in IDE
- open new project wizard and select "Maven|Enterprise Application"
- finish wizard with default values (Java EE 6, GlassFish)
- add session bean with business method to mavenproject1-ejb project
- right-click mavenproject1-ear and choose Properties
- in Run category unselect "Deploy on Save" and click OK
- right-click mavenproject1 and choose Build
- right-click mavenproject1-ear and choose Run
- wait until index page is opened in browser at http://localhost:8080/mavenproject1-web (bug 215454)
- open "mavenproject1-web|Web Pages|index.jsp", change body and save file
- again right-click mavenproject1-ear and choose Run
- it opens index page in browser with previous content. It means -web and -ejb sub project are not built when Run action on -ear project is called.
- right-click mavenproject1-ear and choose Clean
- only -ear/target is deleted but not -web/target and -ejb/target
- right-click mavenproject1-ear and choose Run
- browser still opens old page because web module has not been cleaned and built before

Product Version: NetBeans IDE 7.2 (Build 201207171143)
Java: 1.7.0_06-ea; Java HotSpot(TM) 64-Bit Server VM 23.2-b09
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
Comment 1 Martin Janicek 2012-07-30 08:01:37 UTC
Valid problem, similar to the issue 195990. At the moment we don't use any EAR configuration on child sub-projects, but agree that it would be good to have this implemented.
Comment 2 daedalus 2012-09-24 09:40:14 UTC
I strongly disagree! 

We have a very large EAR Project with hundreds of submodules. So a complete build of all submodules would take very long. 

If you change a file in one of your submodules just build the submodule and press "run" on your EAR Project. The EAR Project will be packed with the new submodules and you will see your changes immediately because the EAR project is build before Netbeans deploys it. 

I don't want Netbeans to build all my submodules just because I want the build a current EAR. There is already a "Build with Dependencies" Option on the EAR Projects that does exactly what you want. Maybe just add a "Clean and Build with Depencies" option but please don't change the default operations on the EAR project.
Comment 3 Martin Janicek 2012-10-01 12:38:49 UTC
I have to agree with your deadalus objections, closing as WONTFIX.
Comment 4 ymajoros 2012-10-10 15:15:27 UTC
I opened a similar issue: 218807.

But I don't think saying we need to manually compile is a good solution.

It wasn't like this when my project was an ant project. Change something, hit
"run" and it runs.

I'm not saying everything should be built (not fully, anyway). I'm just saying
"run" should run the current version of my project with its modules. Why does it work (and quite fast) for an ant project? It works with Eclipse, too.
Comment 5 Martin Janicek 2012-10-11 08:12:07 UTC
*** Bug 218807 has been marked as a duplicate of this bug. ***
Comment 6 Martin Janicek 2012-10-11 08:20:10 UTC
(In reply to comment #4)
> I opened a similar issue: 218807.
> 
> But I don't think saying we need to manually compile is a good solution.
> 
> It wasn't like this when my project was an ant project. Change something, hit
> "run" and it runs.
> 
> I'm not saying everything should be built (not fully, anyway). I'm just saying
> "run" should run the current version of my project with its modules. 

Which basically means you would need to recompile all dependent modules. Or
what do you think NetBeans should do when running the EAR project? (I can see
only two options - either compile everything or just compile current project
and try to run it)

> Why does it work (and quite fast) for an ant project? It works with Eclipse, too.

Do not know to be honest (CCing to David to find it out:)). David do you think
how is this implemented in Ant based projects?
Comment 7 Martin Janicek 2012-10-24 11:22:58 UTC
ymajoros maybe your problem is caused by something else - Compile on Save seem to be working incorrectly for some EAR projects (please follow the issue 219916 if you are interested)