【发布时间】:2014-01-23 20:04:20
【问题描述】:
我尝试使用 exec-maven-plugin 来运行 Java 程序。
我使用下面的 pom sn-p:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<executable>java</executable>
<arguments>
<argument>-Dmyproperty=myvalue</argument>
<argument>-cp</argument>
<argument>"/home/vogella/libs/*"</argument>
<argument>com.vogella.test.Main</argument>
</arguments>
</configuration>
</plugin>
com.vogella.test.Main 类包含在位于 /home/vogella/libs/* 的 jar 文件之一中。如果我运行 mvn -X clean install exec:exec 命令,我会看到以下错误消息:
[DEBUG] 执行命令行:java -Dmyproperty=myvalue -cp “/home/vogella/libs/*” com.vogella.test.Main 错误:无法找到或加载主类 com.vogella.test.Main
如果我在启动 Maven 构建的 shell 中复制命令行 (java -Dmyproperty=myvalue -cp "/home/vogella/libs/*" com.vogella.test.Main),则 Java 程序将正确执行。
知道我的 Maven 设置有什么问题吗?
【问题讨论】:
-
该构建基于 Tycho 插件,它处理类路径的方式不同。默认不起作用
标签: java xml maven exec-maven-plugin