How can I do a git pull in Maven?

后端 未结 3 775
余生分开走
余生分开走 2020-12-25 08:59

I\'m new to both maven and git and wanted to get some help in setting a project.

Is there a way to define a goal in the pom to push/pull from git during linked to a

3条回答
  •  孤独总比滥情好
    2020-12-25 09:32

    Good idea or not, here's how you could do a checkout (pull clone from Github) using Maven. Have your pom.xml look like this:

    
    
    4.0.0
    br.com.javamagazine
    engesoft
    war
    0.0.1-SNAPSHOT
    engesoft Maven Webapp
    http://maven.apache.org
    
    
        scm:git:git://github.com/vitorsouza/EngeSoft.git
        scm:git:https://vitorsouza@github.com/vitorsouza/EngeSoft.git
        https://github.com/vitorsouza/EngeSoft
    
    
    

    Then use mvn scm:checkout. When I ran this, it pulled the code to folder target/engesoft. There's probably a way to configure it to place it somewhere else. Check out the following pages:

    • Maven SCM Plug-in
    • Git implementation for the SCM Plug-in

提交回复
热议问题