GithubHelp home page GithubHelp logo

unleash-scm-provider-git's People

Contributors

shillner avatar

Watchers

 avatar  avatar  avatar  avatar

unleash-scm-provider-git's Issues

Algorithm negotiation fail with github using ssh

I get a failure when doing a release.
I suspect this is due to jgit using an older Jsch that is not up to date with https://githubengineering.com/crypto-removal-notice/

Bumping jgit could fix this issue. Currently 4.3.0.201604071810-r is used.
Latest at the time of this writing is v5.0.2.201807311906-r
https://search.maven.org/artifact/org.eclipse.jgit/org.eclipse.jgit/5.0.2.201807311906-r/jar

Caused by: com.jcraft.jsch.JSchException: Algorithm negotiation fail at com.jcraft.jsch.Session.receive_kexinit (Session.java:559) at com.jcraft.jsch.Session.connect (Session.java:299) at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession (JschConfigSessionFactory.java:116) at org.eclipse.jgit.transport.SshTransport.getSession (SshTransport.java:136) at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init> (TransportGitSsh.java:264) at org.eclipse.jgit.transport.TransportGitSsh.openFetch (TransportGitSsh.java:162) at org.eclipse.jgit.api.LsRemoteCommand.execute (LsRemoteCommand.java:198) at org.eclipse.jgit.api.LsRemoteCommand.call (LsRemoteCommand.java:159) at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.hasTag (ScmProviderGit.java:634)

Here is a fix in bazel
https://bazel-review.googlesource.com/c/bazel/+/43610

and another one pointing in this direction
https://groups.google.com/forum/#!topic/repo-discuss/AMVDwTIeDJw/discussion

Edit: I tried bumping jgit to 4.10.x but I get the following error when releasing:

Caused by: java.lang.NoClassDefFoundError: com/jcraft/jsch/ConfigRepository at java.lang.Class.getDeclaredConstructors0 (Native Method) at java.lang.Class.privateGetDeclaredConstructors (Class.java:2671) at java.lang.Class.getDeclaredConstructors (Class.java:2020) at org.jboss.weld.annotated.slim.backed.SecurityActions.getDeclaredConstructors (SecurityActions.java:57)

remote branch determination without branch section in git-config

The problem with Jenkins is that it checks out in detached head state if you don't configure the additional behavior checkout specific local branch.
In this case it is currently not possible to determine the remote branch name and thus uploads or updates will fail (currently with a NullPointerException).

Is it possible to determine the remote branch name without this config entry?

If not the provider really shouldn't fail with an NPE but with an appropriate error message stating that the repo is in detached head, ...

Support for SSH agents

The API may pass an private key passphrase for public key authentication but that requires the user to configure or type this passphrase every time. SSH agents are usually employed to make password typing obsolete.

The provider implementation should also support the usage of agents but it is not yet clear whether this sould be a provider-specific implementation or if this can be realized as a feature of the caller of the API, providing a callback then.

setDevVersionTycho: push to Bitbucket failing due to REJECTED_NONFASTFORWARD

Seems like performTycho default workflow tried to do something that Bitbucket did not like. I'm trying to run a simple release on a local branch that is pushed to my remote. It fails with the stack trace below when executing setDevVersionTycho step. I couldn't find out what exactly causes it to be non-fastforward exactly - any help in tracking down what went wrong would be much appreciated!

I also tried modifying the workflow to run checkForScmChanges before setDevVersionTycho, hoping that maybe the conflicting commits would get fetched, but that did not help.

[INFO] 15:05:49,003  Git - Update finished successfully. New revision is: 6b00c76e1159c71594e51cd98fd023201dcbd112
[ERROR] An exception was caught while processing the workflow step with id 'setDevVersionTycho'.
com.itemis.maven.plugins.unleash.scm.ScmException: Could not push local changes to the remote repository due to the following error: [REJECTED_NONFASTFORWARD] 
    at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.push (ScmProviderGit.java:403)
    at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.commit (ScmProviderGit.java:336)
    at com.itemis.maven.plugins.unleash.util.DevVersionUtil.commitChanges (DevVersionUtil.java:108)
    at com.itemis.maven.plugins.unleash.steps.actions.tycho.SetDevVersionsTycho.execute (SetDevVersionsTycho.java:69)
    at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.executeSequentialWorkflowStep (WorkflowExecutor.java:157)
    at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.execute (WorkflowExecutor.java:119)
    at com.itemis.maven.plugins.cdi.AbstractCDIMojo.execute (AbstractCDIMojo.java:209)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
