IDEA ant 编译代码出错(java.nio.file.InvalidPathException: Illegal char )

IDEA 社区版升级到了最新的 2019.2 版本后,使用 ant 编译老的代码报错,提示

D:\Project\02_Git\PEIM\PEIM-GIT-DEMO\src\ApplicationServer\icap\icap.core\build.xml:48: java.nio.file.InvalidPathException: Illegal char <*> at index 81: D:\Project\02_Git\PEIM\PEIM-GIT-DEMO\src\ApplicationServer\icap\icap.lib\message\*.properties
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:571)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.Target.performTasks(Target.java:470)

查看出错部分的代码

47.     <!-- 拷贝message文件 -->
48.     <delete file="${lib}/message/*.properties" />
49.     <copy todir="${lib}/message">
50.          <fileset dir="${basedir}" includes="*.properties" />
51.     </copy>

报错是因为使用了 * 通配符,但是在升级IDEA 前是可以使用的,然后查看 ant 版本进行比较
${idea_home}\lib\ant\lib\ant.pom ,打开查看 version ,发现2018版本是使用的 1.9.4,而 2019 版本使用的 1.10.5,手动下载 1.10.6 版本的 ant 测试,也是不能编译通过的。

暂时认为是因为 ant 版本的缘故所以无法编译通过,然后下载最新的 1.9.x 版本 1.9.14,在 IDEA 中配置,修改ant版本。

ant 配置

可以看到默认是 1.10.5,修改成为 1.9.14,然后再编译,成功。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值