How to deploy a node.js app with maven?

前端 未结 4 673
死守一世寂寞
死守一世寂寞 2020-12-04 08:01

Most of our team consists of java developers and therefore the whole build / deployment / dependency management system is built on top of maven. We use CI so every build pro

4条回答
  •  一生所求
    2020-12-04 08:25

    I think you can find the answer in Grunt and the many available plugins.

    I'm actually working on a web project where the client-side is made with AngularJS. Nevertheless, I think the deployement process may partially answer to your question :

    In your pom.xml, you can do something like that:

    
        org.apache.maven.plugins
        maven-antrun-plugin
        1.5
        
            
                exec-gen-sources
                generate-sources
                
                    
    
                        
                            
                        
    
                        
                            
                        
    
                        
                            
                        
    
                    
                
                
                    run
                
            
        
    
    
    • First part is the npm install task: downloading of dependencies from node package.

    • Second part is the bower install task: downoading of other dependencies with bower (in my case, AngularJS, but you might not need this part)

    • Third part is the Grunt Release part: launching a Grunt task that includes Karma unit testing.

    You can find documentation about Grunt here. There are many available plugins like Karma unit testing.

    I hope this helped you.

提交回复
热议问题