Executable war file that starts jetty without maven

后端 未结 9 538
野趣味
野趣味 2020-12-04 05:03

I\'m trying to make an \"executable\" war file (java -jar myWarFile.war) that will start up a Jetty webserver that hosts the webapp contained in the WAR file I

9条回答
  •  死守一世寂寞
    2020-12-04 05:49

    This is an adaptation for Maven of @RobHruska's answer. It just copies the files of the main class and merges the Jetty JAR files into the WAR file, nothing new, just to simplify your life if you are new -like me- to Maven:

    
        maven-antrun-plugin
        
            
                move-main-class
                compile
                
                    
                        
                            
                                
                            
                        
    
                        
                            
                            
                            
                                
                                
                                
                                
                            
    
                            
                                
                                
                                
                                
                                
                                
                            
                        
                    
                
                
                    run
                
            
        
     
    
        org.apache.maven.plugins
        maven-war-plugin
        2.2
        
            true
            
                
                    main.Main 
                
            
        
    
    

提交回复
热议问题