Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-users] Support for .mvn/maven.config

Hello m2e users and devs,
I'd like to know if there is any support for the Maven feature where the file ".mvn/maven.config" defines some additional prioperties for the build.
According to my tests on latest Eclipse Photon, this is not supported.

Let me explain why this feature is really lacking:
in my team we use git branches, and we make each build available on our Central repo (Apache Archiva). But to avoid that each build overwrites the one resulting from another branch, we add the branch name as a suffix for each version. So versions are usually:
- 1.0.0-SNAPSHOT (on master, no suffix)
- 1.0.0-branch1-SNAPSHOT (on git branch1)
- 1.0.0-branch2-SNAPSHOT (on git branch2)

Problem is that when we want to merge the branches, we do not want to merge the version numbers. And most of all we 'd like to avoid git conflicts on version numbers.

The solution is to externalize the version number from the poms files, which is a recent Maven feature ( https://blog.soebes.de/blog/2017/04/02/maven-pom-files-without-a-version-in-it/ ) AND define a specific merge policy (merge=ours) on the .mvn/maven.config. This way, merge requests could be treated without any additional work.

For info, In IntelliJ this is a very recent feature ( https://blog.jetbrains.com/idea/2018/05/intellij-idea-2018-2-eap2-breakpoint-intentions-enhancements-in-code-refactoring-and-more/ ).

I understand that some mechanisms of the .mvn folder cannot be added to m2e easily (such as extensions.xml extension handling mechanism) but support for maven.config file would be a huge plus and I can imagine that it is a lot simpler than extensions.xml (it's always easy to think things are easy when you do not dev them yourself ;) ).

I may have time to look at the source and propose changes if someone would point me to where to begin with.

regards
- - - - -
François Marot


Back to the top