首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Maven pom.xml (来自Ant)中设置pom.xml?

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

Stack Overflow用户
提问于 2015-05-25 00:16:07
回答 1查看 2K关注 0票数 3

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

代码语言:javascript
复制
<target name="runComputer" description="Run a computer">
    <java classname="system.Computer" fork="true">
        <jvmarg value="-Djava.security.policy=policy"/>
    </java>
</target>

...if my pom.xml包括以下配置文件:

代码语言:javascript
复制
<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>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-05-25 01:41:52

插件的文档有一个例子:

代码语言:javascript
复制
<configuration>
  <mainClass>com.example.Main</mainClass>
  <arguments>
    <systemProperties>
      <systemProperty>
        <key>java.security.policy</key>
        <value>policy</value>
      </systemProperty>
    </systemProperties>
  </arguments>
 </configuration>
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30429713

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档