我可以使用以下命令通过maven命令行启动我的应用程序:
mvn -f test-framework/pom.xml exec:java -Dexec.mainClass="com.application.app" -Dexec.classpathScope="test" -Dexec.args="/META-INF/spring/application-context.xml" -Denv=stubbed -Dsys=app -Dspring.profiles.active=app我想修改我的项目的pom.xml,这样我就可以在测试作业期间使用Jenkins自动启动应用程序。我想知道如何将上面的Maven命令转换为Maven配置文件。我执行了以下操作,但应用程序无法启动:
<execution>
<id>start-app</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>mvn</executable>
<workingDirectory>${sut.path}/app/test-framework</workingDirectory>
<arguments>
<argument>exec:java</argument>
<argument>"-Dexec.mainClass=com.application.app"</argument>
<argument>"-Dexec.classpathScope=test"</argument>
<argument>"-Dexec.args=/META-INF/spring/application-context.xml"</argument>
<argument>-Denv=stubbed</argument>
<argument>-Dsys=app</argument>
<argument>-Dspring.profiles.active=pdc</argument>
</arguments>
</configuration>
</execution>有没有人能帮我把这个命令放到pom.xml配置文件中?
发布于 2017-05-25 17:57:23
您是否尝试过设置<start-class>属性?
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<start-class>com.stackoverflow.MyClass</start-class>
</properties> https://stackoverflow.com/questions/44177186
复制相似问题