Maven release via Hudson

前端 未结 4 2163
一个人的身影
一个人的身影 2021-02-02 01:06

I\'m setting up Hudson to use the batch-task plugin to do maven releases to our internal repository. I\'m doing it via:

mvn --batch-mode release:prepare
mvn --ba         


        
4条回答
  •  眼角桃花
    2021-02-02 02:10

    Recently, a m2release plugin came to my attention. Seemed nice. Althought, I would have liked my release process to be completely «pom-tweaking-free». What I mean by that is that we have to provide 4 input parameter to process a complete release:

    1. the release version (ex. 1.0.0)
    2. the new development version (ex. 1.0.1-SNAPSHOT)
    3. the release tag in SCM (ex. release-1.0.0 or 1.0.0)
    4. the tag base path in SCM

    The first 2 have acceptable defaults. The version bumping at the bug-fix version digit is perfectly fine for me.

    Number 4 can be specified in the pom. It won't change.

    
        org.apache.maven.plugins
        maven-release-plugin
        
            https://example.com/svn/myProject/releases
        
    
    

    It's the third one that prevent me from a complete automation of a release at the push of a button. The default release tag label won't do it for us so we have to specify it:

    
        org.apache.maven.plugins
        maven-release-plugin
        
            release-${pom.version}
            https://example.com/svn/myProject/releases
        
    
    

    Now, while this might be just what I needed, I end up having a svn tag with the -SNAPSHOT at the end. :( So I have to pass the tag parameter in the Hudson job configuration. Furthermore, I have to go change it for each release we make ... which is not exactly what I need.


    So, in the end, having a maven2 type project in hudson + the m2release hudson plugin + the maven release plugin correctly configured is the Mother of all the release process I've seen so far. While not perfect, it saved me a lot tiedous work.

    JS.

提交回复
热议问题