开发者

Why change xml file in Eclipse project will trigger project auto build

开发者 https://www.devze.com 2023-02-06 00:19 出处:网络
If there is a xml file in a Eclipse java project, and with \"build Automatically\" enabled, every time I change the xml file, and save, it will trigger Eclipse to build the project, and sometimes it c

If there is a xml file in a Eclipse java project, and with "build Automatically" enabled, every time I change the xml file, and save, it will trigger Eclipse to build the project, and sometimes it cause much time to finish.

I just thought that xml 开发者_运维技巧files are just resource files, or at least it is not code change and should not trigger project build. What's the reason for this, and is there anyway to disable it?


You are right there xml files are resource files. If the project code depends on the xml listed resource and there is some change in the xml file, auto build gets triggered to verify if the valid resource is available to the project, if not it shows warnings, or errors as the case may be.

To stop auto build in Eclipse: Window > Preferences > General > Workspace > Uncheck the checkbox 'Build automatically'


I finally find out a workaround to this problem:

go to project properties > Java Build Path > Source > add an exclude rule: **/*.xml

by excluding all xml files from Java Build Path, now edit xml files will not trigger build with 'build Automatically' on.


From Eclipse documentation,

A build is a process that derives new resources from existing ones, updates existing 
resources, or both

It is not just compilation of source code

0

精彩评论

暂无评论...
验证码 换一张
取 消