The location attribute specifies [color=red]a single [/color]file or directory relative to the project's base directory (or an absolute filename), while the path attribute [color=red]accepts colon- or semicolon-separated lists of locations[/color]. The path attribute is intended to be used with predefined paths - in any other case, multiple elements with location attributes should be preferred.
<classpath>
<pathelement path="${classpath}"/>
<pathelement location="lib/helper.jar"/>
</classpath>
最大的区别是,location只接收一个路径,而path可以跟多个路径,并用分割符来分开。
<classpath>
<pathelement path="${classpath}"/>
<pathelement location="lib/helper.jar"/>
</classpath>
最大的区别是,location只接收一个路径,而path可以跟多个路径,并用分割符来分开。