[INFO] Rolling back after execution errors - please find the error messages and stack traces above.
[INFO] 15:05:53,151  Rollback of all version changes necessary for the next development cycle (POMs, MANIFESTs, ...).
[ERROR] An exception was caught while rolling back the workflow step with id 'setDevVersionTycho'. Proceeding with the rollback of the next steps.
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.rollback (WorkflowExecutor.java:259)
    at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.rollback (WorkflowExecutor.java:238)
    at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.executeSequentialWorkflowStep (WorkflowExecutor.java:161)
    at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.execute (WorkflowExecutor.java:119)
    at com.itemis.maven.plugins.cdi.AbstractCDIMojo.execute (AbstractCDIMojo.java:209)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: java.lang.IllegalStateException: No from revision set (start revision of the reversion)!
    at com.google.common.base.Preconditions.checkState (Preconditions.java:459)
    at com.itemis.maven.plugins.unleash.scm.requests.RevertCommitsRequest$Builder.build (RevertCommitsRequest.java:187)
    at com.itemis.maven.plugins.unleash.steps.actions.tycho.SetDevVersionsTycho.rollback (SetDevVersionsTycho.java:91)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.rollback (WorkflowExecutor.java:259)
    at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.rollback (WorkflowExecutor.java:238)
    at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.executeSequentialWorkflowStep (WorkflowExecutor.java:161)
    at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.execute (WorkflowExecutor.java:119)
    at com.itemis.maven.plugins.cdi.AbstractCDIMojo.execute (AbstractCDIMojo.java:209)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
    at org.codehaus.classworlds.Launcher.main (Launcher.java:47)

[ERROR] An exception was caught while processing the workflow step with id 'tagScm'.

when Irun command
mvn unleash:perform -Dunleash.scmUsernameEnvVar=BeckerFrank -Dunleash.scmPasswordEnvVar=XXX

I get the following error:

[DEBUG] 05:10:40,221 Git - Commit info: - WORKING_DIR: /Users/frank/Eclipse/Installations/TestVersion-2019-03/git/test-unleash - MERGE_STRATEGY: DO_NOT_MERGE - PUSH: false - COMMIT_ALL_CHANGES: true [INFO] 05:10:40,257 Git - Commit finished successfully. New revision is: 408d52dc521cec2c839b04853066f17c378c18bd [ERROR] An exception was caught while processing the workflow step with id 'tagScm'. com.itemis.maven.plugins.unleash.scm.ScmException: Unable to push locally created tag '1.0.1' to remote 'origin[https://github.com/BeckerFrank/test-unleash.git]+'. at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.tag (ScmProviderGit.java:590) at com.itemis.maven.plugins.unleash.steps.actions.TagScm.execute (TagScm.java:122) at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.executeSequentialWorkflowStep (WorkflowExecutor.java:157) at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.execute (WorkflowExecutor.java:119) at com.itemis.maven.plugins.cdi.AbstractCDIMojo.execute (AbstractCDIMojo.java:209) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: org.eclipse.jgit.api.errors.TransportException: https://github.com/BeckerFrank/test-unleash.git: Authentication is required but no CredentialsProvider has been registered at org.eclipse.jgit.api.PushCommand.call (PushCommand.java:180) at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.tag (ScmProviderGit.java:587) at com.itemis.maven.plugins.unleash.steps.actions.TagScm.execute (TagScm.java:122) at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.executeSequentialWorkflowStep (WorkflowExecutor.java:157) at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.execute (WorkflowExecutor.java:119) at com.itemis.maven.plugins.cdi.AbstractCDIMojo.execute (AbstractCDIMojo.java:209) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: org.eclipse.jgit.errors.TransportException: https://github.com/BeckerFrank/test-unleash.git: Authentication is required but no CredentialsProvider has been registered at org.eclipse.jgit.transport.TransportHttp.connect (TransportHttp.java:537) at org.eclipse.jgit.transport.TransportHttp.openPush (TransportHttp.java:439) at org.eclipse.jgit.transport.PushProcess.execute (PushProcess.java:160) at org.eclipse.jgit.transport.Transport.push (Transport.java:1346) at org.eclipse.jgit.api.PushCommand.call (PushCommand.java:170) at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.tag (ScmProviderGit.java:587) at com.itemis.maven.plugins.unleash.steps.actions.TagScm.execute (TagScm.java:122) at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.executeSequentialWorkflowStep (WorkflowExecutor.java:157) at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.execute (WorkflowExecutor.java:119) at com.itemis.maven.plugins.cdi.AbstractCDIMojo.execute (AbstractCDIMojo.java:209) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

What do I miss or is this a bug?

Git - Committing local changes extremely slow after tag

We have a repo with lots of big files, suspect this is the reason. Committing as part of the tag process takes 2 minutes in this repo (which in turn cause the release process to be as slow as using Maven release plugin which has other problems but not these).

After some debugging I found that the problem disappears when applying this patch:

