Tuesday, June 26, 2012

Maven configurations

Add environment variable
  • M2_HOME
  • M2  : %M2_HOME%\bin.
  • MAVEN_OPTS: -Xms256m -Xmx512m   //Optional
System  variable 
Add bin location to Path

Setting local maven repository location

local configuration <maven_home>\conf\settings.xml
  <localRepository>/path/to/local/repo</localRepository>

Adding Repository
       <repositories>
           <repository>
          </repository>
     </repositories>

By default maven set local repository to location ~/.m2/repository which some times create problem in copying the jars because of length of folder location. Its better to keep it pointed to some different folder location.

Dependency tree:
mvn dependency:tree | grep log