Guide for a new project using Maven, Eclipse and Git on Windows PC and Laptop

Aim

Work on a laptop and/or a PC, with a Linux Mint also hosting the main Git bare repo.

This page is for my benefit and refers to my other cribsheets.

Downloads

On both PC and Laptop you will need git, eclipse (and eGit), maven, java (JDK1.8 pre release). Google is your friend for finding the URL’s.

I tend to install everything under c:\java to avoid any cygwin script hell with spaces in “Program Files”

Home dir

The maven repo, Git config etc will all be stored under your c:\users\<yourname> dir. If you don’t want that then you are going to have to work harder and I won’t tell you how.

Changing the cmd

This is a personal preference. I set up a cmd shortcut which runs as:

%windir%\system32\cmd.exe /K c:\2013-dev\jd18_env.bat

Where the .bat script is as below:

set JAVA_HOME=c:\java\jdk1.8.0
set MAVEN_BIN=c:\java\apache-maven-3.0.4\bin
set ECLIPSE_BIN=c:\java\eclipse
REM needed for eGit apparently
set HOME=c:\Users\<yourname>
   
set PATH=%JAVA_HOME%\bin;%MAVEN_BIN%;%ECLIPSE_BIN%;%PATH%

I use this for everything dev - means I can switch JDK etc with ease.

Git

See my Git on Mint for how to set up projects using a Linux server and windows clients.

Or see the windows setup of you have no linux server - but that never really worked well, so stick with SVN in that case.

Eclipse

Install eGit - google for this, or more quickly just get it from the update site:

http://download.eclipse.org/egit/updates

I did not get the jGit downloads, prefer to stick with Git for now.

A New Eclipse Plug-in: MoreUnit

Its a very simple plugin - but I am loving it.

http://moreunit.sourceforge.net/

Eclipse update site is: http://moreunit.sourceforge.net/update-site/

Maven

See my maven cribsheet for creating the project and using maven