Eclipse v4.7.1a: ant build broken: Launch configuration <build.file> references non-existing project <container project>

假装没事ソ 提交于 2019-12-19 06:41:10

问题


It seems that since eclipse v4.7.1a (fresh install), it is no more possible to execute any ant build. Each time it fails with the following message:

Launch configuration <name of build file> references non-existing project <name of the containing project>

We have tested it with many different configuration (eclipse-jee, eclipse-rcp ...), each time with a fresh eclipse v4.7.1a install.
After further investigation, this occurs only if the build.xml file in not under a "java" kind of project, which is the case for all of our workspaces (30+...).
Everything worked well with v4.7.0
In the .logfile we can see:

java.net.SocketException: Socket operation on nonsocket: configureBlocking
  at java.net.DualStackPlainSocketImpl.configureBlocking(Native Method)
  at java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
  at java.net.AbstractPlainSocketImpl.accept(Unknown Source)
  at java.net.PlainSocketImpl.accept(Unknown Source)
  at java.net.ServerSocket.implAccept(Unknown Source)
  at java.net.ServerSocket.accept(Unknown Source)
  at org.eclipse.ant.internal.launching.launchConfigurations.RemoteAntBuildListener$ServerConnection.run(RemoteAntBuildListener.java:89)

!ENTRY org.eclipse.jdt.launching 4 107 2017-10-22 21:19:26.676
!MESSAGE Launch configuration org.titou10.jtb.build build.xml references non-existing project org.titou10.jtb.build.

[UPDATE]
If the build.xml file is inside a Java project. Everyhting works fine as before
If the build.xml file is in a regular project or a EAR project (our case) it does not work...
It seems there is a way to make it work in those cases:

  1. right click on build.xml
  2. Run As->Ant Build...-> Select the "JRE" tab,
  3. check "Run in the same JRE as the workspace "...

and it works as before...

It is clearly a regression from previous version...


回答1:


Yes, you're right, it's an Eclipse bug:

Eclipse bug 522581 - Cannot run ant build file from generic project

The bug was introduced in Oxygen.0 (4.7.0), probably by an update of the built-in Ant framework. A fix for this bug is scheduled for Oxygen.2 (4.7.2), December 20, 2017.

As already described by yourself in the question, Run in the same JRE as the workspace can be used as a workaround.



来源:https://stackoverflow.com/questions/46880799/eclipse-v4-7-1a-ant-build-broken-launch-configuration-build-file-references

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!