seb*_*ner 5 git version-control maven
我想使用Maven来检查Git存储库.在我们的特定用例中,这有意义,因为这个Git存储库包含我们需要包含在构建过程中的文件.
由于项目的性质,Git存储库可能具有不同的分支.所以很简单:scm:git:git@github.example.com:myproject/project.git
不会工作,因为这将结帐主人.我想例如分支"3.0V3"
有没有办法可以指定哪个分支Maven会结账?
您可以使用<scmVersion>和<scmVersionType>性能的Maven插件单片机来实现这一目标.
<scm>
<developerConnection>scm:git:url</developerConnection>
</scm>
...
<build>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.8.1</version>
<configuration>
<connectionType>developerConnection</connectionType>
<scmVersion>branch-name</scmVersion>
<scmVersionType>branch</scmVersionType>
</configuration>
</plugin>
</plugins>
...
</build>
...
</project>
Run Code Online (Sandbox Code Playgroud)