git - mutliple project branches with maven -


i working pretty large project , want work on multiple branches of it. 1 of @ present older version of other, , poms same. i'd avoid changing version numbers in pom files since may require rewriting of them, , later make merging more tricky. simplest way jars produced mvn clean install don't overwrite ones in different branch placed in .mvn/repository ?

note: working git , found git-new-workdir script (available in git source repo) useful here in @ least allows jars produced in source tree hierarchy co-exist in different subdirectories.


so of course 1 simple answer have repository each branch. eg

  • .m2/repository
  • .m2/branch1/repository

then 1 can run mvn install -o -dmaven.repo.local=~/.m2/branch1/repository

of course nice if 1 clone links old repository not have download files. can done

$ cd .m2 $ mkdir branch1 $ find repository -type d -exec mkdir branch1/{} \; $ find repository -type f -exec ln {} \;  branch1/{} \; 

but repository.xml seems full of absolute directory url pointers. (why can't use relative urls?) anyway, not seem download of them, or @ least compilation lot faster expected.

the solution discovered in comment non-intrusive one.

the next best thing versions-maven-plugin, automates changing poms in different branches. sadly, i'm unaware of component out there allows automate process of discouraging git merging these changes along others.


Comments

Popular posts from this blog

sql - text truncated using perl DBI insert -

c++ - Is it possible to compile a VST on linux? -

php - Pass object by reference or value -