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 .log
file 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:
Run As
->Ant Build...
-> Select the "JRE
" tab, Run in the same JRE as the workspace
"... and it works as before...
It is clearly a regression from previous version...
You created a build. xml file for an Eclipse project in the previous recipe; to run that file in the version of Ant that comes with Eclipse, right-click build. xml, and click Run Ant. Doing so displays the AntProject build.
The build. xml file can be created by using the context menu on plugin. xml and selecting PDE Tools > Create Ant Build File. Ant build files are low-level mechanisms to package up plug-ins.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With