Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify a git tag when in the configuration of the SCM Maven plugin?

Tags:

git

maven

maven-3

As a part of my project's configuration, I'm trying to checkout a specific tag out of a GitHub repository. Currently the plugin configuration is as follows:

        <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>

However, the "tag" element seems to be ignored by the Git SCM provider. I've also tried to put the tag directly in the URL, like e.g. so:

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

Unfortunately, this, and other permutations of this format produce errors. I have no other ideas, and I've failed to find an example for this use case anywhere.

like image 703
mikołak Avatar asked Apr 21 '12 15:04

mikołak


1 Answers

The checkout goal doesn't have the <tag> element listed as a parameter. It looks like you specify the tag info like this:

<scmVersionType>tag</scmVersionType>
<scmVersion>java-0.6.0</scmVersion>
like image 71
user944849 Avatar answered Sep 28 '22 01:09

user944849