Skip to content

Instantly share code, notes, and snippets.

@andreevmipt
Created March 4, 2019 09:19
Show Gist options
  • Save andreevmipt/d7e9fdc2e482505d74358800b8465ff1 to your computer and use it in GitHub Desktop.
Save andreevmipt/d7e9fdc2e482505d74358800b8465ff1 to your computer and use it in GitHub Desktop.
<build>
<plugins>
<plugin>
<groupId>external.atlassian.jgitflow</groupId>
<artifactId>jgitflow-maven-plugin</artifactId>
<version>1.0-m5.1</version>
<configuration>
<flowInitContext>
<masterBranchName>master</masterBranchName>
<developBranchName>develop</developBranchName>
<featureBranchPrefix>feature/${project.artifactId}-</featureBranchPrefix>
<releaseBranchPrefix>release/${project.artifactId}-</releaseBranchPrefix>
<hotfixBranchPrefix>hotfix/${project.artifactId}-</hotfixBranchPrefix>
<versionTagPrefix>${project.artifactId}-</versionTagPrefix>
</flowInitContext>
<noDeploy>true</noDeploy>
<username>${git.user}</username>
<password>${git.password}</password>
</configuration>
</plugin>
</plugins>
</build>
Создание новой фичи
mvn -Dgit.user=<GIT username> -Dgit.password=<GIT password> jgitflow:feature-start
Рекомендация
Выполнить merge из рабочей ветки в ветку фичи, чтобы было проще разгребать конфликты и проверять, что фича не поломала тесты
mvn -Dgit.user=<GIT username> -Dgit.password=<GIT password> jgitflow:feature-finish
Создание хотфикса
На последнюю релизную версию
mvn -Dgit.user=<GIT username> -Dgit.password=<GIT password> jgitflow:hotfix-start
Выполнить merge из develop ветки в ветку фичи, чтобы было проще разгребать конфликты и проверять, что фича не поломала тесты
mvn -Dgit.user=<GIT username> -Dgit.password=<GIT password> jgitflow:hotfix-finish
На одну из старых версий
git show-ref --tags
mvn -Dgit.user=<GIT username> -Dgit.password=<GIT password> -startCommit=<id метки или имя бранча> jgitflow:hotfix-start
mvn -Dgit.user=<GIT username> -Dgit.password=<GIT password> jgitflow:hotfix-finish
Создание релизов
mvn -Dgit.user=<GIT username> -Dgit.password=<GIT password> jgitflow:release-start
mvn -Dgit.user=<GIT username> -Dgit.password=<GIT password> jgitflow:release-finish
Чтобы в процессе завершания релиза maven не предпринимал попыток создать Javadoc, необходимо добавить параметр:
-Dmaven.javadoc.skip=true
git push origin develop
git push origin master
git push origin --tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment