-->

TFS for Java - bad idea?

2019-01-17 00:55发布

问题:

We're considering TFS for our .NET based projects and as a task management platform. Some teams develop exclusively in Java and they're quite happy with SVN (Subclipse).

Our managers came up with the following questions:

  • Should we migrate the Java teams to TFS as well?
  • Does TFS (source control only) handles well Java projects?
  • Is it a pain to migrate our Java code base and history from Subclipse to TFS?

Currently we are looking to use TFS as a sole source control platform for maintainability reasons. We would like to avoid having our IT guys supporting multiple systems.

Thanks

回答1:

Full disclosure, I work on the team that write the Java tooling for TFS so take this answer as appropriately biased :-)

As far as TFS is concerned - all code is created equal. It's just bytes in files that it checks in to version control. Like all SCM systems it doesn't care what language the files are written in.

Microsoft provide a full, rich TFS Plug-in for Eclipse (called Team Explorer Everywhere). This provides full source control, work item tracking, build, sharepoint, reports access etc into TFS from Eclipse based IDE's. It's written in 100% Java and talks directly to the web services exposed by TFS.

In addition we also provide a cross-platform command line client for TFS so that you can talk to TFS from the command line on your operating system of choice (Mac, Linux, Solaris, HP-UX, Aix etc all fully supported).

Finally, if you have tools written in Java that want to talk to TFS then they can make use of the TFS SDK for Java which is the full API that we used to create the Eclipse integration and cross-platform command line client but packaged up with samples and snippets and ready for you to redistribute with your applications.

When it comes to build you have a couple of choices. If you want to stick with your current build server then it is likely that this already supports talking to TFS (all the popular open source build servers do). In addition to that, Microsoft provide the TFS Build Extensions which allow you to run Ant or Maven based builds on the Team Foundation Build server. The build results (along with any warnings or errors) are published back into TFS along with any JUnit test data if you execute JUnit tests as part of your build. Also you get to create and manage the build definitions in the Eclipse IDE and have one place to manage access to them etc.

So - the level of support for Java is very high and Microsoft has shown consistent investment in this area. We recently shipped some TFS 2010 Power Tools for Eclipse and we've also been shipping preview releases of Team Explorer Everywhere 11 alongside Team Foundation Server 11 (we're the same team inside the company).

To import history from SVN, that's the same as importing history from any SCM tool into TFS (or TFS into any SCM tool). You have a couple of options. You can take a snapshot and cut over at a particular point (such as a release) or you can migrate history. To Migrate history from SVN there are some partner solutions available including one from Timely Migration that I've seen a lot of customers have success with.

Hope that helps.



回答2:

After a year of working on a Java/JVM project using TFS, I would like to dissuade anyone from doing this. While TFS may be considered top-of-the-line for .NET developers, you won't find any Java Developers with any experience with it. There is the plug-in for Eclipse and a port to IntelliJ, but I've had terrible luck with both, though I'm guessing it's mainly because TFS does not work like any other VCS I've used.

On our team, we've estimated a 10-15% overhead due to TFS and complications caused by it. Days of work lost because TFS decided to overwrite files, days of troubleshooting issues caused by incomplete TFS Updates. We have done a branch in 6 months because the entire team lost two days the last time we did. It's common to hear the phrase "I just updated with your latest changes, can you come check to make sure nothing disappeared in the merge?". Instead of using Jira, we're stuck using the terrible issue-tracking in TFS, causing more yet more issues.

Several of the developers on the team have taken to either using git, either standalone or the git-tfs bridge. Others just copy the source tree prior to any 'risky' activities, like updating or checking in.

Either way, I wouldn't recommend it for a team that does not have experience with it...



回答3:

I like the answer of @Martin_Woodward a lot, but it is too much biased in my opinion, so I add my 2 cents here. We in our company are in a similar situation, and the decision (in my opinion) depends on the context. I can see 3 different situations, and the decisions may be different in each one:

  1. You are mostly developing .NET solutions, and the Java parts are integrated in the .NET solutions.
  2. Your .NET solutions are independent developed from the Java solutions, and they are half .NET, half Java.
  3. Most of your solutions are developed with Java, and only a small percentage is developed with .NET

I would agree with Martin only in the first case. You will gain profit from the common development environment, source code control, build process ... Your Java guys will learn the differences to TFS Source Control (does it have a name??). And your future will look bright ;-)

If your .NET solutions and Java solutions are independent from each other, the only argument to use TFS for developing Java solutions is cost in operation. And you should carefully look at it, if the savings for operating the development environment only TFS will out weight the additional cost of switching your Subversion projects to TFS.

In the last case, it would be an awful decision to switch with a lot of people just to have a common environment to develop. You may integrate Subversion into VisualStudio (using e.g. VisualSVN or other plugins), and you have nearly no invest at all.

The migration of source code including history is normally a pain, and it depends on the source and target if that works well. We have good experiences with CSV and SVN, but no (good) experience with others. But that is normally not a problem, you may use your old SVN repositories (read-only) and just migrate the last milestone. After some time, SVN repos may be let alone ...



回答4:

After 1 year working with TFS/Java I completely agree with Dusty J (Yes, TFS/Java is bad) and completely disagree with Martin Woodward about great Microsoft support. Although for my duty as a developer the Eclipse TFS is OK, the problems are for my build/release duties.

First, this Eclipse plugin does not allow creating a branch for several projects at once as in CVS/SVN. One needs to create a branch separately for every project. Then we cannot keep the same project names in the branch – one needs changing a project name and after checking out from the branch to rename to the original name. See also my post How to associate an Eclipse Workspace with TFS workspace?, there is no way to associate an Eclipse workspace with TFS workspace. Thus, the mapping for a local folder cannot be saved; it needs to be done again after opening another Eclipse workspace for branch building. And since the local mapping is the same there is a possibility of erasing a local folder with unsaved work as Dusty J wrote.

This removing local files without warning is a terrible feature of TFS (see the post Why command get from a command line in TFS removes parallel projects?). What Microsoft thinks about the possibility of erasing local files just under regular option "Remove Local Mapping" in Eclipse?

So, despite my effort to learn TFS I still spend 10 times more time for various builds as compared to CVS I used before.



回答5:

(Another biased MS employee)

TFS formed a team about 18 months ago to focus solely on making the Java experience great in TFS/Team Services and across all platforms. I am on that team and I think we have made a ton of great progress. I won't disagree that the end to end story was pretty bad when this question was asked, but I think the answer has changed quite a bit in the last year.

My team provides build and deployment tasks for TFS as well the plugins for Eclipse and IntelliJ to make the end to end experience as complete as possible. We are also working hard to make sure we document how to get the best out of TFS if you are a Java developer.

If you want more details, checkout http://java.visualstudio.com.

Thanks, Jason Prickett



回答6:

Why not use SVN for the .NET projects? Is there any reason for that? There are multiple plugins for SVN in Visual Studio as well as a windows shell extension.