Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Submodule support #1

Open
koraktor opened this Issue · 11 comments

2 participants

@koraktor
Owner

Mavanagaiata works great with submodules through customized plugin executions using different settings for gitDir and other properties.

But it would be great, if there was a way to let this happen automagically, creating properties (and files) based on submodules.

@koraktor koraktor was assigned
@ravn

For our purpose it would be fine if was not expected by default to be in the parent folder of basedir, but located by looking in the parent folder of basedir, and if not found the parent of the parent, etc. all the way to the top.

@koraktor
Owner

If I understand you, you're not having Git submodules, but one Git repository for several Maven projects, right?

@ravn

Yes. I am still new to the Maven mindset and apparently misunderstood what you were describing. Can the current version do what I describe?

@koraktor
Owner

It won't work out of the box. I guess that this would work, but may require a somewhat complex configuration. You will at least need to specify the gitDir to use .git/ of the parent directory.

@ravn

That is what I did, but I don't quite understand why it would not be possible to ask to search up towards the root. Ant can do it when looking for build.xml.

@koraktor
Owner

I didn't say that this isn't entirely impossible, but it won't work with the current version of Mavanagaiata out-of-the-box.

I just opened a new issue (#8) for this use case.

@ravn

I have now tried moving the mavanagaiata configuration snippet into a parent pom (sitting a directory level above each module which need this) and the parent pom.xml is next to .git/ and the automatic search does not work with 0.4.1.

What is the proper way to do this for automatic searching of .git to work?

@koraktor
Owner

A parent POM won't help, because the baseDirs of the sub-projects stay the same (one level below .git).

Please try to setup the configuration as follows. You can choose to set either baseDir to the root of your repository or gitDir to .git (or both).

<plugin>
    <groupId>com.github.koraktor</groupId>
    <artifactId>mavanagaiata</artifactId>
    <version>0.4.1</version>
    <configuration>
        <baseDir>${project.basedir}/..</baseDir>
        <gitDir>${project.basedir}/../.git</gitDir>
    </configuration>
</plugin>
@koraktor
Owner

@ravn There was a regression in 0.4.0 which was fixed in 4b4e25a which might also affect your use case.

@ravn

I am now experimenting with submodules (we essentially want a single super pom pulling in all our branches) and interestingly enough hit this exact open issue. In my case the explicitly pointed out ".git" folder has now become a .git-file containing "gitdir: ../.git/modules/DVER" which mavanagaiata dislikes causing our builds to break. Is this anyone else seeing this issue?

@koraktor
Owner

This is Git's new format for submodules, the actual .git folder of the submodule will reside in .git/modules/submodule of the parent repository.

@koraktor koraktor added this to the 0.8.0 milestone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.