Changing Java Build Path deletes > 2000 files [message #257397] |
Mon, 17 November 2008 01:18  |
Eclipse User |
|
|
|
Whenever I update my Java Build Path a bunch of files are deleted from
my project. This is not surprisingly quite frustrating. The files are
in a Subversion repository, and can be recovered, but if I happen to
have any uncommitted changes to these files the changes are lost! Aargh!
The problem occurs if I update the Java Build Path via the project
properties, or if it is changed via mvn eclipse:eclipse and just now it
occurred when Eclipse added the JUnit 4 library to the Build Path as
part of generating a JUnit 4 test class.
The files are always deleted from the location,
S:\eclipse-workspace\my_project\src\main\webapp. The directory is not
totally cleared, but in particular the .svn directories are all cleared
so I usually end up having to delete the entire directory tree and then
do a svn update to revert the files. Then I have the arduous task of
figuring out if I have lost any local changes.
I just ran some numbers and the problem is even bigger than I thought:
Before the Build Path update there are 2,366 files in 395 folders with a
size of 5,932,702 bytes.
After the change there are just 24 files in 27 folders with a size of
107,621 bytes.
I typically run Tomcat inplace for this application via mvn tomcat:run
and the webapps directory contains all of the static resources for my
application.
I am unsure of where to start in terms of diagnosing this problem, so I
would be grateful for any hints. I am running the Java EE 3.4.1.
release of Eclipse on Windows XP SP3.
Scott
|
|
|
Re: Changing Java Build Path deletes > 2000 files [message #257413 is a reply to message #257397] |
Mon, 17 November 2008 09:31   |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
On 11/17/2008 1:18 AM, Scott Eade wrote:
> Whenever I update my Java Build Path a bunch of files are deleted from
> my project. This is not surprisingly quite frustrating. The files are in
> a Subversion repository, and can be recovered, but if I happen to have
> any uncommitted changes to these files the changes are lost! Aargh!
The Eclipse build will clean the output folder(s) that are defined for
the project; perhaps what you have is the output folder and source
folder are the same in your project? Check in the Project Properties >
Java Build Path > Source tab.
Hope this helps,
Eric
>
> The problem occurs if I update the Java Build Path via the project
> properties, or if it is changed via mvn eclipse:eclipse and just now it
> occurred when Eclipse added the JUnit 4 library to the Build Path as
> part of generating a JUnit 4 test class.
>
> The files are always deleted from the location,
> S:\eclipse-workspace\my_project\src\main\webapp. The directory is not
> totally cleared, but in particular the .svn directories are all cleared
> so I usually end up having to delete the entire directory tree and then
> do a svn update to revert the files. Then I have the arduous task of
> figuring out if I have lost any local changes.
>
> I just ran some numbers and the problem is even bigger than I thought:
> Before the Build Path update there are 2,366 files in 395 folders with a
> size of 5,932,702 bytes.
> After the change there are just 24 files in 27 folders with a size of
> 107,621 bytes.
>
> I typically run Tomcat inplace for this application via mvn tomcat:run
> and the webapps directory contains all of the static resources for my
> application.
>
> I am unsure of where to start in terms of diagnosing this problem, so I
> would be grateful for any hints. I am running the Java EE 3.4.1. release
> of Eclipse on Windows XP SP3.
>
> Scott
|
|
|
|
Re: Changing Java Build Path deletes > 2000 files [message #257429 is a reply to message #257425] |
Tue, 18 November 2008 08:57  |
Eclipse User |
|
|
|
Originally posted by: chris.lieb.gmail.com
Scott Eade wrote:
> Eric Rizzo wrote:
>> On 11/17/2008 1:18 AM, Scott Eade wrote:
>>> Whenever I update my Java Build Path a bunch of files are deleted from
>>> my project. This is not surprisingly quite frustrating. The files are in
>>> a Subversion repository, and can be recovered, but if I happen to have
>>> any uncommitted changes to these files the changes are lost! Aargh!
>>
>> The Eclipse build will clean the output folder(s) that are defined for
>> the project; perhaps what you have is the output folder and source
>> folder are the same in your project? Check in the Project Properties >
>> Java Build Path > Source tab.
> Hi Eric, yes, this does help. It seems that when I use maven to
> generate my eclipse project file it is adding a resources directory as a
> source path whose output folder is the one that keeps getting cleared.
> So I now know what is causing the problem and my focus is moving on to
> how to solve it.
>
> One possibility is that I somehow stop maven from adding this source
> path - I am looking into this.
>
> The other possibility is that I somehow configure Eclipse to not clean
> this folder whenever a rebuild occurs. Does anyone know if this is
> possible?
>
> Scott
You can configure the build path for your /src/main/resources folder to
exclude **/.svn/. This will prevent Eclipse from copying any of your
..svn directories to the output directory.
Chris
|
|
|
Powered by
FUDForum. Page generated in 0.02487 seconds