Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

eclipse

ant

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...

like image 460
titou10 Avatar asked Oct 23 '17 01:10

titou10


People also ask

How do I run Ant build xml in Eclipse?

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.

Where is build xml in Eclipse?

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.


1 Answers

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.

like image 111
howlger Avatar answered Nov 09 '22 08:11

howlger