History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-26535
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Normal Normal
Assignee: Anton Makeev
Reporter: M.J.Milicevic
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

Maven ear packaging: creating invalid application.xml and more

Created: 05 Apr 08 16:10   Updated: 17 Jun 08 17:18
Component/s: Maven Integration
Fix Version/s: Selena 7.0.4, Diana 8375

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Zip Archive idea-sample.zip (24 kb)

Environment: linux

Build: 7,782
Fixed in build: 8,366


 Description  « Hide
Below some bugs/feedback (and some frustration )

In a project I have a EJB module and 2 web modules which are packaged together in .ear

First problem is that IDEA creates 2 webmodules and names them both "Web",
although I use <finalName>admin</finalName> and <finalName>mysite</finalName> in the build section of my pom.xml.

Second, idea populates my application.xml and assignes id's to my webmodules (id="Web"), so application.xml becomes invalid, not unique id's.

Third: it also doesn't populate context property within application.xml web module definition (I expect it to be using finalName).

Also, after each synchronise, I have to go and fill those properties in for my webmodules
(idea also changes my war names from, for example "projectname-admin-SNAPSHOT.war to webadmin.war
and changes also application.xml, building with maven makes an invalid ear after this)

these are all quite small, but really anoying things/



 All   Comments   Work Log   Change History      Sort Order:
Anton Makeev - 10 Apr 08 15:37
Could you please attach the poms?

M.J.Milicevic - 01 May 08 19:22
Notice application.xml within ear folder (e.g. no context, although it is defined within pom,both ID's are "Web").
Also, if you change it manually, and than change one of the poms, and than synchronise, idea will change your application.xml, which is than invalid again..

<module id="EJB">
<ejb>ejb.jar</ejb>
</module>
<module id="Web">
<web>
<web-uri>admin-1.0-SNAPSHOT.war</web-uri>
<context-root/>
</web>
</module>
<module id="Web">
<web>
<web-uri>site-1.0-SNAPSHOT.war</web-uri>
<context-root/>
</web>
</module>
</application>


M.J.Milicevic - 01 May 08 19:23
btw, happens on linux/windows (probably platform doesn't matter)

Geoffrey De Smet - 03 May 08 15:48
Using 2 EJB jars in 1 ear causes the same havoc, because both EJB facets get the id "EJB".
I tried giving them unique names, and on the next maven sync I had 4 EJB facets

Why is IntelliJ so intrusive in the application.xml? Can I tell IntelliJ to keep its hand off that file and still use the EAR facet (to build the exploded ear etc)?

Related issue: IDEA-18001


Anton Makeev - 12 May 08 17:08
Please try any of the next releases and let me know if any problem occur.

M.J.Milicevic - 04 Jun 08 15:00
Hi Anton,
I tried on a existing project and there's one thing that still goes wrong, abd that is that context-root of a web module is ignored (not inserted):

<module id="admin-Web">
<web>
<web-uri>admin-1.0-SNAPSHOT.war</web-uri>
<context-root>admin</context-root>
</web>
</module>
<module id="bva-site-Web">
<web>
<web-uri>site-1.0-SNAPSHOT.war</web-uri>
<context-root>site</context-root>
</web>
</module>

after some changes, Idea makes this:

<module id="admin-Web">
<web>
<web-uri>admin-1.0-SNAPSHOT.war</web-uri>
</web>
</module>
<module id="bva-site-Web">
<web>
<web-uri>site-1.0-SNAPSHOT.war</web-uri>
</web>
</module>

Above is again invalid, because context-root is completely missing..

If possible, it would be nice to take context root from pom:

<webModule>
<groupId>com.something</groupId>
<artifactId>site</artifactId>
<contextRoot>site</contextRoot>
</webModule>

thx


M.J.Milicevic - 05 Jun 08 18:39
it works ok if I fill in contextroot myself within IDEA dialog, problem is of course it gets lost each time POM is updated, so it would be nice if it is parsed from webmodule/contextroot value:

<webModule>
<groupId>com.something</groupId>
<artifactId>site</artifactId>
<contextRoot>site</contextRoot>
</webModule>


Anton Makeev - 06 Jun 08 15:22
Thanks, I've found the problem.
The fix will be available in the next eap.

M.J.Milicevic - 13 Jun 08 15:35
BTW, there's one more issue I noticed in the latest EAP (7860), and that is that idea is placing "/" in front of war file name, e.g:

instead of:

<web-uri>admin-1.0-SNAPSHOT.war</web-uri>
I get:
<web-uri>/admin-1.0-SNAPSHOT.war</web-uri>

notice "/" in front of admin-1.0-SNAPSHOT.war


Anton Makeev - 16 Jun 08 17:13
It was done in sake of unification. Does it lead to problems?

M.J.Milicevic - 16 Jun 08 18:15
Hi Anton,
glassfish v2 gives problems because it cannot find war files if deployed this way
(throws zip exception: file xxx.war cannot be found or something similar)

I am deploying as an EAR with 2 wars in it, admin.war and site.war


Anton Makeev - 16 Jun 08 20:11
OK, I'll fix it.
Thanks for help 8)

M.J.Milicevic - 17 Jun 08 17:18
Anton, there's one more thing that goes wrong, and that is that, after re-synching a project,
Idea chooses *.ejb name as name of EJB module, however, if you try to deploy, it fails.

What I do to get it working is following:

1. go to ear deployment settings, select EJB module to "do not package" and after that click apply button

2. than I select it again and choose "include facet in build"

3. after I do this I see that Idea changes extension to *.jar (instead of *.ejb) and deployment now works..

resulting application XML looks like one below, and deployment works nice:

<module id="admin-Web">
<web>
<web-uri>admin-1.0-SNAPSHOT.war</web-uri>
<context-root>admin</context-root>
</web>
</module>
<module id="site-Web">
<web>
<web-uri>site-1.0-SNAPSHOT.war</web-uri>
<context-root>/</context-root>
</web>
</module>
<module id="core-ejb3_impl-EJB">
<ejb>core-ejb3_impl.jar</ejb>
</module>