Adding Tomcat Server in Intellij

前端 未结 2 1135
半阙折子戏
半阙折子戏 2020-12-29 23:43

There are many questions on this website regarding that please be assured that I have checked them and didn\'t find my answer.

I am really a newbie in IntelliJ. He

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-30 00:25

    Did you think of using maven? If you do so, you can use the "tomcat7-maven-plugin" and its goals "deploy" and "undeploy".

    Here's an example pom.xml:

    
    
        4.0.0
    
        de.example
        0.0.1-SNAPSHOT
        dm-p0-servlet
    
        
            
                
                    org.apache.tomcat.maven
                    tomcat7-maven-plugin
                    2.2
                    
                        http://localhost:8080/manager/text
                        tomcat7-local
                        /miniservlet
                    
                    
                        
                            clean-undeploy
                            clean
                            
                                undeploy
                            
                        
                        
                            package-deploy
                            package
                            
                                deploy
                            
                        
                    
    
                
            
        
    
        
            
                javax.servlet.jsp
                jsp-api
                2.2
                provided
            
            
                javax.servlet
                javax.servlet-api
                3.1.0
                provided
            
    
        
    
    

    The element tomcat7-local refers to the section in ~/.m2/settings.xml, where the credentials for the Tomcat server authentication are stored:

        
            
                tomcat7-local
                adminScript
                geheim
            
        
    

    The username "adminScript" and its password are defined in /conf/tomcat-users.xml .

提交回复
热议问题