danielflower / multi-module-maven-release-plugin

A maven release plugin that is fast, does not add extra commits, and works well with single or multiple modules
http://danielflower.github.io/multi-module-maven-release-plugin/index.html
MIT License
124 stars 64 forks source link

Working with submodules? #17

Open ascheman opened 8 years ago

ascheman commented 8 years ago

This is a great plugin, thanks a lot!

Are there any plans to support git submodules already? I have just tried it with a reactor pom and two submodules. The releasing itself worked well in some sense: New versions of my (sub-)modules were uploaded to the repository.

However, I ran into two problems

How could we contribute to such an extension? Are there are any efforts already started? Do you see any impediments regarding this requirement?

danielflower commented 8 years ago

Hi there. I've never really used Git sub-modules so I don't really understand what would be required to get it working, or what the high level rules would be. How do you think they should work? For example should they just be ignored when it comes to releasing?

ascheman commented 8 years ago

We have played around with the plugin and submodules and maven/git submodules are used nicely for the release algorithm (increasing of "build number" etc.).

However, what does not work:

I think the latter can be easily solved by checking if the pom.xml was changed in a sub module. BTW: As far as I can see the modified pom.xml is only used for building/releasing with the "final" version. Would it be possible to just create a tmp.pom file (as copy from pom.xml with the local modifications) and delete it afterwards without even touching the original pom.xmls?

The first issue probably needs some more investigation: If sub modules are used, the tags need to be applied to the sub modules.

You may use the following project with sub modules to see my problem:

git clone --recursive -b feature/submodules-poc ssh://git@github.com/dukecon/dukecon_server_reactor
cd dukecon_server_reactor
mvn releaser:release

Everything works well until you run into the error with the POMs which cannot be restored. And you will also see the tags afterwards:

git tag -l
dukecon-html5-client-1.1.0
dukecon-reactor-1.0.0
dukecon-server-1.1.0
dukecon-server-api-1.1.0
dukecon-server-springboot-1.1.0

cd dukecon_server/
git tag -l

All tags in the master/reactor project but none in the sub projects!

jdileonardo commented 8 years ago

I second this feature.

Currently i'm building a huge project(27 git repo's) and each repo has it's own parent pom.

What i'm looking to do is create a Parent Repo, and all 27 component repo's would be submodules.

Then i'd create an Aggregate pom in the parent, which would point to the submodules and then it'd build for me all in one maven build. Instead of what i do currently which is build them in seperately calculated order.

@danielflower submodules, imo, is worth looking into :). Great work on the plugin!

danielflower commented 8 years ago

I still don't have personal experience with sub-modules, so I probably won't work on this myself. But if anyone has the time, then it wouldn't be too hard to add a sample test project consisting of some submodules, and once you have a test the implementation is probably simple enough.

BTW: As far as I can see the modified pom.xml is only used for building/releasing with the "final" version. Would it be possible to just create a tmp.pom file (as copy from pom.xml with the local modifications) and delete it afterwards without even touching the original pom.xmls?

That is a really good idea whether submodules are used or not. I know when running mvn you can specify a non-default pom location, but I wonder if it has any other consequences.