Giter VIP home page Giter VIP logo

jgitflow-gradle-plugin's Introduction

JGitflow Gradle Plugin

Build Status Coverage Status download Apache License 2 Twitter Join%20Chat

Overview

This is a Gradle Plugin which adds tasks to Gradle to support the Gitflow Workflow. The Gitflow Workflow provides a robust framework for managing larger projects. The Plugin uses org.eclipse.jgit and external.atlassian.jgitflow:jgit-flow-core to implement the Gitflow Workflow. The project is inspired by the JGitFlow Maven Plugin.
The Plugin adds the task group jgitflow which contains the following tasks:

  • initJGitflow: Initializes the JGitflow context. Creates a develop branch and switches to develop branch.

  • releaseStart: Creates a release branch release/<releaseVersion> from a develop branch and updates the gradle.properties file with a release version. Switches to release branch.

  • releaseFinish: Merges a release branch back into the master branch and develop branch. Tags the release. Removes the release branch. Pushes everything to the remote origin. Switches back to develop branch.

  • releasePublish: Publishes a release branch to the remote origin.

  • featureStart: Creates a feature branch feature/<featureName> from a develop branch. Switches to feature branch.

  • featureFinish: Merges a feature branch back into the develop branch. Removes the feature branch. Switches back to develop branch.

  • featurePublish: Publishes a feature branch to the remote origin.

  • hotfixStart: Creates a hotfix branch hotfix/<hotfixName> from a master branch. Switches to hotfix branch.

  • hotfixFinish: Merges a hotfix branch back into the master branch and develop branch. Additionally the master merge is tagged with the hotfix version. Switches back to develop branch.

  • hotfixPublish: Publishes a hotfix branch to the remote origin.

The project requires at least JDK 7.

Usage Guide

Add the following snippet to your Gradle build file:

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'io.github.robwin:jgitflow-gradle-plugin:0.6.0'
    }
}

apply plugin: 'io.github.robwin.jgitflow'

JGitflow context configuration

The default jgitflow context configuration looks as follows:

Table 1. Branch names
Logical branch name Real branch name

master

"master"

develop

"develop"

feature

"feature/<featureName>"

release

"release/<releaseVersion>"

hotfix

"hotfix/<hotfixName>";

By default a release tag has no version prefix.

Initializes the JGitflow context

Before you can use the tasks, you must initialize the JGitflow context.

gradlew initJGitflow

If you want to change the JGitflow context configuration, you can do the following.

initJGitflow{
    feature = "features/"
    release = "releases/"
    versiontag = 'v'
}

Git authentication

If you want to push changes to a remote origin, you must specify your username and password in a ~/.gradle/gradle.properties file or as a command line parameter.
SSH is not supported yet.

Example

gitUsername=<username>
gitPassword=<password>

or

-PgitUsername=<username> -PgitPassword=<password>

Release Start Task

The task exposes a few properties as part of its configuration.

Table 2. Properties of releaseStart
Mandatory Property Description Type Default

No

releaseVersion

The version of the release. If not set, version will be taken from gradle.properties ('version' property with stripped SNAPSHOT postfix)

String

empty

No

allowSnapshotDependencies

Allow snapshot library dependencies

Boolean

false

No

baseCommit

You can optionally supply a base commit sha-1 hash to start the release from. The commit must be on the develop branch.

String

empty

No

scmMessagePrefix

You can optionally supply a SCM Prefix.

String

empty

No

scmMessageSuffix

You can optionally supply a SCM Suffix.

String

empty

Example

The tasks should be invoked via a command line.

gradlew releaseStart
gradlew releaseStart -PreleaseVersion=1.0.0

Release Finish Task

Table 3. Properties of releaseFinish
Mandatory Property Description Type Default

No

releaseVersion

The version of the release. If not set, version will be taken from gradle.properties ('version' property with stripped SNAPSHOT postfix)

String

empty

No

newVersion

