Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Maven pom.xml(来自Ant)中设置java.security.policy?_Java_Maven_Ant_Pom.xml - Fatal编程技术网

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

如何在Maven pom.xml(来自Ant)中设置java.security.policy?,java,maven,ant,pom.xml,Java,Maven,Ant,Pom.xml,在Maven中,我将在何处设置Ant build.xml中所示的安全策略 <target name="runComputer" description="Run a computer"> <java classname="system.Computer" fork="true"> <jvmarg value="-Djava.security.policy=policy"/> </java> </target&g

在Maven中,我将在何处设置Ant build.xml中所示的安全策略

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

…如果my pom.xml包含此配置文件:

<profile>
    <id>manager</id>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>


            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>system.Computer</mainClass>
                    <commandlineArgs>"hello"</commandlineArgs>
                </configuration>
            </plugin>
        </plugins>
    </build>
</profile>

经理
org.apache.maven.plugins
maven编译器插件
3.3
1.8
1.8
org.codehaus.mojo
execmaven插件
1.2.1
测试
JAVA
系统、计算机
“你好”
的文档有一个示例:

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

com.example.Main
java.security.policy
政策

很酷,效果不错。只是要确保把它放在上面。谢谢