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 55695 - Add "Web Project with Existing Ant Script" as J2EE module
Summary: Add "Web Project with Existing Ant Script" as J2EE module
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Freeform (show other bugs)
Version: 4.x
Hardware: All All
: P4 blocker (vote)
Assignee: David Konecny
URL:
Keywords:
: 65570 (view as bug list)
Depends on:
Blocks: 89477
  Show dependency tree
 
Reported: 2005-03-01 15:48 UTC by friv9821
Modified: 2009-12-21 04:49 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch (6.98 KB, text/plain)
2006-09-01 08:57 UTC, Milan Kubec
Details

Note You need to log in before you can comment on or make changes to this bug.
Description friv9821 2005-03-01 15:48:13 UTC
I think it should be possible to add an "Web
Project with Existing Ant Script" as a J2EE module
to my J2EE Enterprise application.

As for now I cant unless I edit the buildscripts
manuallly.

This would be quite useful when working on an web
application in another ide, for example Sun Studio
Creator.
Comment 1 Pavel Buzek 2005-03-01 16:23:06 UTC
Can you describe the changes that you had to do? It looks almost as a
bug to me, maybe we can fix it in 4.1. Thanks.
Comment 2 Pavel Buzek 2005-03-02 05:19:08 UTC
Anyway, I think this is a defect. I expect the problem to be in web
freeform not providing artifact with the right flavor. I will have to
check..
Comment 3 friv9821 2005-03-02 09:21:51 UTC
To make it worh I first created an ordinary web applications in my
enterprise project and then my "Web Project with Existing Ant Script".
(This step is for keeping the buildfiles intact. If I add or remove
rows the IDE wont update the scripts anymore.)

Then I added the first, (dummy-web), to my ee application and changed
the web project references to my other web-app:
project.dummyweb-war=../realweb-war
reference.dummyweb-war.dist-ear=${project.dummyweb-war}/dist/realweb.war

Then I changed the names of the target ant-targets in build-impl and
finally I updated application descriptor to contain my realweb.war.
Comment 4 Radko Najman 2005-03-30 16:14:33 UTC
It is not possible to fix it for 4.1 release. This issue consists of two parts:
1. the way how it is recognized that the project can be added to the Enterprise
application should be reimplemented and should be based on project artifact type
2. web freeform project provides only jar artifact type. There is no way how to
provide war artifact type in current implementation - missing API. This needs to
be discussed and implemented for next release.
Comment 5 John Jullion-ceccarelli 2005-03-31 08:55:45 UTC
Just my 2c - for consistency's sake if we're going to implement this for
free-form web modules we should also implement it for EJB modules.
Comment 6 Radko Najman 2005-12-09 12:43:04 UTC
*** Issue 65570 has been marked as a duplicate of this issue. ***
Comment 7 Martin Krauskopf 2006-06-29 10:05:09 UTC
According to last Radko's comments and Marek's comment in issue 65570 FreeForm
WebProject has to provide AntArtifacts for it's .war files. So first turn has to
be done in webproject -> reassigning.
If I misunderstand throw it back, thanks.
Comment 8 Radko Najman 2006-07-25 15:33:49 UTC
OK, I'll look how web artifact can be added to web freeform.
Comment 9 Radko Najman 2006-08-01 13:24:10 UTC
Reassigning to Milan who did the same for EJB freeform (issue #79798).
Comment 10 Milan Kubec 2006-08-31 12:38:18 UTC
This might be a little problem, because EAR allows to add only projects that
implement J2eeModule and WebFreeform doesn't. Is it intentional?
Comment 11 Milan Kubec 2006-09-01 08:57:15 UTC
Created attachment 33491 [details]
patch
Comment 12 Milan Kubec 2006-09-01 09:01:23 UTC
I've attached patch that assumes J2eeModule in lookup of the web freeform
project. The fix is not complete so I've provided only this attachment. If you
decide that web freeform will implement J2eeModule, please commit the patch.
Probably WebModules class could implement the interface.
Comment 13 Petr Jiricka 2006-09-01 10:38:22 UTC
Can that be done? I believe this was also discussed in the context of other
bugs/features, and one problem we discovered is that it would be necessary to
introduce the target server concept for freeform projects, which is probably the
right thing to do, but not doable for NetBeans 5.5.
Comment 14 Milan Kubec 2006-09-01 12:10:54 UTC
Setting tentatively TM to 5.5.
Comment 15 Milan Kubec 2006-09-11 15:22:25 UTC
I did deeper evaluation of this issue and found out that the problem is wider.
Web ff project doesn't provide export element for its war output file. Output
war file is only added to compilation unit as <build-to> but no export element
is created for that. AntArtifact is then not created for the project and build
output cannot be added to EAR project.

The fix would be to generate <export> element when user adds war file as project
output. AntArtifact needs to be of type
WebProjectConstants.ARTIFACT_TYPE_WAR_EAR_ARCHIVE (ejb ff project uses
EjbProjectConstants.ARTIFACT_TYPE_J2EE_MODULE_IN_EAR_ARCHIVE, IMO both project
types could use some shared constant). It might work (guessing just from source)
 just by providing correct <export> element. If not web ff project then would
provide LookupMerger that provides just correct AntArtifactProvider.
Comment 16 Petr Jiricka 2007-07-17 17:49:29 UTC
I added this as a subissue of the 89477 umbrella (freeform project enhancements). Isn't this an enhancement rather than
a defect? I don't think this can be done for 6.0, can it?
Comment 17 Andrei Badea 2007-07-18 12:07:13 UTC
Not sure, it looks more like a defect to me. But we could debate about its priority: is this really a P3 when it didn't
have any duplicates or votes in more than two years?

As for doing for 6.0: it seems to require:

1. implementing a J2eeModule for the web module. Not sure how complete the implementation needs to be. What about the
target server and instance? We would need to store them somewhere in project.xml, which would likely need a new schema
(one is already in progress because of the WEB-INF-outside-of-web issue).

2. adding export elements for the output war files. This requires knowing the build target mappings and the output
files. These are stored in the general freeform and Java data and there is no API for obtaining them. We would need to
parse project.xml.

Doing this for 6.0 looks too much work for too little gain to me.
Comment 18 Jiri Prox 2008-04-11 01:20:42 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 19 Quality Engineering 2009-12-21 04:49:11 UTC
This bug was reported against NetBeans IDE 6.0 or an older release, or against a non-maintained module. NetBeans team does not have enough resources to get to this issue, therefore we are closing the issue as a WONTFIX. If you are interested in providing a patch for this bug, please see our NetFIX guidelines for how to proceed. 

We apologize for any inconvenience.


Thank you.
The NetBeans Team