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 226457 - Netbeans creates broken maven artifacts during deployment
Summary: Netbeans creates broken maven artifacts during deployment
Status: RESOLVED 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:
Depends on:
Blocks:
 
Reported: 2013-02-21 12:40 UTC by daedalus
Modified: 2015-09-17 13:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Example Project (1.96 KB, application/x-7z-compressed)
2013-02-21 12:40 UTC, daedalus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description daedalus 2013-02-21 12:40:31 UTC
Created attachment 131668 [details]
Example Project

Hello 




In our company we use an EAR project with a single EJB Container. The EJB project itself is empty. But it has dependencies to to other projects (JAR projects) that include Sessionbeans. We use the Maven Shade plugin to insert these decencies directly inside the jar. So after building the jar with Maven the corresponding jar is not empty anymore.

If I pick the EAR and put it into the Glassfish autodeploy folder the projects deploys fine without problems. However if we try to deploy the EAR with Netbeans, the IDE creates a own ejb jar without the depencies included. And because empty EJB container are not allowed the deployment fails. 


I've created an example project that shows the behavior. If you build die EAR and deploy it self everything works as expected, but if you let Netbeans deploy the application it won't work because the ejb container is empty.
Comment 1 Martin Janicek 2013-02-28 14:26:25 UTC
There is an easy workarround (not saying the best one), you just need to create one dummy session bean with dummy method in your EJB module --> decreasing priority to P3

Anyway the proper fix for this can be quite problematic. Even if we finds out whether the EJB contains some SessionBean from shaded modules for example Deploy On Save won't work for such classes. I'll take a deeper look on it during the bug fixing..
Comment 2 Martin Janicek 2013-02-28 14:29:37 UTC
Just internal note for myself:

Either InitialServerFileDistributor.distribute() or BaseEEModuleImpl.getArchiveContents() should be improved to traverse over the included .jars and look for valid SessionBean there
Comment 3 daedalus 2013-03-04 09:18:06 UTC
Thank you for looking into this. 

Yes I'm aware that this problem could be difficult to solve. 
But even if you decide not to fix it please think of a way to provide to inform the users that if they use the deploy feature from Netbeans the build might differ from the original Maven build. 
Maybe some kind of a warning Message if they use the feature for the first time.
Comment 4 Martin Janicek 2013-03-04 14:14:10 UTC
Sure, thanks for interesting proposal. I'll think about that as a backup solution (hopefully I'll find a better one :))
Comment 5 daedalus 2013-03-07 09:06:45 UTC
I think this bug is more or less the same as this bug I reported a while ago: 

http://netbeans.org/bugzilla/show_bug.cgi?id=213960
Comment 6 Martin Balin 2015-09-17 13:10:01 UTC
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.