Quick start with maven and Create a Sample Central Repo for your team

  • Download maven-apache-maven-3.0.3-bin
  • Unzip
  • open conf folder
  • edit the "settings.xml" (before editing take a back up).
  • In settings.xml file uncomment the localrepository -replace with the below one
  • E:/maven_local_repo
  • Create a folder by name- "maven_local_repo" share the folder.(right click and share)
  • Create a .bat file and name it as "mavenstartup.bat"
  • the contents of the mavenstartup.bat file is given below
  • @echo on
  • echo setting java_home
  • set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_07
  • echo JAVA_HOME to path
  • set PATH=%JAVA_HOME%\bin;%PATH%
  • echo setting MAVEN home
  • set MAVEN_HOME=E:\maven
  • echo adding maven home to PATH
  • set PATH=%MAVEN_HOME%\bin;%PATH%
  • echo test maven version
  • mvn --version
  • type the command-->mvn archetype:create -DgroupId=com.mysampleproject1 -DartifactId=mysampleproject
  • the above command will create a sample java project
  • type command-->mvn compile
  •  if things are fine you will get "Build Success Message"
  • convert the java project to eclipse project type-->mvn eclipse:eclipse
  • Open eclipse and import the project into the eclipse project.
  • You can use maven for compiling the project and eclipse as an editor.
  • You can make your own system as central repository by sharing the "maven_local_repo" folder.
  • all the other team members can access you folder.for compling and building.Only thing
  • that they shoudl do is download maven have a "mavenstartup.bat" file.They have to change the location
  • of to point to your system repo folder.
  • In this way you can prevent all the users from downloading the same jars again and again.


Popular posts from this blog

Spring MVC- Redirect from one controller to another

Integrating Struts2 with Spring Security using Custom Login Form