Maven Plugin in IntelliJ IDEA does not correctly resolve properties defined in settings.xml
Hi,
In the parent pom.xml of my multi-modul project i have defined :
....
<build>
<outputDirectory>${maven.out.dir}/target${project.artifactId}/classes</outputDirectory>
<testOutputDirectory>${maven.out.dir}/target/${project.artifactId}/test-classes</testOutputDirectory>
....
The property "maven.out.dir" is defined in %HOMEDRIVE%\%HOMEPATH%\.m2\settings.xml.
<profiles>
<profile>
<id>test</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- output directory for maven (compiled classes, reports etc.) -->
<maven.out.dir>C:\tmp\mavenout</maven.out.dir>
</properties>
</profile>
</profiles>
Now on Import/Re-Import Maven Projects I receive Exceptions :
[ERROR] Cannot create resource output directory: C:\projects\omv\common\java\C:\tmp\mavenout\target\see-common\classes
Cannot create resource output directory: C:\projects\omv\common\java\C:\tmp\mavenout\target\see-common\classes
In the shell (cmd) the above configuration works as expected.
What can I do to fix this in IntelliJ IDEA?
Please sign in to leave a comment.
Hi again,
It is worse because now I cannot start my JUnit-Tests in Intellij IDEA.My Tests are now started with the folowing classpath :
C:\projects\omv\common\java\${maven.out.dir}\target\see-common\test-classes;C:\projects\omv\common\java\${maven.out.dir}\target\see-common\classes;
and this does not of course work
Hi, Assen,
What IDEA version do you use?
Thanks,
Anton Makeev
Hi Anton,
I use Intellij IDEA Version 8.1.3, Build 9886 and JDK 1.6.0_12.
Regards,
Assen Todorov
I see,
This problem should have been fixed in IDEA 9; RC is available to download.
Please check is it solves the problem for you.
Thanks,
Anton Makeev
Hi,
Ok it seems to be fixed in IDEA 9.
Will it be fixed in 8.x?
Regards,
Assen Todorov
No, it is a problem of Maven Embedder that is used in 8.0 and it is very hard to backport Maven 2.2.1 to IDEA 8.0
I am having the same problem when using several custom settings files. Is there a way to configure intellij to read multiple settings.xml files?
Hello David,
Do you mean multiple settings.xml files for the same project?