Introduction
What is Maven
Maven was originally started as an attempt to simplify the build processes in the Jakarta Turbine project. There were several projects each with their own Ant build files that were all slightly different and JARs were checked into CVS. We wanted a standard way to build the projects, a clear definition of what the project consisted of, an easy way to publish project information and a way to share JARs across several projects.
Configuration
JAVA_HOME System Variable
Right click on My Computer à Select Advanced system settings à select Environment variables under advanced tab.
Under system variables click on New àgive variable name as JAVA_HOME and variable value as
C:\Program Files\Java\jdk1.7.0_55(JDK
path).
C:\Program Files\Java\jdk1.7.0_55(JDK path).
Similarly create
a system variable ‘M2_HOME’ and value as D:\Fuse ESB\apache-maven-3.3.1(Maven
folder).
Similarly create
a system variable ‘Path’ and value as D:\Fuse ESB\apache-maven-3.3.1(Maven
folder).
Download and update the Maven configuration.
- Download maven from http://maven.apache.org/download.cgi
- Install maven to D:\Fuse ESB\apache-maven-3.3.1
- Create maven repo folder e.g. D:\ Fuse ESB\Maven_Repo
- Edit the global and personal settings.xml file to add the config you want e.g. change personal repo location (TODO: understand whats common config looks like)
- Add following repository tag to D:\Fuse ESB\apache-maven-3.3.1\conf\settings.xml:
<localRepository>D:\Fuse ESB\Maven_Repo</localRepository>This is for pointing Maven repository. All maven related jar’s will be downloaded into this folder.
Add profiles to Maven configuration.
Open JBoss Developer Studio,
goto Window à Preferences à Expand Maven à select User Setting. Browse
the user settings file as ‘D:\Fuse ESB\apache-maven-3.3.1\conf\settings.xml’
Then click on update
settings, click on Apply and Ok.
Goto Window à Preferences à Expand JBoss Tools à select JBoss Maven Integration à Click on Configure Maven Repositories.
Click on Add Repository and enter the following details as shown below.
Profile ID: jboss-ga-repository ID: jboss-ga-repository
Name: jboss-ga-repository
URL: http://maven.repository.redhat.com/techpreview/all/
Similarly add the following details too.Profile ID: jboss-earlyaccess-repository
ID: jboss-earlyaccess-repository
Name: jboss-earlyaccess-repository
URL: http://maven.repository.redhat.com/earlyaccess/all/
Now Maven repository will be downloaded into repository folder and project will build successfully with Maven configuration, we can see the following logs in console.