multi-module setup with individual git repositories for each module

1,121 views
Skip to first unread message

Henning Moll

unread,
Jun 12, 2014, 7:43:31 PM6/12/14
to maven-jgit...@googlegroups.com
Hi,

I wonder if it's possible to use JGitFlow plugin in a multi-module setup with individual git repositories for each module?

I already started a basic test setup, but i have problems. Here is the pom of the parent project:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.X</groupId>
  <artifactId>parent</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>pom</packaging>

  <build>
    <plugins>
        <plugin>
            <groupId>external.atlassian.jgitflow</groupId>
            <artifactId>jgitflow-maven-plugin</artifactId>
            <version>1.0-m2</version>
            <configuration>
                <!-- see goals wiki page for configuration options -->
            </configuration>
        </plugin>
    </plugins>
</build>
 
  <modules>
      <module>../child</module>
  </modules>
</project>

This is the pom of the module:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <artifactId>child</artifactId>
  <parent>
      <groupId>com.X</groupId>
      <artifactId>parent</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <relativePath>../parent</relativePath>
  </parent>
</project>

Both of them are versioned by git with a local repository in each root directory (parent/.git and child/.git)

So here are my current problems: If i use goal "jgitfflow:feature-start" from within the parent directory, the feature branch is created, but only on the parent project. How do i convince the plugin to do the same in the module?

The second problem is, when i use "jgitfflow:feature-finish", the process fails with this exception:

org.apache.maven.lifecycle.LifecycleExecutionException: Error finishing feature: Error finish feature: Error building project from MavenBuildCommand
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:622)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error finishing feature: Error finish feature: Error building project from MavenBuildCommand
    at com.atlassian.maven.plugins.jgitflow.mojo.FeatureFinishMojo.execute(FeatureFinishMojo.java:90)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    ... 17 more
Caused by: com.atlassian.maven.plugins.jgitflow.exception.MavenJGitFlowException: Error finish feature: Error building project from MavenBuildCommand
    at com.atlassian.maven.plugins.jgitflow.manager.DefaultFlowFeatureManager.finish(DefaultFlowFeatureManager.java:129)
    at com.atlassian.maven.plugins.jgitflow.mojo.FeatureFinishMojo.execute(FeatureFinishMojo.java:86)
    ... 19 more
Caused by: com.atlassian.jgitflow.core.exception.JGitFlowExtensionException: Error building project from MavenBuildCommand
    at com.atlassian.maven.plugins.jgitflow.extension.command.MavenBuildCommand.execute(MavenBuildCommand.java:50)
    at com.atlassian.jgitflow.core.command.AbstractGitFlowCommand.runExtensionCommands(AbstractGitFlowCommand.java:219)
    at com.atlassian.jgitflow.core.command.AbstractBranchMergingCommand.checkoutTopicBranch(AbstractBranchMergingCommand.java:156)
    at com.atlassian.jgitflow.core.command.FeatureFinishCommand.call(FeatureFinishCommand.java:145)
    at com.atlassian.maven.plugins.jgitflow.manager.DefaultFlowFeatureManager.finish(DefaultFlowFeatureManager.java:105)
    ... 20 more
Caused by: java.lang.NullPointerException
    at com.atlassian.maven.plugins.jgitflow.helper.DefaultMavenExecutionHelper.execute(DefaultMavenExecutionHelper.java:95)
    at com.atlassian.maven.plugins.jgitflow.helper.DefaultMavenExecutionHelper.execute(DefaultMavenExecutionHelper.java:61)
    at com.atlassian.maven.plugins.jgitflow.extension.command.MavenBuildCommand.execute(MavenBuildCommand.java:45)
    ... 24 more

Any suggestions?

Best regards
Henning

Jonathan Doklovic

unread,
Jun 13, 2014, 1:30:40 PM6/13/14
to maven-jgit...@googlegroups.com
Currently this is not possible. It's a hard issue to solve because there are a lot of unknowns.... some modules my not be git-inited and some are, each module could possibly have a different git-flow configuration (e.g. one module uses feature/ and another uses issue/), when you release, you now have to do multiple merges into multiple masters and what do you do if one module has a merge conflict?