diff --git a/src/main/java/com/itemis/maven/plugins/unleash/scm/providers/ScmProviderGit.java b/src/main/java/com/itemis/maven/plugins/unleash/scm/providers/ScmProviderGit.java
index 476c942..f7bb103 100644
--- a/src/main/java/com/itemis/maven/plugins/unleash/scm/providers/ScmProviderGit.java
+++ b/src/main/java/com/itemis/maven/plugins/unleash/scm/providers/ScmProviderGit.java
@@ -314,13 +314,13 @@ public class ScmProviderGit implements ScmProvider {

     // commit all added changes
     CommitCommand commit = this.git.commit().setMessage(request.getMessage()).setCommitter(this.personIdent);
-    if (request.commitAllChanges()) {
-      commit.setAll(true);
-    } else {
-      for (String path : request.getPathsToCommit()) {
-        commit.setOnly(path);
-      }
-    }
+    // if (request.commitAllChanges()) {
+    //   commit.setAll(true);
+    // } else {
+    //   for (String path : request.getPathsToCommit()) {
+    //     commit.setOnly(path);
+    //   }
+    // }

I suppose there is an underlying problem in JGit (for us the problem is related to commit.setAll(true)), either way, I'm not sure of the purpose of this code, it seems redundant on the lines just before it doing the equivallent of git add. Can I send a PR to remove it or have I misunderstood something?

checking out a detached head causes errors

As reported in the unleash-maven-plugin (issue 47)

releases are failing in jenkins and i believe the cause is related to jenkins checking things out in a detached state. i currently set the option to check out to a specific local branch (this is also required by the maven-release-plugin to work properly) but the plugin does not seem to notice this.

from the logs:

[DEBUG] 14:00:01,078 Git - Push info:

  • WORKING_DIR: /var/lib/jenkins/jobs/hello-world-jenkins/workspace
  • LOCAL_BRANCH: master
  • REMOTE_BRANCH: null
  • REMOTE: origin
  • REMOTE_URL: [email protected]:condevops/hello-world-jenkins.git
  • MERGE_STRATEGY: FULL_MERGE

this can be reproduced locally be executing the same steps jenkins does on a check out.

i am currently digging into this and will hopefully have a fix soon but there will be no complaints from me if you beat me to it.

NullPointerException while updating the local repository

Orginal Bug report (unleash-maven-plugin#77):

I have a null pointer exception with the unleash:perform goal. My build works fine but the unleash:perform goal goes on error while updating the new version number and commiting the changes.


INFO] 16:43:04,786  Removing artifact-spy-plugin from build configuration.
[INFO] 16:43:04,824  Checking remote SCM repository for changes. Initial revision was a469fdfdfdccbca6d0c34b2a041377dba57ad227
[DEBUG] 16:43:04,824  	No commit before tagging requested. Checking for SCM changes at this point unnessecary!
[INFO] 16:43:04,824  Tagging local and remote SCM repositories.
[DEBUG] 16:43:04,824  	Updating SCM connection tags in POM of module 'com.i.t:tok:3.2.0'
[DEBUG] 16:43:04,829  	Updating SCM connection tags in POM of module 'com.i.t:tok-security:3.2.0'
[DEBUG] 16:43:04,832  	Updating SCM connection tags in POM of module 'com.i.t:tok-data-jpa:3.2.0'
[DEBUG] 16:43:04,835  	Updating SCM connection tags in POM of module 'com.i.t:tok-common:3.2.0'
[DEBUG] 16:43:04,836  	Updating SCM connection tags in POM of module 'com.i.t:tok-test:3.2.0'
[DEBUG] 16:43:04,840  	Updating SCM connection tags in POM of module 'com.i.t:tok-application:3.2.0'
[DEBUG] 16:43:04,844  	Updating SCM connection tags in POM of module 'com.i.t:tok-sandbox:3.2.0'
[DEBUG] 16:43:04,846  	Updating SCM connection tags in POM of module 'com.i.t:tok-batch:3.2.0'
[DEBUG] 16:43:04,850  	Updating SCM connection tags in POM of module 'com.i.t:tok-client:3.2.0'
[INFO] 16:43:04,853  Git - Searching for Git tag 'release-3.2.0'
[DEBUG] 16:43:04,861  Git - Query info:
	- TAG_NAME: release-3.2.0
	- WORKING_DIR: /var/lib/jenkins/workspace/release_test
	- REMOTE: origin
	- REMOTE_URL: https://gitlab.sys.lab.ico.com/arc/tok.git
[DEBUG] 16:43:05,545  	Creating SCM tag with name 'release-3.2.0'. Tag will be created from local working copy.
[INFO] 16:43:05,546  Git - Tagging local repository with 'release-3.2.0'
[DEBUG] 16:43:05,546  Git - Tag info:
	- WORKING_DIR: /var/lib/jenkins/workspace/release_test
	- TAG_NAME: release-3.2.0
	- USE_WORKING_COPY: true
	- COMMIT_BEFORE_TAGGING: false
	- MERGE_STRATEGY: DO_NOT_MERGE
[INFO] 16:43:05,548  Git - Committing local changes.
[DEBUG] 16:43:05,746  Git - Commit info:
	- WORKING_DIR: /var/lib/jenkins/workspace/release_test
	- MERGE_STRATEGY: DO_NOT_MERGE
	- PUSH: false
	- COMMIT_ALL_CHANGES: true
[INFO] 16:43:06,430  Git - Commit finished successfully. New revision is: d963849080fbf9f462556b98b3be20ad55bfc463
[INFO] 16:43:08,704  Git - Tag creation finished successfully. New revision is: 
[INFO] 16:43:08,704  Detecting all release artifacts that have been produced during the release build for later installation and deployment.
[DEBUG] 16:43:08,704  	Loading artifact-spy output of module 'com.i.t:tok:3.2.0' from /var/lib/jenkins/workspace/release_test/target/artifact-spy/artifacts.properties
[DEBUG] 16:43:08,710  		The following artifact will be installed and deployed later: com.i.t:tok:pom:3.2.0
[DEBUG] 16:43:08,710  	Loading artifact-spy output of module 'com.i.t:tok-security:3.2.0' from /var/lib/jenkins/workspace/release_test/tok-security/target/artifact-spy/artifacts.properties
[DEBUG] 16:43:08,711  		The following artifact will be installed and deployed later: com.i.t:tok-security:pom:3.2.0
[DEBUG] 16:43:08,711  		The following artifact will be installed and deployed later: com.i.t:tok-security:jar:3.2.0
[DEBUG] 16:43:08,711  	Loading artifact-spy output of module 'com.i.t:tok-data-jpa:3.2.0' from /var/lib/jenkins/workspace/release_test/tok-data-jpa/target/artifact-spy/artifacts.properties
[DEBUG] 16:43:08,712  		The following artifact will be installed and deployed later: com.i.t:tok-data-jpa:pom:3.2.0
[DEBUG] 16:43:08,712  		The following artifact will be installed and deployed later: com.i.t:tok-data-jpa:jar:3.2.0
[DEBUG] 16:43:08,712  	Loading artifact-spy output of module 'com.i.t:tok-common:3.2.0' from /var/lib/jenkins/workspace/release_test/tok-common/target/artifact-spy/artifacts.properties
[DEBUG] 16:43:08,712  		The following artifact will be installed and deployed later: com.i.t:tok-common:pom:3.2.0
[DEBUG] 16:43:08,713  		The following artifact will be installed and deployed later: com.i.t:tok-common:jar:3.2.0
[DEBUG] 16:43:08,713  	Loading artifact-spy output of module 'com.i.t:tok-test:3.2.0' from /var/lib/jenkins/workspace/release_test/tok-test/target/artifact-spy/artifacts.properties
[DEBUG] 16:43:08,713  		The following artifact will be installed and deployed later: com.i.t:tok-test:jar:3.2.0
[DEBUG] 16:43:08,713  		The following artifact will be installed and deployed later: com.i.t:tok-test:pom:3.2.0
[DEBUG] 16:43:08,713  	Loading artifact-spy output of module 'com.i.t:tok-application:3.2.0' from /var/lib/jenkins/workspace/release_test/tok-application/target/artifact-spy/artifacts.properties
[DEBUG] 16:43:08,714  		The following artifact will be installed and deployed later: com.i.t:tok-application:pom:3.2.0
[DEBUG] 16:43:08,714  		The following artifact will be installed and deployed later: com.i.t:tok-application:jar:3.2.0
[DEBUG] 16:43:08,714  	Loading artifact-spy output of module 'com.i.t:tok-sandbox:3.2.0' from /var/lib/jenkins/workspace/release_test/tok-sandbox/target/artifact-spy/artifacts.properties
[DEBUG] 16:43:08,714  		The following artifact will be installed and deployed later: com.i.t:tok-sandbox:pom:3.2.0
[DEBUG] 16:43:08,714  		The following artifact will be installed and deployed later: com.i.t:tok-sandbox:jar:3.2.0
[DEBUG] 16:43:08,714  	Loading artifact-spy output of module 'com.i.t:tok-batch:3.2.0' from /var/lib/jenkins/workspace/release_test/tok-batch/target/artifact-spy/artifacts.properties
[DEBUG] 16:43:08,714  		The following artifact will be installed and deployed later: com.i.t:tok-batch:jar:3.2.0
[DEBUG] 16:43:08,715  		The following artifact will be installed and deployed later: com.i.t:tok-batch:pom:3.2.0
[DEBUG] 16:43:08,715  	Loading artifact-spy output of module 'com.i.t:tok-client:3.2.0' from /var/lib/jenkins/workspace/release_test/tok-client/target/artifact-spy/artifacts.properties
[DEBUG] 16:43:08,715  		The following artifact will be installed and deployed later: com.i.t:tok-client:pom:3.2.0
[DEBUG] 16:43:08,715  		The following artifact will be installed and deployed later: com.i.t:tok-client:jar:3.2.0
[INFO] 16:43:08,716  Preparing project modules for next development cycle.
[DEBUG] 16:43:08,716  	Preparing module 'com.i.t:tok:3.2.0'.
[DEBUG] 16:43:08,718  		Update of module version 'com.i.t:com.i.t:tok:pom:3.2.0-SNAPSHOT' [3.2.0 => 3.3.0-SNAPSHOT] Version Upgrade Strategy: MINOR
[DEBUG] 16:43:08,718  		Reversion of SCM connection tags
[DEBUG] 16:43:08,720  	Preparing module 'com.i.t:tok-security:3.2.0'.
[DEBUG] 16:43:08,721  		Update of module version 'com.i.t:com.i.t:tok-security:jar:3.2.0-SNAPSHOT' [3.2.0 => 3.3.0-SNAPSHOT] Version Upgrade Strategy: MINOR
[DEBUG] 16:43:08,722  		Update of parent version of module 'com.i.t:com.i.t:tok-security:jar:3.2.0-SNAPSHOT' [3.2.0 => 3.3.0-SNAPSHOT]
[DEBUG] 16:43:08,722  		Reversion of SCM connection tags
[DEBUG] 16:43:08,722  	Preparing module 'com.i.t:tok-data-jpa:3.2.0'.
[DEBUG] 16:43:08,724  		Update of module version 'com.i.t:com.i.t:tok-data-jpa:jar:3.2.0-SNAPSHOT' [3.2.0 => 3.3.0-SNAPSHOT] Version Upgrade Strategy: MINOR
[DEBUG] 16:43:08,724  		Update of parent version of module 'com.i.t:com.i.t:tok-data-jpa:jar:3.2.0-SNAPSHOT' [3.2.0 => 3.3.0-SNAPSHOT]
[DEBUG] 16:43:08,724  		Reversion of SCM connection tags
[DEBUG] 16:43:08,725  	Preparing module 'com.i.t:tok-common:3.2.0'.
[DEBUG] 16:43:08,726  		Update of module version 'com.i.t:com.i.t:tok-common:jar:3.2.0-SNAPSHOT' [3.2.0 => 3.3.0-SNAPSHOT] Version Upgrade Strategy: MINOR
[DEBUG] 16:43:08,727  		Update of parent version of module 'com.i.t:com.i.t:tok-common:jar:3.2.0-SNAPSHOT' [3.2.0 => 3.3.0-SNAPSHOT]
[DEBUG] 16:43:08,727  		Reversion of SCM connection tags
[DEBUG] 16:43:08,728  	Preparing module 'com.i.t:tok-test:3.2.0'.
[DEBUG] 16:43:08,729  		Update of module version 'com.i.t:com.i.t:tok-test:jar:3.2.0-SNAPSHOT' [3.2.0 => 3.3.0-SNAPSHOT] Version Upgrade Strategy: MINOR
[DEBUG] 16:43:08,729  		Update of parent version of module 'com.i.t:com.i.t:tok-test:jar:3.2.0-SNAPSHOT' [3.2.0 => 3.3.0-SNAPSHOT]
[DEBUG] 16:43:08,729  		Reversion of SCM connection tags
[DEBUG] 16:43:08,730  	Preparing module 'com.i.t:tok-application:3.2.0'.
[DEBUG] 16:43:08,732  		Update of module version 'com.i.t:com.i.t:tok-application:jar:3.2.0-SNAPSHOT' [3.2.0 => 3.3.0-SNAPSHOT] Version Upgrade Strategy: MINOR
[DEBUG] 16:43:08,732  		Update of parent version of module 'com.i.t:com.i.t:tok-application:jar:3.2.0-SNAPSHOT' [3.2.0 => 3.3.0-SNAPSHOT]
[DEBUG] 16:43:08,732  		Reversion of SCM connection tags
[DEBUG] 16:43:08,734  	Preparing module 'com.i.t:tok-sandbox:3.2.0'.
[DEBUG] 16:43:08,736  		Update of module version 'com.i.t:com.i.t:tok-sandbox:jar:3.2.0-SNAPSHOT' [3.2.0 => 3.3.0-SNAPSHOT] Version Upgrade Strategy: MINOR
[DEBUG] 16:43:08,736  		Update of parent version of module 'com.i.t:com.i.t:tok-sandbox:jar:3.2.0-SNAPSHOT' [3.2.0 => 3.3.0-SNAPSHOT]
[DEBUG] 16:43:08,736  		Reversion of SCM connection tags
[DEBUG] 16:43:08,737  	Preparing module 'com.i.t:tok-batch:3.2.0'.
[DEBUG] 16:43:08,738  		Update of module version 'com.i.t:com.i.t:tok-batch:jar:3.2.0-SNAPSHOT' [3.2.0 => 3.3.0-SNAPSHOT] Version Upgrade Strategy: MINOR
[DEBUG] 16:43:08,738  		Update of parent version of module 'com.i.t:com.i.t:tok-batch:jar:3.2.0-SNAPSHOT' [3.2.0 => 3.3.0-SNAPSHOT]
[DEBUG] 16:43:08,738  		Reversion of SCM connection tags
[DEBUG] 16:43:08,740  	Preparing module 'com.i.t:tok-client:3.2.0'.
[DEBUG] 16:43:08,741  		Update of module version 'com.i.t:com.i.t:tok-client:jar:3.2.0-SNAPSHOT' [3.2.0 => 3.3.0-SNAPSHOT] Version Upgrade Strategy: MINOR
[DEBUG] 16:43:08,741  		Update of parent version of module 'com.i.t:com.i.t:tok-client:jar:3.2.0-SNAPSHOT' [3.2.0 => 3.3.0-SNAPSHOT]
[DEBUG] 16:43:08,741  		Reversion of SCM connection tags
[DEBUG] 16:43:08,742  	Committing changed POMs of all modules and pushing to remote repository. Merging with remote changes if necessary.
[INFO] 16:43:09,128  Git - Committing local changes.
[DEBUG] 16:43:09,135  Git - Commit info:
	- WORKING_DIR: /var/lib/jenkins/workspace/release_test
	- MERGE_STRATEGY: FULL_MERGE
	- PUSH: true
	- COMMIT_ALL_CHANGES: false
	- FILES: tok-application/pom.xml,tok-data-jpa/pom.xml,tok-security/pom.xml,tok-sandbox/pom.xml,tok-common/pom.xml,pom.xml,tok-test/pom.xml,tok-batch/pom.xml,tok-client/pom.xml
[INFO] 16:43:09,196  Git - Pushing local changes to remote repository.
[DEBUG] 16:43:09,196  Git - Push info:
	- WORKING_DIR: /var/lib/jenkins/workspace/release_test
	- LOCAL_BRANCH: a62f8c148ac5272c6678528debcec6fa63e67920
	- REMOTE_BRANCH: refs/heads/a62f8c148ac5272c6678528debcec6fa63e67920
	- REMOTE: origin
	- REMOTE_URL: https://gitlab.sys.lab.ico.com/arc/tok.git
	- MERGE_STRATEGY: FULL_MERGE

[INFO] 16:43:09,197  Git - Updating local repository with remote changes.
[DEBUG] 16:43:09,197  Git - Fetching remote updates.
[DEBUG] 16:43:09,198  Git - Fetch info:
	- WORKING_DIR: /var/lib/jenkins/workspace/release_test
	- REMOTE: origin
	- REMOTE_URL: https://gitlab.sys.lab.ico.com/arc/tok.git
[ERROR] An exception was caught while processing the workflow step with id 'setDevVersion'.
com.itemis.maven.plugins.unleash.scm.ScmException: No Git commit id found for String ''.
	at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.update(ScmProviderGit.java:473)
	at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.push(ScmProviderGit.java:373)
	at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.commit(ScmProviderGit.java:337)
	at com.itemis.maven.plugins.unleash.util.DevVersionUtil.commitChanges(DevVersionUtil.java:100)
	at com.itemis.maven.plugins.unleash.steps.actions.SetNextDevVersion.execute(SetNextDevVersion.java:87)
	at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.executeSequentialWorkflowStep(WorkflowExecutor.java:157)
	at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.execute(WorkflowExecutor.java:119)
	at com.itemis.maven.plugins.cdi.AbstractCDIMojo.execute(AbstractCDIMojo.java:209)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.java:129)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
	at jenkins.maven3.agent.Maven33Main.launch(Maven33Main.java:176)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
	at hudson.remoting.UserRequest.perform(UserRequest.java:153)
	at hudson.remoting.UserRequest.perform(UserRequest.java:50)
	at hudson.remoting.Request$2.run(Request.java:336)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
	at org.eclipse.jgit.api.MergeCommand.include(MergeCommand.java:512)
	at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.update(ScmProviderGit.java:471)
	... 40 more
