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 218807 - running an ear project seems to be broken
Summary: running an ear project seems to be broken
Status: RESOLVED DUPLICATE of bug 216000
Alias: None
Product: javaee
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.2
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Assignee: Martin Janicek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-22 06:50 UTC by ymajoros
Modified: 2012-10-11 08:12 UTC (History)
0 users

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 ymajoros 2012-09-22 06:50:42 UTC
I have a maven EAR project (EJB + 2 WARs + parent pom). 

To run or debug it with latest WAR changes, I always need to clean/build the parent pom, then the EAR. 

I think I should be able to run the EAR by just clicking 'run' on it. Or is it already like this and is my setup wrong?

I tried with a fresh EAR project with similar results.
Comment 1 Martin Janicek 2012-09-24 07:52:28 UTC
(In reply to comment #0)
> I think I should be able to run the EAR by just clicking 'run' on it. Or is it
> already like this and is my setup wrong?

Well this should normally work exactly as you're describing. Not sure if it could be caused by your setup until I'll see the problematic project. Would it be possible to attach it?

> I tried with a fresh EAR project with similar results.

By the fresh EAR you mean newly created project with no changes? I've just create one and after making changes in the index.jsp it was successfully redeployed to the glassfish server. (the true is that you need to build with dependencies before the first run, but after that no more builds on parent pom should be necessary)

Could you confirm this behavior? Or if not, please attach the 'fresh EAR project' you are speaking about. Thanks in advance
Comment 2 ymajoros 2012-09-24 10:58:59 UTC
I'll try to "build with dependencies" first, then. I seemed it was the same maven target, so I assumed it would do the same anyway. Isn't it like that?

If unsuccessful, I can send the project somewhere, as long as it remains private (can't attach it publicly here).
Comment 3 ymajoros 2012-09-24 15:37:38 UTC
Tried this:

1) added some garbage to a java file in war in order for it to fail compilation
2) "build with dependencies" fails (cool, this is expected)
3) "build" succeeds (I guess it takes the dependency from local maven repo)
4) "debug" succeeds

I'd expect 3) and 4) to fail
Comment 4 Martin Janicek 2012-10-10 14:16:02 UTC
(In reply to comment #2)
> I'll try to "build with dependencies" first, then. I seemed it was the same
> maven target, so I assumed it would do the same anyway. Isn't it like that?

Not sure I'm catching your point ;) .. there is a big difference between "build" (compile only sources for the specific project) and "build with dependencies" (builds the project + all each project/module that the project depends on)

> If unsuccessful, I can send the project somewhere, as long as it remains
> private (can't attach it publicly here).
Comment 5 Martin Janicek 2012-10-10 14:30:43 UTC
Ah, or maybe I understand:). Could you please take a look at issue 216000? There were a discussion about whether Run/Build action on EAR project should be also propagated on their sub-projects. At first I was thinking that it should, but the strong argument against it was that if you have project with more than 100 sub-projects and you don't want to build each of them every time when trying to run the project.
Which is basically why do we have "Build with dependencies" for cases when you need to build everything and "Build" for the typical cases when you are changing only one module.

Isn't this an answer to your question? :) ..it would explain your comment 3, because your point 3 and 4 can be proceed without problem when using on the EAR project (it does not compile sub-war-project)
Comment 6 ymajoros 2012-10-10 15:11:49 UTC
Well, my problem looks like 216000.

But I don't think saying I 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.
Comment 7 Martin Janicek 2012-10-11 08:12:07 UTC

*** This bug has been marked as a duplicate of bug 216000 ***