Tomcat 8 integration with Maven

后端 未结 4 457
感情败类
感情败类 2020-12-25 15:25

It sounds like Eclipse (Kepler) does not have a proper plugin for Tomcat 8. I want to deploy my .war into Tomcat 8 and run it by Maven pom.xml file. Can anyone provide me st

4条回答
  •  醉话见心
    2020-12-25 15:53

    Example of how to run your war with cargo & tomcat8

    mvn clean verify org.codehaus.cargo:cargo-maven2-plugin:run -Dcargo.maven.containerId=tomcat8x -Dcargo.maven.containerUrl=http://repo1.maven.org/maven2/org/apache/tomcat/tomcat/8.5.9/tomcat-8.5.9.zip
    

    If you want to add it to your pom

    
      org.codehaus.cargo
      cargo-maven2-plugin
      ${cargo.version}
      
        
          tomcat8x
          
              http://repo1.maven.org/maven2/org/apache/tomcat/tomcat/8.5.9/tomcat-8.5.9.zip
          
        
      
    
    

    Then to run you war (if your pom is a war)

    mvn cargo:run
    

    To run with debug (memory options not necessary)

    
      org.codehaus.cargo
      cargo-maven2-plugin
      ${cargo.version}
      
        
          tomcat8x
          
              http://repo1.maven.org/maven2/org/apache/tomcat/tomcat/8.5.9/tomcat-8.5.9.zip
          
        
        
          
            
            -Xmx2048m -Xms512m
            -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
          
        
      
    
    

    Then you need to create a remote debug configuration in your IDE on port 8000 (port by default if nothing specified)

    More commands here : https://codehaus-cargo.github.io/cargo/Maven2+plugin.html#Maven2plugin-TheCargoMavenpluginindetail

提交回复
热议问题