[INFO] Rolling back after execution errors - please find the error messages and stack traces above.
[INFO] 16:43:10,054  Rollback of all pom changes necessary for setting of the development version as well as reverting any made SCM commits.
[INFO] 16:43:10,069  Rollback of SCM tag creation and POM modifications due to a processing exception.
[INFO] 16:43:10,070  Git - Searching for Git tag 'release-3.2.0'
[DEBUG] 16:43:10,071  Git - Query info:
	- TAG_NAME: release-3.2.0
	- WORKING_DIR: /var/lib/jenkins/workspace/release_test
	- REMOTE: origin
	- REMOTE_URL: https://gitlab.sys.lab.ico.com/arc/tok.git
[DEBUG] 16:43:10,554  	Deleting scm tag 'release-3.2.0' since the release build failed.
[INFO] 16:43:10,554  Git - Deleting Git tag
[INFO] 16:43:10,556  Git - Searching for Git tag 'release-3.2.0'
[DEBUG] 16:43:10,557  Git - Query info:
	- TAG_NAME: release-3.2.0
	- WORKING_DIR: /var/lib/jenkins/workspace/release_test
	- REMOTE: origin
	- REMOTE_URL: https://gitlab.sys.lab.ico.com/arc/tok.git
[DEBUG] 16:43:10,881  Git - Tag info:
	- TAG_NAME: release-3.2.0
	- REMOTE: origin
	- REMOTE_URL: https://gitlab.sys.lab.ico.com/arc/tok.git
