RSS feed
All(28) Eclipse(4) Java(5) JDBC(5) JSP(3) Maven(7) Personal (1) Spring(3) Tomcat(5)
<< Helpful JSTL Examples | Home | My Most Commonly Used Maven (2.0) Reference URLs >>

Simplified Maven Setup Step 1

This assumes that someone has set up your internal maven repository for your organization,  or that you have already generally this person would supply the second settings.xml file below.

There will are two files both name settings.xml with different content that are saved at different places on your laptop/workstation.

1st settings.xml - your information

2nd settings.xml - organizations repository information

I setup the maven internal repository following the directions at

Better Builds with Maven (based on maven 2.0)

http://www.mergere.com/m2book_download.jsp

 We used apache as the web server and enabled access via http to pull new artifacts and we use scp to upload to new artifacts.

Install maven somewhere on your hard drive and define MAVEN_HOME directory as an environment variable.

On my machine this is the default location:

MAVEN_HOME=C:\Program Files\Apache Software Foundation\maven-2.0.4

I would also set

MAVEN_OPTS=-Xmx1024m

Or whatever as a high number your machine can allow, to allow maven to compile for large (firestom) projects

I would also make sure that maven is in your path

My PATH variable is obviously depending on versions of the Java, Ant and Maven this will differ for you but I would suggest having Java , Ant and Maven all in your path

PATH=C:\java\apache-ant-1.6.5\bin;C:\Program Files\Java\jdk1.5.0_09\bin;C:\Program Files\Apache Software Foundation\maven-2.0.4\bin 
So you can run ant,mvn and javac from the command line .

The first file you store in

user.home directory\.m2\settings.xml

(has your profile and login information)

on my machine
C:\Documents and Settings\Robert Sinner\.m2\settings.xml


%MAVEN_HOME%/conf/settings.xml is for use across your organization

It has your internal repository's location, where you deploy your code to be shared with others in your organization.

on my machine
C:\Program Files\Apache Software Foundation\maven-2.0.4\conf\settings.xml

These steps are necessary to get maven set up to run from your laptop/workstation.

These must be completed before other steps can be followed.

 I.e. do this first before pulling down maven projects from svn repo.

Modify the first file to replace

                 <username>yourfirstname</username>
                 <password>yourlastname</password>

With your lower case firstname and lastname accordingly

If your installed tomcat location is at a different spot then modify
<cargo.tomcat5x.home>c:/opt/tomcat</cargo.tomcat5x.home>
as well.

Save the modified first settings.xml file your user.home directory\.m2\settings.xml

On my machine this is
C:\Documents and Settings\Robert Sinner\.m2\settings.xml  

The second settings.xml file copy can be shared across your organization and saved inside of
%MAVEN_HOME%/conf/settings.xml

On my machine this is C:\Program Files\Apache Software Foundation\maven-2.0.4\conf\settings.xml

Whoever set up your maven repository will give you this file. Or the settings for it. This basically has the name of the repository and the location where you are going to deploy your artifacts to.


Tags :



Add a comment Send a TrackBack