Iletij doesn't trigger systemPropertiesFile of maven-surefire

Hi guys,

I'm evaluatin intelij idea 12.1.4 since 2 two weeks. First of all it's a great idea. The best that I used for Java and JavaEE stuff I can say.

I use project sepecific settings for setup my testenvironment. Some of the properties are defined in my pom and some of then in an external propertyfile.

Iletij sets the -D options for systemPropertyVariables. But doesn't trigger my proprty file which is definded under systemPropertiesFile.

Under the commandline works this approach perfectly. Did I miss something??

<plugin>

                <artifactId>maven-surefire-plugin</artifactId>

                <inherited>true</inherited>

                <configuration>

                    <groups>

                        ${includeGroups}

                    </groups>

                    <runOrder>alphabetical</runOrder>

                    <enableAssertions>true</enableAssertions>

                    <failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>

                    <failIfNoTests>false</failIfNoTests>

                    <testFailureIgnore>${testFailureIgnore}</testFailureIgnore>

                    <useFile>false</useFile>

                    <argLine>-Xms256m -Xmx512m -XX:MaxPermSize=128m -ea

                        -Dfile.encoding=${project.build.sourceEncoding}

                    </argLine>

                    <systemPropertiesFile>${user.home}\wmstest.properties</systemPropertiesFile>

                    <systemPropertyVariables>

                        <arquillian.launch>${arquillian-profile}</arquillian.launch>

                        <testServer>${jboss.test.dir}</testServer>

                        <versionbase>${version-wms-base}</versionbase>

                        <wrapper.home>${env.WRAPPER_HOME}</wrapper.home>

                        <port.management>${port.management}</port.management>

                        <port.offset>${port.offset}</port.offset>-->

                    </systemPropertyVariables>

                </configuration>

                <dependencies>

                    <dependency>

                        <groupId>org.apache.maven.surefire</groupId>

                        <artifactId>surefire-junit47</artifactId>

                        <version>${version-plugin-surefire}</version>

                    </dependency>

                </dependencies>

            </plugin>

5 comments

Hello.

What action works wrong for you? Starting a Maven goal from Maven Projects tool window?

Thanks,
Alexander.

0

Hi Alexander,

over maven works everything ok. The problem occurs if I run junit tests over runconfiguration. Intilij set properties of the section    <systemPropertyVariables>    </systemPropertyVariables> fine but ignores the properties of <systemPropertiesFile>${user.home}\wmstest.properties</systemPropertiesFile>. So I must set it with VM options in the runconfiguration at the moment.

0

If I've got it correctly, properties specified in wmstest.properties file are to be passed to JUnit runner, and this is done by Maven surefire plugin.

This way, if we want to run JUnit independently from Maven, we have to:
1. Find a way to pass system properties file to JUnit. This does not depend on IDEA.
2. Provide a feature in IDEA to correctly pick up the file name from the surefire configuration and pass it to JUnit (well, somehow).

I have stopped at point 1. Brief googling does not tell me does JUnit accept a _system_ properties _file_. Do you know?

Anyway, if I understand this correctly, there is no required IDEA feature at the moment.

Thank you,
Alexander.

0

Hi Alexander,

if I run mvn from console then my properties will set correctly over surefire.

0

Has anyone done anything with this?  It's pretty ridiculous that it's sat around for 3 years with only "there's not required IDEA feature at the moment".

I have a whole organisation ready to switch to NetBeans over this issue.

0

Please sign in to leave a comment.