Bug 65621 - Update from Ant 1.10.5 to 1.10.11 breaks build
Summary: Update from Ant 1.10.5 to 1.10.11 breaks build
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.10.11
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: 1.10.13
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-07 14:17 UTC by Alexander Veit
Modified: 2022-11-19 16:58 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Veit 2021-10-07 14:17:59 UTC
An update from Ant 1.10.5 to 1.10.11 breaks out build. Switching back to 1.10.5 fixed the issue.

The problem are javac tasks that produce lots of errors like "error: package org.slf4j does not exist" which indicates that the nested classpath element (see below) seems not to be effective. The Ant javac task seems to pass the options and arguments via a temporary file with very short lifetime to the javac binary. So it's unfortunately very difficult to find out what is being actually passed to the compiler.

<target name="target.build.java.common">
    <javac
        failonerror="true"
        includeAntRuntime="false"
        fork="true"
        memoryMaximumSize="256m"
        debug="${java.debug}"
        optimize="on"
        srcdir="${build.modules.dir}/common/src/main/java"
        destdir="${build.modules.dir}/common/target/classes"
        encoding="UTF-8"
        source="16"
        target="16">

        <compilerarg value="--add-exports=java.xml/com.sun.org.apache.xml.internal.serializer=ALL-UNNAMED"/>
        <compilerarg value="-Xlint:none"/>

    	<classpath>
            <pathelement path="${build.modules.dir}/common/lib/*"/>
        </classpath>
    </javac>
</target>

${build.modules.dir}/common/lib/* expands to the correct path at runtime.
Comment 1 Stefan Bodewig 2022-11-19 12:21:17 UTC
@Alexander have you tried using Ant 1.10.12 and does the issue still exist? It probably does.

Between 1.10.5 and 1.10.11 the most important change is that we now put all options into a command file (since 1.10.7 I believe). I just re-read https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javac.html#commandlineargfile and it says 

> Wildcards (*) are not allowed in these lists (such as for specifying *.java). 

so we probably just hit another special case similar to bug 63874
Comment 2 Stefan Bodewig 2022-11-19 16:58:12 UTC
should be fixed with commit 3e6d6acc3, will be fixed in Ant 1.10.13.