首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在spring-boot-maven-plugin中派生

无法在spring-boot-maven-plugin中派生
EN

Stack Overflow用户
提问于 2018-12-15 22:13:13
回答 1查看 1.8K关注 0票数 0

我正在尝试在预集成阶段启动一个spring引导应用程序,并对其运行一些集成测试。

下面是配置,在fork模式false中,我可以验证应用程序是否正在启动,但即使通过命令行或通过配置将fork设置为true,应用程序也不是在fork jvm中启动,而是在相同的jvm中启动。

代码语言:javascript
复制
<plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.1.1.RELEASE</version>
                <configuration>
                    <mainClass>com.settlement.Settlement</mainClass>
                    <layout>ZIP</layout>
                    <jvmArguments>
                        -DconfigDbPropertiesFile=../../common/profile/src/main/resources/${user.name}.properties -Dsettlement.rest.port=9090 -DcomponentPort=1779
                    </jvmArguments>
                    <fork>true</fork>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>start-service</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>stop-service</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

要执行的命令

代码语言:javascript
复制
mvn spring-boot:run -Dspring-boot.run.arguments=Settlement,Settlement,Settlement,BASE_PERSISTENCE_CONSTANTS -Dspring-boot.run.fork=true
EN

回答 1

Stack Overflow用户

发布于 2019-12-09 22:41:03

这段maven代码适用于我。

代码语言:javascript
复制
<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <fork>true</fork>
    </configuration>
    <executions>
        <execution>
            <configuration>
                <mainClass>com.ashomokdev.springdockerec2.SpringDockerEc2Application</mainClass>
            </configuration>
        </execution>
    </executions>
</plugin>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53793995

复制
相关文章

相似问题

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