I need to choose a VCS to embed within a Java application I'm developing. The Java application will interact with the VCS via an API, but the user will also interact with it directly via an Eclipse plugin.
3 candidate VCS have been identified: Mercurial, Git and Subversion. I need to choose one based on the following criteria (in no particular order):
Java API. This is not 100% necessary, because the application could issue VCS commands via the command-line if no Java API is available. However, an API would obviously be preferable
Eclipse plugin
Simplicity. The people using the VCS (indirectly via the application or directly via Eclipse), will be software developers, but probably not the most sophisticated of the species.
Licensing. The license must permit to use of the VCS (in the manner described above) in a commercial application
There may be other considerations I've overlooked, I'll update the question if any more spring to mind.
Thanks!
Java API: Subversion has bindings for Java, and there is some kind of reimplementation of Mercurial in Java going on (see the dev mailing list).
Eclipse Plugin: There are plugins that support all three for Eclipse.
Simplicity: Subversion arguably has a simpler model being centralised. Mercurial tends to be simpler than Git to learn and use, while otherwise being quite close in features.
Licensing: Git and Mercurial are GPLed, but you can invoke them via the command line with no licensing implications. Subversion uses the Apache license, which is not copyleft.
Now - why not write an interface that abstracts the differences so you can support all three? Mercurial and Git are very similar, so it should be relatively straightforward to at least support these two.
First of all, I'd scratch out Subversion unless your application has a workflow that works especially well with a centralized VCS. And even then I'd try to use Mercurial or git since svn is just so slow.
Regarding Mercurial (hg) vs Git, I personally would choose git. On one hand, hg is simpler and more intuitive, but git is much faster and has much more mindshare than hg does.
Scriptability might be an issue though. Git is really made to be scriptable from a Unix shell (although it will run on windows with some gnu software installed). Hg has a python interface, but if I recall correctly has some C extensions that will probably make it impossible to use with jython. That said, it looks like there is a third-party git library for Java: http://eclipse.org/jgit/
Regarding licensing, hg and git are both GPLed, but if you shell out to them that shouldn't be an issue. SVN uses an Apache license, so it might win on this front (basically, you can do whatever you want with it).
Related
What I want to know is, there are many java implementation for access git.
Is there a way to use thees libraries?
I have seen so many tutorials saying how access git via java code. Its a single class that has git functions. But there is no consideration how we use thees code for real application.
Then without using plug in IDEs(jgit,egit....) or CLI tool how we use thees libraries for our java project?
The one library that you can use outside of any IDE, and for any of your java project, is JGit (sources at GitHub, User Guide).
See "Confusion in choosing between JavaGit, JGit and EGit"
That library can be used independently of Eclipse.
As I mention in this answer, the package org.eclipse.jgit.test/tst/org/eclipse/jgit includes tons of tests, for you to take example of.
This JGit cookbook project is also a good source of examples.
Ive been using eclipse and my-eclipse to code android and Java projects. I want to be able to back up my code. I know there is a way to back up code so that i can retrieve not only entire projects but changes and old versions but I cant figure out what the software is called and cant find any that are free and easy to implement. Any help would be great!
EDIT:
I don't have a server, can any of these be set up to save locally?
I think you'll want to use version control software. There are great solutions out there - CVS, SVN, Git, Perforce. Most of them integrate nicely into Eclipse.
Developing software without VCS is unthinkable to me.
Any of the plugins mentioned here will do, but I'm using the Subclipse plugin and a free repository at Assembla right now. I only switched from Mercurial because I started using Subversion at work.
If you don't have a server, you can try a free configuration at Assembla.com (http://www.assembla.com/catalog/tag/Free) for either Subversion or Git, and I've used Bitbucket.org in the past for hosting projects with Mercurial. Even the free configurations should be enough for your needs. I divided mine up between multiple projects.
Subversion (at subversion.tigris.org) is one excellent package; there are many others. There are excellent Subversion plugins for Eclipse (google "Subclipse".)
You may look to use the Subclipse package for Eclipse to use it with SVN. It permits you to keep/track/rollback changes and so.
The second option works fine if you need immediate result is to use Dropbox. It is easy to configure and easy to share the folders among multiple computer.
One more vote for using a VCS: in addition to back up you are getting control and some degree of methodology in your project.
Centralized solutions like CVS, SVN and Perforce mostly require setup and maintenance (some of them can run on flat files but these configurations are less popular). I would also consider one of the "Big Tree" distributed VCS Git, Mercurial and Bazaar.
Mercurial seem to have strong Eclipse plugin
What do you use to automatically deploy applications for various kinds of server applications (web, socket, daemon) that uses various technologies (different DBs, languages, etc)?
Here we use Python, Java and Ruby, and may use other languages as well in the future.
Update: I ended up using Puppet to manage all server setup, configs AND deploy. To trigger the deploy of newer versions I ended up using Python Fabric scripts.
I use Puppet for some of the deployements / initial configuration of server. Maven and Ant for Java based projects.
You could use Ant, Makefile, or a batch script. Or a combination of them.
Go for KWateeSDCM. It comes with a straightforward web GUI and does not require obscure scripting and integrates nicely with your build chain via a REST API.
We use Maven and pull out to the ant-plugin when required. In turn the ant-plugin very occasionally calls out to some native scripting language/application/packager/whatever but we're finding that over time we can generally find a Maven or ANT plugin/task to do the trick.
You might want to look up Continuous Deployment, it's a pretty hot topic in the build and CI space right now.
For Python you could use Fabric or Paver
For Ruby, there's capistrano and 'vlad the deployer'
For Java, it's the Ant.
For PHP/Python projects I also use Peritor Webistrano, a neat frontend for capistrano. It involves changing a few of the default recipes to remove the rails-specific stuff, but it's worth it once you get it setup correctly.
I think the best choice you could do is using maven. Even if maven is mostly used for Java projects, you can with the right plugins (or the one you write) deploy anything anywhere.
you can use maven, ant, ivy along with hudson for java projects.
We use Ant or Maven for different projects we have in house (depending on the need and how old the project is too...). We tend to use Jenkins (formerly known as Hudson) as our build and deployment tool.
And then we encourage developers to write code that does not hard code to DB's, URL's, etc. We try to abstract via the container (ie, Data Sources, pure JMS API's, etc) when running within an app server. And we tend to abstract environment specifics via properties files that we look up at runtime. The path to the properties file is to be defined as a variable on the server. This way we can be flexible enough to build code once and move it through to all our environments.
We're starting a project written in Java in a company which works purely on MS technologies. Microsoft Team System is used as source control tool. A question is whether we should try to integrate Eclipse with MTS (which makes sense from the top level as there would be still a single repository for the company) or we should try to setup another source control tool - most likely Subversion (which makes sense from developers perspective)?
Anyone tried to marry Team System with Java projects? Does it makes any sense?
You can use Team Foundation Server with Eclipse with Teamprise.
As for whether it makes sense or not depends on the environment. If you are one of many projects, just one that happens to be Java, it does not make sense to reinvent the wheel and implement SVN, unless the business is making a clean deliniation between Java projects and MS projects ... and realizing they have two places to get metrics for projects, which can be nasty.
I would vote on TFS, personally, as there is already an investment in TFS.
I work on a project that uses eclipse and teamprise to use TFS with java. While the experience isn't perfect, it does work fairly well.
Since your company already has an investment in TFS I would stick with that if you and your team have comfort with TFS as a version control system. However, if you are comfortable with subversion and not with TFS, then I say just make the switch to subverison and you won't look back.
My team is in a similar situation...our company has recently standardized on TFS for source control, and we are a Java group (with many other teams in my company being Microsoft...thus the decision to go with TFS). We are migrating from VSS, so we're actually pretty happy to get to a more modern system (although I would have preferred SVN).
We use IntelliJ IDEA, and with version 8.1 they now have integrated TFS support. So far it seems to be working quite well. We also use Hudson for our continuous integration server and there is a nice TFS plugin for that, too. From our Ant scripts we are using the free Teamprise Ant Tasks when we need to access TFS.
One thing the might be helpful if you end up using tfs (but not teamprise) is the Team Foundation Power Tools 2008 adds Window Explorer extension support (although I wish it has ‘get specific version’ as a menu option)
http://msdn.microsoft.com/en-us/teamsystem/bb980963.aspx
From the above link...
"Windows Shell Extension - Allows core version control operations within Windows Explorer without using Team Explorer."
It's free now (after March 2012).
Microsoft.com; Download
Is there a distributed version control system (like git or Mercurial) that can be used as an embedded library in Java applications (to implement versioned and synchronizable storage for application data), ideally written in pure Java and under a permissive license?
#Josh Moore's reply led me to JGit, which seems to be a competitor to JavaGit. JGit is pure Java and licensed under BSD.
Some further digging unearthed HgKit, which aims to implement Mercurial in Java. It is still pre-alpha and GPLed.
I do not know of any pure Java solutions. But, check out http://javagit.sourceforge.net/ you can use it to connect to a git repository with Java.
There is a pure Java library, SVN Kit for interacting with Subversion