[INFO] 16:43:13,072  Rollback of artifact-spy-plugin addition to the build configuration.
[INFO] 16:43:13,077  Rollback of release version updating for all project modules
[DEBUG] 16:43:13,077  	Rolling back modifications on POM of module 'com.i.t:tok:3.3.0-SNAPSHOT'
[DEBUG] 16:43:13,078  	Rolling back modifications on POM of module 'com.i.t:tok-security:3.3.0-SNAPSHOT'
[DEBUG] 16:43:13,079  	Rolling back modifications on POM of module 'com.i.t:tok-data-jpa:3.3.0-SNAPSHOT'
[DEBUG] 16:43:13,079  	Rolling back modifications on POM of module 'com.i.t:tok-common:3.3.0-SNAPSHOT'
[DEBUG] 16:43:13,080  	Rolling back modifications on POM of module 'com.i.t:tok-test:3.3.0-SNAPSHOT'
[DEBUG] 16:43:13,080  	Rolling back modifications on POM of module 'com.i.t:tok-application:3.3.0-SNAPSHOT'
[DEBUG] 16:43:13,081  	Rolling back modifications on POM of module 'com.i.t:tok-sandbox:3.3.0-SNAPSHOT'
[DEBUG] 16:43:13,081  	Rolling back modifications on POM of module 'com.i.t:tok-batch:3.3.0-SNAPSHOT'
[DEBUG] 16:43:13,082  	Rolling back modifications on POM of module 'com.i.t:tok-client:3.3.0-SNAPSHOT'
[INFO] WELD-ENV-002001: Weld SE container STATIC_INSTANCE shut down
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Skipping tok
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] tok ....................................... FAILURE [03:03 min]
[INFO] tok-security .............................. SKIPPED
[INFO] tok-data-jpa .............................. SKIPPED
[INFO] tok-common ................................ SKIPPED
[INFO] tok-test .................................. SKIPPED
[INFO] tok-application ........................... SKIPPED
[INFO] tok-sandbox ............................... SKIPPED
[INFO] tok-batch ................................. SKIPPED
[INFO] tok-client ................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:06 min
[INFO] Finished at: 2017-05-09T16:43:13+02:00
[INFO] Final Memory: 43M/285M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.itemis.maven.plugins:unleash-maven-plugin:2.4.2:perform (default-cli) on project tok: Execution default-cli of goal com.itemis.maven.plugins:unleash-maven-plugin:2.4.2:perform failed: No Git commit id found for String ''. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.itemis.maven.plugins:unleash-maven-plugin:2.4.2:perform (default-cli) on project tok: Execution default-cli of goal com.itemis.maven.plugins:unleash-maven-plugin:2.4.2:perform failed: No Git commit id found for String ''.
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.java:129)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238)
	at jenkins.maven3.agent.Maven33Main.launch(Maven33Main.java:176)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
	at hudson.remoting.UserRequest.perform(UserRequest.java:153)
	at hudson.remoting.UserRequest.perform(UserRequest.java:50)
	at hudson.remoting.Request$2.run(Request.java:336)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal com.itemis.maven.plugins:unleash-maven-plugin:2.4.2:perform failed: No Git commit id found for String ''.
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	... 31 more
Caused by: com.itemis.maven.plugins.unleash.scm.ScmException: No Git commit id found for String ''.
	at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.update(ScmProviderGit.java:473)
	at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.push(ScmProviderGit.java:373)
	at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.commit(ScmProviderGit.java:337)
	at com.itemis.maven.plugins.unleash.util.DevVersionUtil.commitChanges(DevVersionUtil.java:100)
	at com.itemis.maven.plugins.unleash.steps.actions.SetNextDevVersion.execute(SetNextDevVersion.java:87)
	at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.executeSequentialWorkflowStep(WorkflowExecutor.java:157)
	at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.execute(WorkflowExecutor.java:119)
	at com.itemis.maven.plugins.cdi.AbstractCDIMojo.execute(AbstractCDIMojo.java:209)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	... 32 more
