Maven Step by step for beginners

1. Download Maven from Maven site.

2. Extract and put it into a location of your PC.

3. Set bin directory(Ex. : "C:\Downloads\apache-maven-3.2.1\bin") of maven to path environment variable(How to setup path variable)

4.Create a sample maven java project(Maven Project Structure) and put your pom.xml file into a maven project root folder like this


    4.0.0
    com.springapp
    HelloWorldSpring
    war
    1.0-SNAPSHOT
    HelloWorldSpring

    
        4.0.2.RELEASE
    

    
        
            org.springframework
            spring-core
            ${spring.version}
        

        
            org.springframework
            spring-web
            ${spring.version}
        

    

    
        HelloWorldSpring
        
            
                maven-compiler-plugin
                
                    1.6
                    1.6
                
            
            
                maven-surefire-plugin
                
                    
                        **/*Tests.java
                    
                
            
        
    


5. Then Run proper maven command from command prompt.You can use "mvn -version" tocheck maven version and setup confirmation.And then go-to your maven java project root directory and run "mvn clean package" command for initial packaging a java project.

Reactions

Post a Comment

0 Comments