How to customise the tag format of the Maven release plugin?

前端 未结 3 2380
慢半拍i
慢半拍i 2021-02-19 16:04

In our SVN repo, we store tags like this:

trunk
    project_a
    project_b
branches
    project_a
        branch_x
        branch_y
    project_b
tags
    proje         


        
相关标签:
3条回答
  • 2021-02-19 16:27

    The release plugin now supports the tagNameFormat configuration option, which defaults to @{project.artifactId}-@{project.version}. In your case, you could do something like:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
            <tagNameFormat>@{project.artifactId}/@{project.version}</tagNameFormat>
        </configuration>
    </plugin>
    
    0 讨论(0)
  • 2021-02-19 16:29

    It looks like this is not possible until one of these bugs is fixed:

    • MRELEASE-150: Can't add prefix to tags without affecting version (not scheduled)
    • MRELEASE-159: Support a pattern to generate the release tag (scheduled for 2.2)
    • MRELEASE-259: Provide a configuration settings for default tag/label to use when releasing (not scheduled)
    0 讨论(0)
  • 2021-02-19 16:38

    If you are passing in the releaseVersion, you can do this:

    <tag>${project.artifactId}/${releaseVersion}</tag>
    
    0 讨论(0)
提交回复
热议问题