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 124554 - ant.core.lib not propagated to subbuilds automatically
Summary: ant.core.lib not propagated to subbuilds automatically
Status: VERIFIED WONTFIX
Alias: None
Product: www
Classification: Unclassified
Component: Builds & Repositories (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P4 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on: 139448
Blocks:
  Show dependency tree
 
Reported: 2008-01-02 08:26 UTC by Jiri Skrivanek
Modified: 2008-11-19 01:39 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Possible hotfix (1.00 KB, patch)
2008-01-02 08:44 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2008-01-02 08:26:25 UTC
Build of whole IDE fails while building schema2beans/rt/anttask because ant.core.lib is not set. To reproduce:

cd nbbuild
ant -Dbuild.compiler.debug=true -Dbuild.compiler.deprecation=false -Dcluster.config=j2ee -Dsigtest.skip.check=true
build-nozip

The following works well:

cd nbbuild
ant init all-schema2beans/rt
Comment 1 Jaroslav Tulach 2008-01-02 08:44:07 UTC
Created attachment 54587 [details]
Possible hotfix
Comment 2 Jiri Skrivanek 2008-01-02 09:58:38 UTC
I tried the patch and it works with it.

/cvs/nbbuild/build.xml,v  <--  build.xml
new revision: 1.864; previous revision: 1.863
Comment 3 Jesse Glick 2008-01-02 15:43:56 UTC
I am unable to reproduce the problem without the patch. The patch looks at worst harmless, since a proper Ant 1.7.0
installation should already define ant.core.lib so both the added tasks should have no effect. If you can continue to
reproduce a scenario in which Ant 1.7.0 fails to define ant.core.lib as it is documented to, please try to come up with
a minimal reproducible test case and file on ant.apache.org, or if the problem is that the property is initially defined
but then removed or somehow masked in the course of running some NB build scripts, please fix that place.
Comment 4 Jiri Skrivanek 2008-01-03 13:37:08 UTC
The problem is ant.core.lib is not propagated when inheritall="false" is used (try minimal test case below). IMO
ant.core.lib is ant's internal property and it is not intended to be used in ant scripts at all (at least I haven't
found it documented anywhere). So, the patch must be in nbbuild/build.xml. I think this issue can be closed as fixed, if
you don't have different opinion.

<project name="changeme" default="all" basedir=".">
    <target name="all">
        <echo>
            ant.core.lib}=${ant.core.lib}
            ant.home=${ant.home}
        </echo>
        <antcall target="a" inheritall="false"/>
    </target>
    
    <target name="a">
        <echo>
            ant.core.lib}=${ant.core.lib}
            ant.home=${ant.home}
        </echo>
    </target>
</project>
Comment 5 Jesse Glick 2008-01-05 19:35:41 UTC
If you set inheritall=false then Ant will do what you requested and not pass anything to the sub-build. That is why you
should pass

<property name="ant.core.lib" value="${ant.core.lib}"/>

to the sub-build. I think this applies to any property but I would need to delve into sources to see exactly where
different properties are initialized for the <ant> task.

ant.core.lib is not an Ant-internal property. It was added in Ant 1.7.0 for use in build scripts. Whether it's properly
documented yet, I don't know, but it's definitely there intentionally.
Comment 6 Jiri Skrivanek 2008-01-05 20:21:04 UTC
AFAIK, system properties like ant.home are passed to the sub-build even if inheritall=false is set. The ant.core.lib is
probably treated a different way than ant.home. The following line in nbbuid/build.xml caused the original failure:

<antcall target="build-one-cluster-dependencies" inheritAll="false">
Comment 7 Jesse Glick 2008-01-05 22:55:11 UTC
ant.home is not a system property, but yes ant.core.lib ought to be treated the same way. I will look into whether a
patch to Ant is necessary.
Comment 8 Jesse Glick 2008-02-20 23:54:56 UTC
AFAIK no visible problem in NB at the moment.
Comment 10 Jaroslav Tulach 2008-04-01 08:26:51 UTC
http://hg.netbeans.org/main/rev/c4aa17a430f5