那么我的问题is...how我是否使用我当前所在的分支名称作为我的项目中依赖项的版本的一部分?
从这里开始,这是我所拥有的。
我有三个分支机构。大师,阿尔法和贝塔。
在其中的每一个下,都使用了一个公共的依赖项,称为a jar.jar……还有另外两个客户端项目使用该jar文件作为依赖项。
示例: automation-jar pom.xml文件
<groupId>com.example.jarfile</groupID>
<artifactId>example-jar</artifactId>
<version>${branch.name}-SNAPSHOT</version>示例:客户端项目1- pom.xml (使用automation-jar作为依赖项)
<dependency>
<groupId>com.example.jarfile</groupID>
<artifactId>example-jar</artifactId>
<version>${branch.name}-SNAPSHOT</version>
</dependency>我可以使用指定的"branch.name“来部署jar文件没有problem....My问题,我如何使版本快照足够通用而又不会在Git中引起合并冲突?
例如,如果我将<version>硬编码为master-SNAPSHOT或Alpha-SNAPSHOT,则在合并分支时会导致冲突。
有什么想法吗?
提前感谢!
发布于 2016-12-01 07:43:32
尝试包含以下插件
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>然后,您可以对branchName使用${scmBranch}
http://www.mojohaus.org/buildnumber-maven-plugin/usage.html
<dependency>
<groupId>com.example.jarfile</groupID>
<artifactId>example-jar</artifactId>
<version>${scmBranch}-SNAPSHOT</version>
</dependency>https://stackoverflow.com/questions/39841067
复制相似问题