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 163509 - Maven Incorrectly undeploying webapp
Summary: Maven Incorrectly undeploying webapp
Status: RESOLVED DUPLICATE of bug 96587
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Infrastructure (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: Petr Hejl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-23 15:46 UTC by jodeen
Modified: 2009-05-05 14:05 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sample Maven projects reproducing issue (16.69 KB, application/x-compressed)
2009-04-23 16:00 UTC, jodeen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jodeen 2009-04-23 15:46:21 UTC
I have two maven POMs they both have one child module defined named "server" (but each with a unique artifact id).
When I deploy the first one to my glassfish (v2) server it deploys with no problems.  When I try to deploy the second
one, it undeploys the first one, and then deploys the second one.

If I change the name of the child modules in the POMs (and change the corresponding directory name) both deploy properly.
Comment 1 jodeen 2009-04-23 15:47:21 UTC
I've tested this on 6.5 and 6.7M3.
Comment 2 jodeen 2009-04-23 15:59:39 UTC
Attaching two sample maven projects to replicate this:
1. Open both projects and their required projects.  You should now have 4 projects "Test Project One (pom)", "Test
Project Two (pom)", "test.one.server-one Maven Webapp (war)", "test.two.server-two Maven Webapp (war)"
2. Run the "test.one.server-one" project and target a Glassfish server
3. In the Services window, in the "Web Applications" folder of the glassfish servers should now show "Test_One"
4. Run the "test.two.server-two" project and target the same Glassfish server
5. In the Services window, in the "Web Applications" folder of the glassfish server ONLY shows "Test_2"
Attempting to go to http://localhost/Test_One/ shows that the Test_one web-app is no longer deployed.

6. Go to the "test.two" folder and change copy the "server" folder to a folder called "server2"
7. Update the test.two/pom.xml and change the module to be "server2"
8. Undeploy the "Test_2" web-app from glassfish
9. Close the existing "test.two.server-two Maven Webapp (war)" project
10. Open the "test.two/server2" pom as a project
11. Run the "test.one.server-one Maven Webapp (war)" project targeting a glassfish server.
12. The services tab shows that the "Test_One" app was deployed properly
13. Run the new "test.two.server-two Maven Webapp (war)" project and target the same glassfish server.
14. The services tab now shows that both the "Test_One" and "Test_2" web apps are deployed.

Comment 3 jodeen 2009-04-23 16:00:37 UTC
Created attachment 80781 [details]
Sample Maven projects reproducing issue
Comment 4 Milos Kleint 2009-04-24 10:00:23 UTC
it seems to apply to tomcat as well, not only glassfish. I haven't tested with more servers.

reassigning to j2eeserver support, I haven't found any instance in maven projects where we would return the project
folder as identifier of any sorts, we always use artifactId or a groupId+artifactId+version combo.

It has to be noted though, that a recommended setup for maven projects is to have the project folder name matching the
artifactId, but it's definitely not mandatory.
Comment 5 Petr Hejl 2009-05-05 14:05:01 UTC

*** This issue has been marked as a duplicate of 96587 ***