Caused by: java.lang.NullPointerException
	at org.eclipse.jgit.api.MergeCommand.include(MergeCommand.java:512)
	at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.update(ScmProviderGit.java:471)
	... 40 more

NPE : No Git commit id found for String ''

I am trying to build https://github.com/guppy4j/libraries using Jenkins 2.60.1, Jenkins Maven Unleash Plugin 2.3.0, Maven 3.5, unleash-maven-plugin 2.6.0, unleash-scm-provider-git 2.1.0.

I saw the closed issue #9 but I still get that same exception. I tried the Additional Behaviours - Wipe out repository & force clone, but that didn't change anything.

Here is the log snippet:

[INFO] 22:28:35,683  Checking remote SCM repository for changes. Initial revision was 933be5ab26f398924ee68cd0106ac50ed623c14d
[INFO] 22:28:35,683  Tagging local and remote SCM repositories.
[INFO] 22:28:35,741  Git - Searching for Git tag '0.0.8'
[INFO] 22:28:36,400  Git - Tagging local repository with '0.0.8'
[INFO] 22:28:36,401  Git - Committing local changes.
[INFO] 22:28:36,792  Git - Commit finished successfully. New revision is: 26f00cf92d3f2eb8c2a5d337b052b673b71e6d05
[INFO] 22:28:39,041  Git - Tag creation finished successfully. New revision is: 
[INFO] 22:28:39,041  Detecting all release artifacts that have been produced during the release build for later installation and deployment.
[INFO] 22:28:39,071  Preparing project modules for next development cycle.
[INFO] 22:28:39,344  Git - Committing local changes.
[INFO] 22:28:39,460  Git - Pushing local changes to remote repository.
[INFO] 22:28:39,462  Git - Updating local repository with remote changes.
[ERROR] An exception was caught while processing the workflow step with id 'setDevVersion'.
com.itemis.maven.plugins.unleash.scm.ScmException: No Git commit id found for String ''.
	at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.update(ScmProviderGit.java:472)
	at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.push(ScmProviderGit.java:372)
	at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.commit(ScmProviderGit.java:336)
	at com.itemis.maven.plugins.unleash.util.DevVersionUtil.commitChanges(DevVersionUtil.java:100)
	at com.itemis.maven.plugins.unleash.steps.actions.SetNextDevVersion.execute(SetNextDevVersion.java:87)
	at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.executeSequentialWorkflowStep(WorkflowExecutor.java:157)
	at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.execute(WorkflowExecutor.java:119)
	at com.itemis.maven.plugins.cdi.AbstractCDIMojo.execute(AbstractCDIMojo.java:209)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
	at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main(Maven35Launcher.java:130)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at jenkins.maven3.agent.Maven35Main.launch(Maven35Main.java:176)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
	at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
	at hudson.remoting.UserRequest.perform(UserRequest.java:153)
	at hudson.remoting.UserRequest.perform(UserRequest.java:50)
	at hudson.remoting.Request$2.run(Request.java:336)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
	at org.eclipse.jgit.api.MergeCommand.include(MergeCommand.java:512)
	at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.update(ScmProviderGit.java:470)
	... 40 more
