Maven DEV ENVIRONMENT SETUP Instructions
Hi Reader,
This is my fourth post. I going to start on how to setup maven DEV environment in Eclipse IDE.
This is my fourth post. I going to start on how to setup maven DEV environment in Eclipse IDE.
Maven is a project management and comprehension tool. Maven provides developers a complete build lifecycle framework. Development team can automate the project's build infrastructure in almost no time as Maven uses a standard directory layout and a default build lifecycle.
Objective
- Make the development process visible or transparent
- Provide an easy way to see the health and status of a project
- Decreasing training time for new developers
- Bringing together the tools required in a uniform way
- Preventing inconsistent setups
- Providing a standard development infrastructure across projects
- Focus energy on writing applications
Build Profile
A Build profile is a set of configuration values which can be used to set or override default values of Maven build. Using a build profile, you can customize build for different environments such as Production v/s Development environments.
Different Types of Profile
- Per Project – Defined in the POM itself (pom.xml).
- Per User – Defined in the Maven-settings (%USER_HOME%/.m2/settings.xml).
- Global – Defined in the global maven-settings (%M2_HOME%/conf/settings.xml).
- Profile descriptor – Descriptor located in project basedir (profiles.xml)
MAVEN Repository
Repository is in maven is used to build artifacts and dependencies of varying types.
1. Local Repository
2. Remote Repository
Local Repository refers to a copy on your own installation that is a cache of remote downloads and contain temporary downloads.
We need to change the default local repository folder from default .m2({M2_HOME}\conf\settings.xml) to another meaningful name.
<settings>
<localRepository>D:/maven_repo</localRepository>
Local Repository changed to D:/maven_repo.
Remote Repository refers to any other type of repository access by variety of protocols as file and http.
<project ...>
<repositories>
<repository>
<id>java.net</id>
<url>https://maven.java.net/content/repositories/public/</url>
</repository>
</repositories>
</project>
Install Apache Maven
We can download Maven from the below link.
http://maven.apache.org/download.cgi
Copy the Apache Maven into the folder D:/
Environmental Variable
1. Create JAVA_HOME System Variable.
2. Create MAVEN_HOME System Variable.
3. We need to add JAVA_HOME and MAVEN_HOME in System path variable.
Add %JAVA_HOME%\bin;%M2_HOME%\bin; to the System path.
Install Tortoise Hg
We can install tortoise Hg from the below link.
http://tortoisehg.bitbucket.org/download/
Install tortoise Hg in the system.
Cloning the Code from Repository
Clone the latest codebase from the repository.
Steps
1. Right click on drive where you need to copy the codebase.
2. Click on the Tortoise Hg.
Click on clone.
Click Cone and provide Username and Password.
Once the clone is completed then below screen will display
Once the Clone is successfull click cancel.
Cloning maven_repo for IA from Repository
Cloning process is same for codebase and maven_repo.
Source - URL path
Destination - D:/dev/codebase
Bulid Project
In order to build project we need to configure maven_repo
Go to D:/apache-maven-2.2.1/conf folder.
In settings.xml file change the configuration.
<localRepository> D:\dev\Maven_repo</localRepository>
Open the command promot.
Use "mvn clean install" command at particular project which we need to build.
Build successful message will come in the command promot once the build is successful.
I will continue Eclipse Integration in my next blog









No comments:
Post a Comment