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?

8 comments
Comment actions Permalink

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

0
Comment actions Permalink

Hi, Assen,

What IDEA version do you use?

Thanks,
Anton Makeev

0
Comment actions Permalink

Hi Anton,

I use Intellij IDEA Version 8.1.3, Build 9886 and JDK 1.6.0_12.

Regards,

Assen Todorov

0
Comment actions Permalink

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

0
Comment actions Permalink

Hi,

Ok it seems to be fixed in IDEA 9.
Will it be fixed in 8.x?

Regards,

Assen Todorov

0
Comment actions Permalink

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

0
Comment actions Permalink

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?

0
Comment actions Permalink

Hello David,

Do you mean multiple settings.xml files for the same project?

 

0

Please sign in to leave a comment.