Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven Quick-start Guide [closed]

Tags:

maven-2

maven

I'm tasked with getting a development environment set up for a new program at work. The lead has chosen Eclipse as the IDE for its OSGi support and Maven as the build utility.

I've struggled through getting Maven integrated with Eclipse and I'm grudgingly declaring success and moving forward.

My question: is there any sort of guide to getting started with Maven? I've found boatloads of documentation, most all of it very, very detailed and simultaneously unhelpful. I downloaded a 300+ page book that goes into excruciating detail about POMs, but doesn't tell you how to initialize a project from existing source.

Hopefully, this question will result in a pointer to something I missed or a collection of links for those who follow me.

like image 555
Dave Avatar asked Apr 22 '10 15:04

Dave


People also ask

When I issue Maven install what all things happen in background?

On a mvn install , it frames a dependency tree based on the project configuration pom. xml on all the sub projects under the super pom. xml (the root POM) and downloads/compiles all the needed components in a directory called .

What is the difference between groupId and artifactId in Maven?

The groupId is a parameter indicating the group or individual that created a project, which is often a reversed company domain name. The artifactId is the base package name used in the project, and we use the standard archetype.

What is groupId in Maven project?

groupId uniquely identifies your project across all projects. A group ID should follow Java's package name rules. This means it starts with a reversed domain name you control. For example, org.apache.maven , org.apache.commons.

What is the difference between Maven and maven2?

Maven 1 included a plugin for working with related of projects—or multiprojects. Maven 2 takes multiproject builds a step further by including a specialized parent descriptor and native multiproject execution support.


3 Answers

If you are new to Maven, I'd still suggest to start with Maven by Example, the "first" book of Sonatype.

This book is an example-driven introduction. If you are new to Maven, read this book first. It will introduce all of the basics and take you all the way up to a multi-module enterprise project.

Maven by Example is really not that big and reading it is definitely worth it. Sure, there are other tutorials around there and you could get started without reading it but the fact is that this book has been written for beginners and will give you the basis to understand how things work. It will just save you some time later.

Later, use Maven: The Complete Reference as... complete reference.

like image 115
Pascal Thivent Avatar answered Sep 18 '22 14:09

Pascal Thivent


I personally got a lot of value out of "Better Builds with Maven". It is also free, which I like. http://repo.exist.com/dist/maestro/1.7.0/BetterBuildsWithMaven.pdf. The maestrodev site has a bunch of examples as well.

like image 39
revdrjrr Avatar answered Sep 18 '22 14:09

revdrjrr


As a basic start i would suggest to take a look at 5 Minutes Guide on the Maven site. If you have an existing project you should take a look in particular the folder structure and check if your's fit with the default folder structure if not change it accordingly. Is your software organized in Modules as Maven expect it? What kind of Project do you have (EAR, WAR, ?). If start you have to write a pom and define the depenencies etc. and try to compile your project via Maven...

like image 45
khmarbaise Avatar answered Sep 18 '22 14:09

khmarbaise