Again, it's not really possible in the current plugin and not on the roadmap anytime soon. Have you been able to make this process work with the plain old git-flow cli ?

Henning Moll

unread,
Jun 13, 2014, 4:08:56 PM6/13/14
to maven-jgit...@googlegroups.com
>Have you been able to make this process work with the plain old git-flow cli ?

No. I am a beginner in using git, maven and git-flow. I just wan`t to know if it is possible or not. Thank you very much for your detailed answer.

Best regards
Henning

Henning Moll

unread,
Jun 13, 2014, 6:13:19 PM6/13/14
to maven-jgit...@googlegroups.com
But what about the exception? I now use a single git repository and it is still thrown during jgitflow:feature-finish.

Jonathan Doklovic

unread,
Jun 16, 2014, 1:33:26 PM6/16/14
to maven-jgit...@googlegroups.com
could you please re-run it with -X and provide the full maven output as well as attach the ./.git/jgitflow.log file ?

Nicolas Décrevel

unread,
Jun 24, 2014, 4:35:23 AM6/24/14
to maven-jgit...@googlegroups.com
Henning,
I had the same exception and it was fixed by using maven 3 over maven 2.

Jonathan,
Maybe you could put the requirement of maven 3 in your wiki?

Hope it helps!

Rob Moore

unread,
Jul 8, 2015, 12:56:34 PM7/8/15
to maven-jgit...@googlegroups.com
Hi, Jonathan,

I'm running into a similar issue and was hoping it might be possible to process them independently by running jgitflow:release-start on each project without automatic submodule versioning enabled. I'm running into an issue with the snapshot check failing because the super POM is a snapshot version (the same version as the project's POMs). Just curious if this approach seems viable to you.

Thanks,

Rob

J MacNaught

unread,
Jul 16, 2015, 1:20:14 PM7/16/15
to maven-jgit...@googlegroups.com
I also have a situation with a large group of projects, each with it's own repository.  I use a parent pom with dependency management to declare the versions of the interdependent sub projects.   This plugin updates all the versions nicely, but does not create the release branch in each project's repo.  This is a big issue, and I imagine there are lots of projects set up this way.  It's not feasible to put all the projects into a single repository.

Rob Moore

unread,
Jul 20, 2015, 11:23:35 AM7/20/15
to J MacNaught, maven-jgit...@googlegroups.com
We've dealt with the lack of the release branches by calling git directly ourselves before running the release-start goal on the super POM project (which references the submodules). So it's something that we can workaround but involves more work and feels less clean than being able to run release-start against the projects independently. 

The release-finish goal has a parameter 'consistentProjectVersions' which updates the parent POM version to be the same as the referencing project's version. Perhaps this might be a good enhancement to the release-start goal.

--
You received this message because you are subscribed to the Google Groups "Maven JGit Flow Plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maven-jgitflow-u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jörg Wille

unread,
Sep 21, 2017, 2:11:36 AM9/21/17
to Maven JGit Flow Plugin
This is an old thread, but it describes exactly the problem I am facing.
I have multi module maven projects with 1 single parent and 2 hierarchies of aggregators.
Each aggregator is in its own git repo.
I have included a separate scm tag in each aggregator pom, pointing to the correct git.
If I call release-start goal on the parent it only creates release branch in this single git repo.

Does the jgitflow-plugin today offer this functionality?
Or has anyone found a solution to this problem yet maybe with a different plugin?

Thanks!


Am Montag, 20. Juli 2015 17:23:35 UTC+2 schrieb Rob Moore:
We've dealt with the lack of the release branches by calling g it directly ourselves before running the release-start goal on the super POM project (which references the submodules). So it's something that we can workaround but involves more work and feels less clean than being able to run release-start against the projects independently. 
To unsubscribe from this group and stop receiving emails from it, send an email to maven-jgitflow-users+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages