I have everything setup to build maven based java project using TFS 2010 build server. Installed Team Explorer Everywhere 2010. Created build definition using Upgrade Template. Set MavenPomFile and Goals properties into TFSBuild.proj file to run my java code. And I am successfully able to build the code and achieve cotinuous integration of java code using TFS2010. So far so good.
Other day my collegue deleted one of the .java file in the project and checked in the code into TFS. But she forgot to remove the lines of code which was using the classes in the deleted file. Ideally in this scenario the TFS build should failed but it DID NOT FAILED, resulting in assumption that last checkin was fine and did not harm the entire project. I went ahead to check in the Build machine, there i found that the location where the lastest code was pulled from TFS server was having deleted file intact and thats the reason it did not threw any error.
I am wondering how the build process is considering the deleted java files for building latest code from TFS Server.
I cross checked the same scenario in C# based project but it gave the expected result. [i.e. if file is deleted and other file is referencing deleted file classes, throws error : could not found sysmbol for xyz class.] . I checked the build directory of C# project, it was still having deleted file present there but build process recognised that it has been deleted from TFS server and so did not considered it for building project and threw expected error.
Why build agent is considering deleted java files for building maven based project? Is build process differs from C# to Java?
Then to resolve the Java build problem I deleted all the contents of the Build directory in the build machine and triggered build one more time. This time deleted file did not got copy from TFS server to Build agent's Build directory and gave all the expected errors. And then we removed all the references of deleted file and checked in the code and again triggered a build. It was Successful !!!!
Moreover I am seeing the same issue while Merging as well. We have Release branch derived from Main. If I delete xyz file from Main and checked in to TFS, then merge this change set to Release branch and trigger a build for release branch, the Build mechanism still considers the deleted file for Building. Is merging process for java based project has any issue?
Please provide details of root cause of these problems and permanent solution to resolve the same.
[Note:I am using VS2010 for performing all the checkins/checkout/merging for my java project]
By default a new build created by Team Explorer Everywhere should be running with a clean workspace everytime it runs on the build agent.
Would it be possible to attempt to do this again and see if you can reproduce the problem. The Get's from TFS are performed well before Maven is invoked and that part of the process is the same regardless of if this is a Maven or a C# project so I am confused as to why it would not be working in your case.
- เสนอเป็นคำตอบโดย Shaw TerwilligerOwner 26 มกราคม 2555 16:10