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 144273 - Interproject dependency is broken when Ant script has different name than "build.xml"
Summary: Interproject dependency is broken when Ant script has different name than "bu...
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: EAR (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: David Konecny
URL:
Keywords: API, API_REVIEW_FAST
: 160104 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-08-18 14:59 UTC by getaceres
Modified: 2011-10-24 08:29 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
implementation (3.90 KB, text/plain)
2008-08-26 01:49 UTC, David Konecny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description getaceres 2008-08-18 14:59:18 UTC
I have project A which is a Web project generated with existing sources and it contains a custom build.xml file. On
creation time, a second xml file is generated (by default nbbuild.xml) which is used to build the project.
I've added that project A to an Enterprise Application project (ear) but it adds the dependencies in the form:

<ant antfile="${project.A}/build.xml" inheritall="false" target="clean-ear">
     <property location="${build.dir}" name="dist.ear.dir"/>
     <property name="disable.deploy.on.save" value="${build.disable.deploy.on.save}"/>
</ant>

So building the ear fails because it should use nbbuild.xml instead of build.xml. The correct one would be:

<ant antfile="${project.A}/nbbuild.xml" inheritall="false" target="clean-ear">
     <property location="${build.dir}" name="dist.ear.dir"/>
     <property name="disable.deploy.on.save" value="${build.disable.deploy.on.save}"/>
</ant>

I think it should detect which file is used to build a web application when that application is added to an ear instead
of assuming that it will be build.xml.
Comment 1 David Konecny 2008-08-26 01:47:55 UTC
I would like to enhance AntProjectHelper.createSimpleAntArtifact() with new parameter: property name holding project
relative location and name of Ant build script to use. See attached patch.

What's not included in the patch but would be done before commit:
* increase spec version and add @since
* remove java.j2seproject.J2SEProjectAntArtifact and replace it with call to this method
* use the new method in web/j2ee projects
Comment 2 David Konecny 2008-08-26 01:49:51 UTC
Created attachment 68294 [details]
implementation
Comment 3 Tomas Zezula 2008-08-26 07:22:30 UTC
The patch looks fine, feel free to integrate.
Comment 4 David Konecny 2008-08-27 03:57:37 UTC
Thanks for review Tomas.
Comment 5 David Konecny 2008-08-27 03:58:39 UTC
Locally fixed as #1949eb983737.
Comment 6 Quality Engineering 2008-08-28 06:20:43 UTC
Integrated into 'main-golden', available in build *200808280201* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/1949eb983737
User: David Konecny <dkonecny@netbeans.org>
Log: #144273 - Interproject dependency is broken when Ant script has different name than "build.xml"
Comment 7 Svata Dedic 2011-10-24 08:29:29 UTC
*** Bug 160104 has been marked as a duplicate of this bug. ***