Download WAR from snapshot-repository and deploy to local JBoss using mvn

后端 未结 1 1629
[愿得一人]
[愿得一人] 2020-12-17 03:20

currently I deploy my war with jboss:hard-deploy to my JBoss 6 AS. This works fine, but I have to checkout project from SVN and package it.

1条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-17 03:47

    Ideally you would want to set up Jenkins to deploy to your testing server as part of your CI build.

    Alternatively, if you want to manually run a script on the server you are deploying to, you could set up a specific pom.xml to perform this task. First setup the dependency plugin to download your war:

      
        org.apache.maven.plugins
        maven-dependency-plugin
        2.3
        
          
            package
            
              copy
            
            
              
                
                  my-group
                  my-web-archive
                  my-vesion
                  war
                  my-web-archive.war
                
              
              ${project.build.directory}
            
          
        
      
    

    Substituting the group ID, artifact ID and version for the respective properties of your WAR file. Next configure the JBoss plugin to deploy the downloaded WAR:

      
        org.codehaus.mojo
        jboss-maven-plugin
        1.5.0
        
          /opt/jboss-6
          all
          ${project.build.directory}/my-web-archive.war
        
      
    

    You should then be able to download the artifact from your internal repository and deploy it in the locally running JBoss container with the following command:

    mvn package jboss:hard-deploy
    

    0 讨论(0)
提交回复
热议问题