StringIndexOutOfBoundsException with 1.0-alpha20 on most goals

203 views
Skip to first unread message

George Stathis

unread,
Aug 29, 2013, 6:15:01 PM8/29/13
to maven-jgit...@googlegroups.com
I don't know if this is a bug or me just not using the plugin properly which is why I'm posting here first.

I just added the plugin to an existing project and I'm giving the jgitflow:feature-start goal a spin but getting the following stacktrace:

GPS-Work-Mac:traackr-modules.git gstathis$ mvn -e jgitflow:feature-start
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[...]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.917s
[INFO] Finished at: Thu Aug 29 17:52:59 EDT 2013
[INFO] Final Memory: 6M/2043M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.atlassian.maven.plugins:maven-jgitflow-plugin:1.0-alpha20:feature-start (default-cli) on project traackr-modules: Execution default-cli of goal com.atlassian.maven.plugins:maven-jgitflow-plugin:1.0-alpha20:feature-start failed: String index out of range: -1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.atlassian.maven.plugins:maven-jgitflow-plugin:1.0-alpha20:feature-start (default-cli) on project traackr-modules: Execution default-cli of goal com.atlassian.maven.plugins:maven-jgitflow-plugin:1.0-alpha20:feature-start failed: String index out of range: -1
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
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:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal com.atlassian.maven.plugins:maven-jgitflow-plugin:1.0-alpha20:feature-start failed: String index out of range: -1
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1937)
at java.lang.String.substring(String.java:1904)
at com.atlassian.jgitflow.core.util.GitHelper.remoteBranchExists(GitHelper.java:227)
at com.atlassian.jgitflow.core.JGitFlowInitCommand.call(JGitFlowInitCommand.java:198)
at com.atlassian.jgitflow.core.JGitFlow.forceInit(JGitFlow.java:112)
at com.atlassian.maven.plugins.jgitflow.manager.DefaultFlowFeatureManager.start(DefaultFlowFeatureManager.java:46)
at com.atlassian.maven.plugins.jgitflow.FeatureStartMojo.execute(FeatureStartMojo.java:55)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
... 20 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

I get the same stacktrace with hotfix-start. It seems that there is an issue parsing the URL of a remote branch? 

My .git/config:

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
precomposeunicode = false
[svn-remote "svn"]
noMetadata = 1
url = file:///Volumes/SVN_CORE/local-svn
fetch = CORE/trunk/traackr-maven/traackr-modules:refs/remotes/trunk
[svn]
authorsfile = /Volumes/SVN_CORE/authors.txt
[gitflow "branch"]
master = master
develop = dvlp
[branch "master"]
[remote "origin"]
url = g...@bitbucket.org:traackr/traackr-modules.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master

This project just got migrated from Atlassian SVN to BitBucket, not sure if that matters but that should explain the SVN remote settings.

My pom settings are:

      <plugin>
        <groupId>com.atlassian.maven.plugins</groupId>
        <artifactId>maven-jgitflow-plugin</artifactId>
        <version>1.0-alpha20</version>
        <configuration>
          <!-- see goals wiki page for configuration options -->
          <!-- https://bitbucket.org/atlassian/maven-jgitflow-plugin/wiki/goals.wiki -->
          <allowSnapshots>true</allowSnapshots>
          <enableFeatureVersions>true</enableFeatureVersions>
          <pushFeatures>true</pushFeatures>
          <pushReleases>true</pushReleases>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <flowInitContext>
            <developBranchName>dvlp</developBranchName>
          </flowInitContext>
        </configuration>
      </plugin>

Let me know what other information I can provide. If this is likely a bug and belongs to Issues, I can take care of that.

Thank you in advance for your time.

-George

George Stathis

unread,
Aug 30, 2013, 9:12:13 AM8/30/13
to maven-jgit...@googlegroups.com
Answering my own question. I was able to circumvent the problem by re-cloning the project in a fresh directory with BitBucket as the origin. The original project I was working on was the clone that resulted from the git svn command when we migrated from SVN (https://go-dvcs.atlassian.com/display/aod/initial+clone). It seems that that clone contains information about the local SVN repo of origin that the Atlassian GitFlow Core library can't parse.

Let me know if I can provide more information but as it stands, I'm able to use the plug-in just fine. Looking forward to having it be part of our build!

-GS
Reply all
Reply to author
Forward
0 new messages