The new version of the develop branch. If not set then releaseVersion with incremented version and SNAPSHOT postfix (http://semver.org/)

String

empty

No

newVersionIncrement

Controls which part of the version gets incremented when newVersion is set. Can be one of PATCH, MINOR or MAJOR.

String

PATCH

Yes

pushRelease

A flag indicating whether or not the finished release should be pushed to remote

boolean

true

No

scmMessagePrefix

You can optionally supply a SCM Prefix.

String

empty

No

scmMessageSuffix

You can optionally supply a SCM Suffix.

String

empty

Example

The tasks should be invoked via a command line.

gradlew releaseFinish
gradlew releaseFinish -PnewVersionIncrement=PATCH
gradlew releaseFinish -PreleaseVersion=1.0.0
gradlew releaseFinish -PreleaseVersion=1.0.0 -PnewVersion=1.0.1-SNAPSHOT
gradlew releaseFinish -PreleaseVersion=1.0.0 -PnewVersion=1.0.1-SNAPSHOT -PpushRelease=true
gradlew releaseFinish -PreleaseVersion=1.0.0 -PnewVersion=1.0.1-SNAPSHOT -PpushRelease=false

Feature Start Task

The task exposes a few properties as part of its configuration.

Table 4. Properties of featureStart
Mandatory Property Description Type Default

Yes

featureName

The name of the feature

String

empty

No

scmMessagePrefix

You can optionally supply a SCM Prefix.

String

empty

No

scmMessageSuffix

You can optionally supply a SCM Suffix.

String

empty

Example

The tasks should be invoked via a command line.

gradlew featureStart -PfeatureName="NewFeature"

Feature Finish Task

Table 5. Properties of featureFinish
Mandatory Property Description Type Default

Yes

featureName

The name of the feature

String

empty

No

scmMessagePrefix

You can optionally supply a SCM Prefix.

String

empty

No

scmMessageSuffix

You can optionally supply a SCM Suffix.

String

empty

Example

The tasks should be invoked via a command line.

gradlew featureFinish -PfeatureName="NewFeature"

Hotfix Start Task

The task exposes a few properties as part of its configuration.

Table 6. Properties of hotfixStart
Mandatory Property Description Type Default

Yes

hotfixName

The name of the hotfix

String

empty

No

baseCommit

You can optionally supply a base commit sha-1 hash to start the hotfix from. The commit must be on the master branch.

String

empty

No

scmMessagePrefix

You can optionally supply a SCM Prefix.

String

empty

No

scmMessageSuffix

You can optionally supply a SCM Suffix.

String

empty

Example

The tasks should be invoked via a command line.

gradlew hotfixStart -PhotfixName="HotfixXYZ"

Hotfix Finish Task

Table 7. Properties of hotfixFinish
Mandatory Property Description Type Default

Yes

hotfixName

The name of the hotfix

String

empty

No

scmMessagePrefix

You can optionally supply a SCM Prefix.

String

empty

No

scmMessageSuffix

You can optionally supply a SCM Suffix.

String

empty

Example

The tasks should be invoked via a command line.

gradlew hotfixFinish -PhotfixName="HotfixXYZ"

License

Copyright 2016 Robert Winkler

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

jgitflow-gradle-plugin's People

Contributors

jgaribaldi avatar mrollo avatar oteichmann avatar pgeyman avatar ptaylor avatar robwin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jgitflow-gradle-plugin's Issues

LocalBranchMissingException: local branch feature/Test does not exist

When doing gradle featurePublish -PfeatureName="Test" I am getting this exception
Caused by: com.atlassian.jgitflow.core.exception.LocalBranchMissingException: local branch feature/Test does not exist
at com.atlassian.jgitflow.core.util.RequirementHelper.requireLocalBranchExists(RequirementHelper.java:114)
at com.atlassian.jgitflow.core.command.FeaturePublishCommand.call(FeaturePublishCommand.java:84)

Though I can see in my ref::
impl (feature/Test)
$ git show-ref
0a5d5b06077b50a53fd1e0187869866c2fb9dbcc refs/heads/Feature/Test

Also my plugin is applied at the root of the project.

Cannot run init

Running 'initJGitflow' gives me:

Git 2.7.4
Gitflow 1.9.1 (AVH Edition)
Gradle 3.4.1

Adding:

   dependencies {
        ...
        classpath 'gradle.plugin.com.gladed.gradle.androidgitversion:gradle-android-git-version:0.3.3'
    }

Seems to be the problem

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:initJGitflow'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)
        at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
        at org.gradle.initialization.DefaultGradleLauncher$RunTasksAction.execute(DefaultGradleLauncher.java:256)
        at org.gradle.initialization.DefaultGradleLauncher$RunTasksAction.execute(DefaultGradleLauncher.java:253)
        at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:175)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)
        at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:49)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:31)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
Caused by: java.lang.NoSuchMethodError: org.eclipse.jgit.revwalk.RevWalk.release()V
        at com.atlassian.jgitflow.core.JGitFlowInitCommand.call(JGitFlowInitCommand.java:301)
        at com.atlassian.jgitflow.core.JGitFlow.forceInit(JGitFlow.java:171)
        at com.atlassian.jgitflow.core.JGitFlow$forceInit.call(Unknown Source)
        at io.github.robwin.jgitflow.tasks.InitJGitflowTask.init(InitJGitflowTask.groovy:66)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.doExecute(DefaultTaskClassInfoStore.java:141)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:632)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:615)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)
        ... 70 more

hotfixFinish

hotfixFinish only merges the changes to develop and master in my local and doesn't push it to remote.

