This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
The short version of my questions is; is maven also a source control tool apart from being a build tool?
The long version is as follows; I have started playing a little with maven this last week. So far I have only used it from the console and I understand the advantages of using such a tool to manage the building process of a project. Therefore I decided that it was time to start migrating all the projects I have (using Ant) to start using maven. However I got confused.
I was (for some weird reason) planning to install maven on a server computer at home. I was thinking that maven would contain all my projects centrally and then I would get a copy of a project on my laptop and open it with Eclipse � In this scenario all builds were going to be done on the server computer! However if maven is not a Source Control application, then this is not possible! Right? Or? Eclipse can only synchronize with a Source Control tool (like CVS) as much as I know!
What I thought was to mix and merge maven with another source control application! In theory this should be possible! But I prefer having the opinion of other people that have come across this scenario before doing anything!
Thanks for any comments, Regards, Sim085
Simon Joseph Aquilina
Joined: Feb 14, 2006
On the maven.apache.org I found a good description on how a source control tool can be integrated with maven
I tought of trying and follow that out and see how it goes!
However I still am a little confused. As I said in my first post; I want to have a central place were to put all the projects and build them if needed. This is so that more then one person can work on the same project at the same time! However I was now thinking that I still would need maven on my laptop to build the project locally right?
Basically I am so new to maven that I do not know what is the best strategy to use to do what I described above!
Though i have not used Maven, the information on the Maven site says that
Release management and distribution publication: Without much additional configuration, Maven will integrate with your source control system such as CVS and manage the release of a project based on a certain tag.
I think it facilitates the easy use of source control tool and its integration with the development environment. But this itself does not look like a source control tool.
Maven (like Java) is a lot of different things - Maven is a project management tool, and a build tool, and it manages your dependencies, and...
The part you would install on your server at home would be a Maven repository - this is where "builds" would be hosted. This could be just a directory structure that is available through the web (like http://mirrors.ibiblio.org/pub/mirrors/maven2/) or a full-fledged webapp (like Proximity).
Maven isn't like a source control system, because it doesn't track changes in the source. But, kinda like a version control system, it can host different versions of your program artifacts (Usually just the resulting JAR or WAR of your project. However, one of these artifacts you can generate *can* be the project source - but it's "versioned" as one big zip file of the source, not as each file like a version control system would.)
So, now you have a Maven repository set up on your home server. To use this you would have to tell your maven projects where this repository is. You'd put something like this in your project POM -
If you have WebDAV, FTP, SSH, etc. set up on your server, you can add tasks to put builds in the repository using the "release" target.
ALso, if you have other projects that depend on your project, they can add your repository to download the version of the JAR they need.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Simon Joseph Aquilina
Joined: Feb 14, 2006
first of all thanks for the replies I really apreciate the comments! Just have another question; If I do set maven on the server, then I would still need maven on my laptop as well so thagt I can build the code locally right!?
What I am thinking is to maven with cvs on the server and maven alone on my laptop with eclipse as the ide. This would allow me to develop code locally, commit the changes I make on the server and then build a snapshot on the server.
What do you people think? Regards and thanks again, Sim085
That's pretty much correct - Maven must be installed on your laptop (because you're actually building the project there), but not necessarily on your server (because you may just be hosting files, no doing builds). If your server is just hosting a Maven repository, the directory structure has to match what Maven expects the repository structure to look like - you don't have to have Maven installed to do this. However, if your doing anything like automated builds on check-in (cruisecontrol, continuum, etc.) then you will need to install Maven on the server, as the server will actually be doing builds.