1
votes

In our company we use a patched maven3 which replaces a <version>${com.foo.bar.version}</version> placeholder with a real version before doing all the maven stuff. Might not be a great ideas, but I can not change this fact.

All works fine with command line mvn commands. In IntelliJ I have set maven home dir to the correct location of the patched maven. But right click->maven->reimport does not work. In the module settings I see that the dependencies of my module have wrong versions.

Is right click->maven->reimport using mvn dependency:tree of the patched maven? Or does IntelliJ uses some own implementation?


Following is from the console in IntelliJ's maven projects install goal

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Dmaven.home=/usr/share/java/patched/maven-3.0.3 -Dclassworlds.conf=/usr/share/java/patched/maven-3.0.3/bin/m2.conf -Didea.launcher.port=7536 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 13 CE.app/bin" -Dfile.encoding=UTF-8 -classpath "/usr/share/java/maven-3.0.3/boot/plexus-classworlds-2.4.jar:/Applications/IntelliJ IDEA 13 CE.app/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher install

Does this mean it uses a java maven implementation in /usr/share/java/maven-3.0.3/boot/plexus-classworlds-2.4.jar and not the maven executable in the path to our patched maven ?

B.t.w I found out, that version-variables <version>${com.foo.bar.version}</version> are ok, they just not possible in the parent/reactor pom

1
What about your M2_HOME property? And did you check the 'Override' checkbox next to the textbox of Maven home directory? - sinujohn
IntelliJ guess the path to my .m2 correctly with /home/myname/.m2/settings.xml and /home/myname/.m2/repository. So I do not to overwrite that and did not check that checkbox - midnight

1 Answers

0
votes

I won't even ask why it was necessary to use a "patched" maven (it seems like a very bad idea), but in any case: I am reasonably confident that intellij is using it's own in-memory dependency analysis when you invoke the reimport action.

Perhaps you are best to use a maven profile that sets the correct version for your development environment and build with -Pmyprofile.