Spring Boot and ebextensions

后端 未结 5 1268
走了就别回头了
走了就别回头了 2021-02-20 11:54

I\'m trying to add an .ebextensions folder to the root level of my jar to be deployed to AWS elastic beanstalk.

My folder structure is:

main:
--src
--re         


        
5条回答
  •  我寻月下人不归
    2021-02-20 12:14

    This works for me, is the cleanest way (in maven) I found to solve this:

    Add .ebextensions in the root of your project and add this snippet at the end in the plugins section:

    
                org.apache.maven.plugins
                maven-antrun-plugin
                1.6
                
                    
                        prepare
                        package
                        
                            
                                
                                
                                    
                                
                                
                            
                        
                        
                            run
                        
                    
                
            
    

    This plugin use ant to unzip the final jar generated by spring boot, copy the .ebextensions in the root and zip (jar) again with the same name. Tested and working in production :)

    Works with Spring 1.5.3.RELEASE

提交回复
热议问题