Maven: Using a Plugin Based On Profile

后端 未结 2 1407
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-13 15:37

I have a file which maintains a build-number for release build. Everytime a release build is made, this number is incremented and the file is saved into svn repository.

2条回答
  •  故里飘歌
    2021-02-13 16:32

    I would suggest you take a look at the documentation for build profiles first. You can find that here. The first thing you want to look over is this section:

    How can a profile be triggered? How does this vary according to the type of profile being used?

    Basically, once you understand that, note that what you put in your profile section is pretty close to what you have outside your profile. That being said, if you need a profile specific build section, it should emulate what you would have outside the profile - if you take a look at the pom.xsd it is the exact same I believe.

    So, for example:

    
        
            full-build
            
                
                    build
                    full
                
            
            
                
                    
                        org.codehaus.mojo.webstart
                        webstart-maven-plugin
                        1.0-beta-1
                        
                            
                                package
                                
                                    jnlp
                                
                            
                        
                        
                            src/main/web
                            ....
    

    This would be triggered by running: mvn package -Dbuild=full

    I hope this helps.

提交回复
热议问题