你如何在Maven pom.xml(来自Ant)中设置java.security.policy?

时间:2015-05-25 00:16:07

标签: java maven ant pom.xml

在Maven中,我将在哪里设置安全策略,如此Ant build.xml中所示......

module_eval

...如果我的pom.xml包含此配置文件:

<target name="runComputer" description="Run a computer">
    <java classname="system.Computer" fork="true">
        <jvmarg value="-Djava.security.policy=policy"/>
    </java>
</target>

1 个答案:

答案 0 :(得分:3)

exec-maven-plugin的文档有一个例子:

<configuration>
  <mainClass>com.example.Main</mainClass>
  <arguments>
    <systemProperties>
      <systemProperty>
        <key>java.security.policy</key>
        <value>policy</value>
      </systemProperty>
    </systemProperties>
  </arguments>
 </configuration>