2

I have a project with two dependencies which I want to be built when I build my project. I did this by going to Project Properties->Project References and selected the two dependencies. When I make a change to one of the dependencies I can rebuild my project for them to be built, but if I just run my project, the referenced dependencies are not rebuilt. How can I fix this?

EDIT:

I have the following Eclipse settings as asked:

  • Project->"Build Automatically" is checked
  • Window->Preferences->General->Workspace->"Build Automatically" and ->"Save automatically before Build" both checked
  • Window->Run/Debug->Launching->GeneralOptions->"Build (if required) before launching" is checked

The last point seems to be what isn't working correctly. Having this checked will build my project before launching, but it will not build the dependencies.

Amicable
  • 3,115
  • 3
  • 49
  • 77
mpellegr
  • 3,072
  • 3
  • 22
  • 36
  • Just to rule it out, you have the dependencies added to the build path of the project you want to auto-build right? Also, check if those settings are not "project settings", in which case won't apply to others. There's a way of setting all those things on a per-project basis. – Acapulco Jan 25 '13 at 17:38
  • Ok, how about going to your project (right-click on project -> properties) then Order and export panel. Check out the status of the checkboxes for the dependecies. I'm not exactly sure what does the checkbox mark mean, so if they are selected, try unselecting them, and viceversa and see what happens. Some things seem to need to be exported before they work (it happens on my projects), or conversely, NOT being exported. – Acapulco Jan 25 '13 at 17:44
  • One more, what about Preferences -> Java -> Compiler -> Output folder -> Checkbox "Rebuild class files modified by others"? – Acapulco Jan 25 '13 at 17:45

1 Answers1

3

Did you check under "Project" menu, "Build Automatically" option?

Check this question, it might be of help:

Purpose of the "Build Automatically" option in eclipse

Edit2 (Adding the comment so its easier to read):

Did you try under Preferences -> Run/Debug -> Launching -> General options panel -> Checkbox for "Build (if required) before launching" ? I'm not exactly sure (and the help doesn't mention it) what exactly does "if required" mean. But I would think it should mean, "if there are modified files in the project since last launch, do a rebuild"

Here's a post that might help:

http://mcuoneclipse.com/2012/10/30/speeding-up-the-debug-launch-in-codewarrior/

What it means is that it performs a ‘build’ (checking if anything has been changed, and compiles and links if necessary) of my project before it launches and debugs my project.

So, it definitely should do what you are looking for.

Community
  • 1
  • 1
Acapulco
  • 3,373
  • 8
  • 38
  • 51
  • From the link you posted that only effects whether it would build when I saved. Regardless, I already have it checked for the project and dependencies. – mpellegr Jan 22 '13 at 17:48
  • Well, you have to save anyway after making modifications, so it should do what you are looking for. If you didn't change anything and you just run it, there should be no need for a rebuild. Or maybe you are modifying things outside Eclipse and you would like to rebuild regardless of modifications inside or not? – Acapulco Jan 22 '13 at 18:21
  • Did you try under Preferences -> Run/Debug -> Launching -> General options panel -> Checkbox for "Build (if required) before launching" ? I'm not exactly sure (and the help doesn't mention it) what exactly does "if required" mean. But I would think it should mean, "if there are modified files in the project since last launch, do a rebuild". – Acapulco Jan 22 '13 at 18:25
  • I have that option checked and I'm able to run my project and it will rebuild itself, but it will not rebuild the dependencies. It will only rebuild the dependencies if I explicitly build my project. – mpellegr Jan 24 '13 at 19:11