Maven exec:java重写pom.xml中定义的系统属性

Maven exec:java重写pom.xml中定义的系统属性,java,maven,Java,Maven,我的pom.xml中有以下内容: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <executions> <execution> <goals> <goal>java</goal> <

我的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>

但它似乎不起作用。有什么方法可以点画吗?

这篇文章的答案对你有帮助吗@维拉特:是的,我试过(
mvn exec:java-DsomeKey=someOtherValue
),但出于某种原因,它似乎不能与
exec:java
一起工作。
mvn exec:java -DsomeKey=someOtherValue