【发布时间】:2011-03-22 19:31:01
【问题描述】:
我很惊讶,本来应该很轻松的工作却变成了对我来说非常烦人的任务。我需要的只是将一些命令行参数传递给我的 maven exec:exec 插件。不幸的是,几个小时的谷歌搜索根本没有帮助。
这是我的插件
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-instrument</artifactId>
<version>${spring.version}</version>
</dependency>
</dependencies>
<configuration>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<classpath />
<argument>-javaagent:${settings.localRepository}/org/springframework/spring-instrument/${spring.version}/spring-instrument-${spring.version}.jar</argument>
<argument>-Xmx256m</argument>
<argument>com.myPackage.Myclass</argument>
</arguments>
</configuration>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
现在我在命令提示符下输入:
mvn exec:exec -Dexec.args=-Dmy.property=myProperty
我也试过了:
mvn exec:exec -Dexec.arguments=-Dmy.property=myProperty
还有很多其他的东西。然而,似乎没有任何工作。我知道 exec:exec 在单独的 VM 中运行,但根据文档 -Dexec.args 应该对我有用。有人可以建议我哪里出错了吗?
【问题讨论】:
标签: maven-plugin