Matteo
Matteo

Reputation: 1377

How to set a java system property during testing phase

sorry for the dumb question, but I'm really new to maven and I cannot find any answer (I tried, I found something, but I did not understand it ;-) )

The problem is the following:

How can I instruct maven to do that?

Upvotes: 3

Views: 1871

Answers (3)

jsievers
jsievers

Reputation: 1853

try

<plugins>
  <plugin>
    <groupId>org.eclipse.tycho</groupId>
    <artifactId>tycho-surefire-plugin</artifactId>
    <version>${tycho-version}</version>
    <configuration>
      <systemProperties>
          <key>value</key>
      </systemProperties>
    </configuration>
  </plugin>
</plugins>

Upvotes: 5

bmargulies
bmargulies

Reputation: 100050

Tycho uses surefire. You need to use the systemPropertyValues configuration element of surefire.

Upvotes: 0

Chris
Chris

Reputation: 23171

You should update the configuration of your test plugin within your Maven pom:

 <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.10</version>
        <configuration>
           <argLine>-Ddebug=true</argLine>
        </configuration>
      </plugin>
    </plugins>
  </build>

Upvotes: 0

Related Questions