[INFO] Rolling back after execution errors - please find the error messages and stack traces above.
[INFO] 22:28:39,828  Rollback of all pom changes necessary for setting of the development version as well as reverting any made SCM commits.
[INFO] 22:28:39,848  Rollback of SCM tag creation and POM modifications due to a processing exception.
[INFO] 22:28:39,849  Git - Searching for Git tag '0.0.8'
[INFO] 22:28:40,032  Git - Deleting Git tag
[INFO] 22:28:40,033  Git - Searching for Git tag '0.0.8'
[INFO] 22:28:42,241  Rollback of artifact-spy-plugin addition to the build configuration.
[INFO] 22:28:42,299  Rollback of release version updating for all project modules

How to use a scm url with environment variables and without credentials?

I am trying to build and release my project within a bitbucket.org pipeline.

I set scm connection and developerConnetion to:

scm:git:https://x-token-auth:${env.REPOSITORY_OAUTH_ACCESS_TOKEN}@bitbucket.org/${env.BITBUCKET_REPO_FULL_NAME}.git

Within a bitbucket pipeline it is possible to use the following url for git commands:

https://x-token-auth:[email protected]/$BITBUCKET_REPO_FULL_NAME.git
[...]
[INFO] 14:03:53,808  Removing artifact-spy-plugin from build configuration.
[INFO] 14:03:53,831  Checking remote SCM repository for changes. Initial revision was 6cf8f31b9819ee039e8b3047039be9523d5f18fe
[INFO] 14:03:53,832  Tagging local and remote SCM repositories.
[INFO] 14:03:53,869  Git - Searching for Git tag '1.0.9'
[ERROR] An exception was caught while processing the workflow step with id 'tagScm'.
com.itemis.maven.plugins.unleash.scm.ScmException: An error occurred while querying the remote git repository for tag '1.0.9'.
    at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.hasTag (ScmProviderGit.java:640)
    at com.itemis.maven.plugins.unleash.steps.actions.TagScm.execute (TagScm.java:89)
    at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.executeSequentialWorkflowStep (WorkflowExecutor.java:157)
    at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.execute (WorkflowExecutor.java:119)
[...]
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.eclipse.jgit.api.errors.TransportException: https://bitbucket.org/myUser/myProject: Authentication is required but no CredentialsProvider has been registered
    at org.eclipse.jgit.api.LsRemoteCommand.execute (LsRemoteCommand.java:220)
    at org.eclipse.jgit.api.LsRemoteCommand.call (LsRemoteCommand.java:159)
    at com.itemis.maven.plugins.unleash.scm.providers.ScmProviderGit.hasTag (ScmProviderGit.java:634)
    at com.itemis.maven.plugins.unleash.steps.actions.TagScm.execute (TagScm.java:89)
    at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.executeSequentialWorkflowStep (WorkflowExecutor.java:157)
    at com.itemis.maven.plugins.cdi.internal.util.workflow.WorkflowExecutor.execute (WorkflowExecutor.java:119)
[...]
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.eclipse.jgit.errors.TransportException: https://bitbucket.org/myUser/myProject: Authentication is required but no CredentialsProvider has been registered
    at org.eclipse.jgit.transport.TransportHttp.connect (TransportHttp.java:484)
    at org.eclipse.jgit.transport.TransportHttp.openFetch (TransportHttp.java:288)
    at org.eclipse.jgit.api.LsRemoteCommand.execute (LsRemoteCommand.java:198)
    at org.eclipse.jgit.api.LsRemoteCommand.call (LsRemoteCommand.java:159)

Refactoring and Code Cleanup

The current implementation needs some refactorings and cleanups since most things are concentrated in the provider's main class.

  • extract parameterized log statements, eventually to the API for uniform logging
  • extract helpers
  • implement test cases

Doesn't work with Jenkins plugin & SSH credentials

I'm trying to provide a username+key into the Jenkins plugin via Jenkins' credentials and it seems to be silently ignored. Using SSH agent isn't practical for me because I'm using a different deploy key for each github project.

Happy to provide more details but looks like this simply isn't implemented. Can you confirm?

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.