Showing posts with label Maven. Show all posts
Showing posts with label Maven. Show all posts

Tuesday, 10 March 2015

Create Deployment Jar with Maven

Create a single jar with all dependencies type "mvn assembly:assembly" from the command line.
Include following plugin in pom.xml
    
        
            
                maven-assembly-plugin
                
                    
                        src/assemble/distribution.xml
                    
                    
                        jar-with-dependencies
                    
                
            
        
    


Configuration details in descriptor file distribution.xml

    distribution
    
        jar
    
    
        
            
                README
                README.txt
                NOTICE
                NOTICE.txt
                LICENSE
                LICENSE.txt
                log4j.properties
            
        
    


Apache Maven Assembly Plugin

Tuesday, 15 December 2009

Maven


Apache Maven

Setup maven:

  1. Create a JAVA_HOME system variable.
  2. Create an M2_HOME system variable.
  3. Add %JAVA_HOME%\bin;%M2_HOME%\bin; to your system path.
  4. (Optional) Create a %MAVEN_OPTS% system variable. This variable name specified as java options in mvn.bat and mvn.sh. "-Xms512m -Xmx6024m"

Set configurations:

Configuration file (setting.xml) cab be found in two places:

  • The Maven install: $M2_HOME/conf/settings.xml (Global setting)
  • A user’s install: ${user.home}/.m2/settings.xml (User setting)

If both files configured then configuration in both will be merged and user setting will override global setting. 

Set the location for local maven repository:

Default local repository configuration details in setting.xml.

 

Include the following to entry to point to the local repository C:/maven/m2repository


/maven/m2repository








Friday, 11 September 2009

How to increase java heap size in Maven2?

Set an environment variable to increase the heap size.


set MAVEN_OPTS=-Xmx1024m