1

I have this in my pom.xml:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <executions>
    <execution>
      <goals>
        <goal>java</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <mainClass>com.example.Main</mainClass>
    <systemProperties>
      <systemProperty>
        <key>someKey</key>
        <value>someValue</value>
      </systemProperty>
    </systemProperties>
  </configuration>
</plugin>

When running this from command line, I sometimes want to override the above someKey:someValue. I tried this:

mvn exec:java -DsomeKey=someOtherValue

but it doesn't seem to be working. Is there a way to dot this?

levant pied
  • 3,886
  • 5
  • 37
  • 56
  • Does the answer of this post helps you? https://stackoverflow.com/questions/13876165/how-to-override-maven-property-in-command-line – Villat Oct 11 '19 at 21:07
  • @Villat Yeah I tried that (`mvn exec:java -DsomeKey=someOtherValue`), but it doesn't seem to be working with `exec:java` for some reason. – levant pied Oct 11 '19 at 21:14

0 Answers0