newVersionIncrement feature is not working

When i create a release like this

gradlew initJGitflow  -PgitUsername=$GIT_USERNAME -PgitPassword=$GIT_TOKEN 
gradlew releaseStart  -PgitUsername=$GIT_USERNAME -PgitPassword=$GIT_TOKEN --no-daemon --info
gradlew releaseFinish -PgitUsername=$GIT_USERNAME -PgitPassword=$GIT_TOKEN -PnewVersionIncrement=MINOR -PpushRelease=false --no-daemon --info

newVersionIncrement=MINOR is ignored and the increment is created using PATCH

running this version:

wrapper {
    gradleVersion = '5.6.1'
    distributionType = 'ALL'
}

SCM Prefix / Suffix

JGitFlow allows for configuration of a prefix or suffix in a commit message. My team is adding some commit hooks that enforce an issue # at the beginning of our commit messages as a way to easily track the commit back to an issue.

However, the commit hooks will fail with JGitFlow's standard commit messages. Would you be OK if I submitted a PR to allow for scmCommitPrefix and scmCommitSuffix properties to be passed to jgitflow commands at run time?

Still active?

Hello,

Is this repo still active? do you accept PRs?

TransportException when run releaseFinish

I am trying to leverage this plugin for Gitflow/gradle to support our SpringBoot applications releases, unfortunately I am keep getting error "401 Authorization Required" when I run releaseFinish.
I do have correct gitUsername and gitPassword configured in ~/.gradle/gradle.properties file.
===Error Message==============
Caused by: org.eclipse.jgit.api.errors.TransportException: https://<mygithub.host.name/path/project>.git: 401 Authorization Required
at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:160)
at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:79)

Is this a known issue, or there is something I missed? Is there any extra configuration required for JGit component from eclipse?

Thanks a lot if you can help.

Not be able to run any task

I get this error when I try to run any task

:releaseStart FAILED

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':releaseStart'.
> org.eclipse.jgit.revwalk.RevWalk.release()V

Version handling on releaseFinish

When performing releaseFinish the -SNAPSHOT postfix is not striped from version property in gradle.properties before merging the release branch to master. The tag is named correctly but on master we still have the -SNAPSHOT postfix in gradle.properties. On develop the version increment is performed correctly.
I also tried to remove the -SNAPSHOT postfix on the release branch before running releaseFinish. This resulted in following error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':releaseFinish'.
> didn't replace anything

Fails in multi-module projects

If I attempt to use this plugin in multiple module projects (featureStart, releaseStart, etc.) it fails because it tells git to create the new feature/release branch for as many modules as there are in the project. Git then errors out when trying to create a branch that already exists:

$ ./gradlew featureStart -PfeatureName=test-feature
Incremental java compilation is an incubating feature.
:libraryone:featureStart
:librarytwo:featureStart FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':librarytwo:featureStart'.
> com.atlassian.jgitflow.core.exception.LocalBranchExistsException: local branch 'feature/test-feature' already exists

Misleading error if version is not correctly formatted in gradle.properties

If I have spaces in the version property I get the following errror

version.properties:
version = 1.0.0-SNAPSHOT

./gradlew releaseStart

