git - SCM Maven插件配置时如何指定git标签?

标签 git maven maven-3

作为项目配置的一部分,我正在尝试从 GitHub 存储库中 check out 特定标签。目前插件配置如下:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-scm-plugin</artifactId>
            <executions>
                <execution><!-- checkout the msgppack-rpc project -->
                    <id>msgpack-rpc-checkout</id>
                    <phase>validate</phase>
                    <goals>
                        <goal>checkout</goal>
                    </goals>
                    <configuration>
                        <goals>checkout</goals>
                        <connectionUrl>scm:git:https://github.com/msgpack/msgpack-rpc.git</connectionUrl>
                        <tag>java-0.6.0</tag>
                        <checkoutDirectory>repoCode/msgpack-rpc</checkoutDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>

但是,“tag”元素似乎被 Git SCM 提供者忽略了。我还尝试将标签直接放在 URL 中,例如所以:

scm:git:https://github.com/msgpack/msgpack-rpc.git/refs/tags/java-0.6.0

不幸的是,这种格式和这种格式的其他排列会产生错误。我没有其他想法,而且我在任何地方都找不到这个用例的例子。

最佳答案

checkout goal没有 <tag>作为参数列出的元素。看起来您像这样指定标签信息:

<scmVersionType>tag</scmVersionType>
<scmVersion>java-0.6.0</scmVersion>

关于git - SCM Maven插件配置时如何指定git标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10260449/

相关文章:

git - 跨越多个 git 提交的 Phabricator 审计

git - 为什么 Bitbucket Server 在本地存储 LFS 对象?

Eclipse/Git - pull 失败的脏工作树

git - 将特性分支推送到 Origin 是好的做法吗?

hibernate - 如果父 pom 具有 Java EE BOM 依赖项,是否应该在子 pom 中显式提及所有依赖项?

java - Maven:自动安装外部JAR

java - 按类级别强制执行最小 JUnit 总覆盖率?

java - 如何默认跳过集成测试,但仍然在多模块 Maven 项目中按需运行它们?

java - 将我的本地 .m2 文件夹作为存储库

linux - java.lang.NoClassDefFoundError : org/codehaus/plexus/classworlds/launcher/Launcher when running bash file to build the project 错误