简体   繁体   中英

maven-surefire-plugin system properties and eclipse integration?

I set system properties for the surefire execution in maven's pom.xml. Eclipse ignores those. Is there any way to fix that issue?

In particular I use the basedir property to determine file locations, ie the build directory etc.

I don't want to run the tests as "maven test" because that's slow.

Update

I'm now using the test class' resource location to determine the project location on disk:

https://github.com/jjYBdx4IL/misc/blob/master/env-utils/src/main/java/com/github/jjYBdx4IL/utils/env/Maven.java#L64

This requires no configuration at all .

<dependency>
    <groupId>com.github.jjYBdx4IL.utils</groupId>
    <artifactId>env-utils</artifactId>
    <version>1.0</version>
</dependency>

I'm assuming from what you're saying, when you run maven at the command line, you've got environment variables set, which maven picks up. If this is the case, then either passing it along on the command line or setting the system properties seem like it might be the solution that you're looking for. The other thing is, make sure you're using "project.basedir", not just "basedir". See here for the property names

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM