Eclipse ant build failed Failed to delete lib \ build file

When running certain build.xml targets, the net has a hit or miss when deleting the ivy banner directory. Locked files are executed using eclipse, using the explorer in the directory or reloading ant from eclipse, which refuses to delete it before restarting eclipse. It is very time consuming. Some reason eclipse holds onto these files after running ant build / clean.
These are not all projects and only at certain times for unknown reasons.

There is such a discussion. Eclipse will not delete files

but it does not answer the question of how to get eclipse to run ant without having to restart every time.

Is there a way to use the eclipse-console to see how the file processes what holds it? or someone knows the main reason why eclipse / ant / ivy will not release these objects after a build or two (the first time after a new start, Eclipse works fine), but then some subsequent builds of ant after that become unhappy.

In my case, this is eclipse, which will probably block the file. Restarting Eclipse is not a solution. Otherwise, I will just return to the command prompt window. I tried to configure launch in the same jvm and all kinds of settings.

Do i need to debug eclipse plugins? Is there an easier way to find out what doesn't release the lock in Eclipse and plugins? This is my first time ever to see this, and I suspect it is causing IVY.

Running juno, ivy, spring, ant and problems with run-as ant Build from Eclipse that clean cannot remove the lib / build directory from artifacts.

eclipse.buildId=M20130204-1200 java.version=1.6.0_43 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Framework arguments: -product org.eclipse.epp.package.jee.product Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product !ENTRY org.apache.ivyde.eclipse 1 0 2013-06-04 11:36:50.344 !MESSAGE starting IvyDE plugin 

ant target:

  <target name="clean-retrieved" > <delete includeemptydirs="true" > <fileset dir="${basedir}"> <include name="lib/**" /> </fileset> </delete> </target> 

ERROR:

 clean-retrieved: BUILD FAILED C:\scripts\common-build-targets.xml:238: Unable to delete file C:\scripts\lib\build\annotations-1.3.8.jar <<just first jar file in directory.. 
+4
source share
5 answers

This happens when the process uses the specified file. Usually this problem occurs when a program using the specified jar is still running. Make sure you are not running your program in eclipse yet. The easiest way to see this visually:

enter image description here

An included red square (stop button) means that your program is still running. If you click this, you will stop your process. However, if your program was not running, it looks something like this:

enter image description here

Since the "Stop" button is not turned on, it means that the program is not running. However, it is possible that there are other processes that work besides those that were shown at that time. To see this, in the following screenshot you will see the "computer screen" icon:

enter image description here

The included computer screen means that you have launched several programs / processes. Pressing the down arrow allows you to switch to other programs. Check if they are working and stop them. An easier way is to double-click the X. This will close each section associated with the finished process and may show you that it still works, that you can stop. Continue to press the double x button and the stop button until everything disappears and you can remove your jar and build without problems.

+3
source

Run the following command from the command line

c: \ path_to_eclipse \ eclipse.exe -clean

0
source

This seems like a problem with the ant plugin. In my case, when the plugin parses the build.xml file, it opens the file descriptors for all the jars mentioned in the path to the taskdef element classes. As soon as the action causes the ant plugin to parse the build.xml file, it acquires the file descriptors for these jars and does not release them until the eclipse closes. I believe that this is a bug in the ant plugin - it should contain only open file descriptors during the launch of the target.

I have not found work for this problem, except to return to using the ant command line instead of the eclipse plugin. The entire assembly can be restructured to duplicate copies of these cans elsewhere and update taskdef targets, but this is a serious hack. People on a team with mac or linux do not see this because it allows you to delete a file with an open file descriptor. May discuss the merits of this elsewhere.

0
source

I'm going to chip here (I know this is an old post)

My Eclipse / Ant combo works fine, but then I created a new workspace that looked fine, but refused to remove dist/*jars during cleanup.

I tried to delete them through Windows Explorer, which claimed that they were already open in Eclipse.

Restarting Eclipse worked, but took a long time.

My decision. I created a new workspace and re-imported it into it.

My guess is some corruption in my original work area.

0
source

I also had this problem. This was caused due to a denial of access to the folder. I could not switch the owner of the folder. Solved the problem is to install Lockhunter to unlock the folder, delete and recreate it.

0
source

Source: https://habr.com/ru/post/1484683/


All Articles