...
16:15:59.532 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'Execute start for :releaseStart' started
16:15:59.575 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] parsing buildfile jar:file:/Users/ptaylor/.gradle/wrapper/dists/gradle-4.5-bin/bgd6nrwgxy3inh8yed6gmsvbx/gradle-4.5/lib/ant-1.9.9.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/Users/ptaylor/.gradle/wrapper/dists/gradle-4.5-bin/bgd6nrwgxy3inh8yed6gmsvbx/gradle-4.5/lib/ant-1.9.9.jar!/org/apache/tools/ant/antlib.xml from a zip file
16:15:59.577 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:replace] Replacing in /Users/ptaylor/work/gradle-gitflow/test-project/gradle.properties: version=1.5.0-SNAPSHOT --> version=1.5.0
16:15:59.578 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Completing Build operation 'Execute start for :releaseStart'
16:15:59.578 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context.
16:15:59.578 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':releaseStart'
16:15:59.578 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] :releaseStart FAILED
16:15:59.578 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Completing Build operation 'Task :releaseStart'
16:15:59.578 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Build operation 'Task :releaseStart' completed
16:15:59.578 [INFO] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] :releaseStart (Thread[Task worker for ':',5,main]) completed. Took 0.046 secs.
16:15:59.578 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.12 completed (1 worker(s) in use)
16:15:59.578 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Task worker for ':': released lock on root.1.12
16:15:59.578 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Task worker for ':': released lock on :
16:15:59.578 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskPlanExecutor] Task worker [Thread[Task worker for ':',5,main]] finished, busy: 0.046 secs, idle: 0.001 secs
16:15:59.578 [DEBUG] [org.gradle.internal.progress.DefaultBuildOperationExecutor] Completing Build operation 'Run tasks'
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':releaseStart'.
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > didn't replace anything
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.  Run with --scan to get full insights.
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] 
16:15:59.579 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 0s
'''

Jenkins gradle fail execute initJGitflow

Jenkins Job config looks like:
initJGItflow -PgitUsername=$gitUsername -PgitPassword=$gitPassword --stacktrace

Version of jgitflow-gradle-plugin: 0.5.0

Cannot find CatalogManager.properties
:initJGitflow FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':initJGitflow'.
> String index out of range: -6

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':initJGitflow'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)
	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:61)
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
	at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:45)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
	at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:233)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
	at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:74)
	at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:55)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)
	at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
	at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
	at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
	at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
	at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
	at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
	at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
	at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:197)
	at org.gradle.internal.Factories$1.create(Factories.java:25)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:194)
	at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:36)
	at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:118)
	at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:112)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
	at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:112)
	at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:98)
	at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:66)
	at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
	at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44)
	at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29)
	at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51)
	at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
	at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:244)
	at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:217)
	at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:33)
	at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
	at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:210)
	at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:174)
	at org.gradle.launcher.Main.doAction(Main.java:33)
	at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
	at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
	at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:31)
	at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:108)
	at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -6
	at com.atlassian.jgitflow.core.util.GitHelper.localBranchExists(GitHelper.java:193)
	at com.atlassian.jgitflow.core.JGitFlowInitCommand.call(JGitFlowInitCommand.java:159)
	at com.atlassian.jgitflow.core.JGitFlow.forceInit(JGitFlow.java:171)
	at com.atlassian.jgitflow.core.JGitFlow$forceInit.call(Unknown Source)
	at io.github.robwin.jgitflow.tasks.InitJGitflowTask.init(InitJGitflowTask.groovy:66)
	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
	at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.doExecute(DefaultTaskClassInfoStore.java:141)
	at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
	at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123)
	at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:624)
	at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:607)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)
	... 61 more


BUILD FAILED

Any help? Tips how to walkaround ?
Many Thanks

Plugin is not compatible with the latest Gradle version (2.7)

When running startRelease task with gradle 2.7 following exception is thrown:

Caused by: java.lang.NoClassDefFoundError: org/gradle/mvn3/org/apache/maven/artifact/ArtifactUtils
        at io.github.robwin.jgitflow.tasks.ReleaseStartTask.validateReleaseVersion(ReleaseStartTask.groovy:74)
        at io.github.robwin.jgitflow.tasks.ReleaseStartTask.start(ReleaseStartTask.groovy:39)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:226)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:585)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:568)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
        ... 68 more

When switching to gradle 2.4 everything works fine.

Please release/publish version 0.7

Hi Robert,
I believe that other user(s) already asked for it but would it be possible to release version 0.7 (with support for custom ssh private key file) ?
Thanks a lot in advance for your understanding and your time.
Best regards
Karl

Each task always starting at rootProject of current project

Doesn't really look like a bug, but in each of the Task classes, when the class calls the get() or forceInit() methods in JGitFlow, it always passes in the projectDir as project.rootProject.projectDir.

This doesn't work very well in multi-project builds.

If I have a structure like this:
RootProject
----.git
-----Sub-Project 1
----------.git
-----Sub-Project 2
----------.git

Whenever I use the plugin, it will only operate git commands for RootProject. In my case, each sub-project has its own git repository. RootProject here is really just to store a common build.gradle and because we deal with a bunch of legacy code with a bunch of dependencies between the subprojects.

So bottom line: I'd like to change this to use project.projectDir. Those same methods always take the directory passed in and search upwards until it finds the .git directory anyway, so the result for single project builds should be the same, as well as multi-project builds where it is all on one repository.

If you'd like this change, I already changed the code and could submit a pull request. I just need to test my assumption above about having no impact.

No option to disable pushing commits in releaseFinish task

The maven jgitflow plugin has the option to disable pushing commits when a release is finished. This is useful when running the task in a CI system such as Jenkins where we cannot expose the credentials needed to do the push.

If I were to submit a Pull Request that added the feature to disable pushing commits at the end of a releaseFinish task, would you be open to this? I'd make sure this maintained backwards compatibility; if "pushRelease" is not specified by the user, the plugin would push the commits by default.

FinishRelease pushes all branches

When running finishRelease with pushRelease=true, all branches are pushed (including old ones, with no modifications).

When using Jenkins configured to trigger builds on branch modifications, a build for each branch will be triggered after a finishRelease tasks, which is useless.

Instead of pushing everything to the remote, should not the finishRelease task only push develop, master and the deleted ones ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.