moonese
moonese

Reputation: 483

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

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?

Upvotes: 3

Views: 3682

Answers (3)

moonese
moonese

Reputation: 483

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.

Upvotes: 4

Raghuram
Raghuram

Reputation: 52655

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

Upvotes: 2

TheCottonSilk
TheCottonSilk

Reputation: 8822

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'

Upvotes: 5

Related Questions