【发布时间】:2014-07-11 09:51:24
【问题描述】:
同时使用 spring-boot-maven-plugin run 和 repackage 目标会导致我的编译和测试阶段重新运行,例如
mvn clean package spring-boot:run
你会看到两个编译和测试运行...
在maven调试输出中我可以看到
...
[DEBUG] Goal: org.springframework.boot:spring-boot-maven-plugin:1.0.2.RELEASE:repackage (default)
[DEBUG] Style: Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<finalName default-value="${project.build.finalName}"/>
<outputDirectory default-value="${project.build.directory}"/>
<project default-value="${project}"/>
</configuration>
[DEBUG] --- init fork of myapp:1.0-SNAPSHOT for org.springframework.boot:spring-boot-maven-plugin:1.0.2.RELEASE:run (default-cli) ---
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): [compile, test]
[DEBUG] -----------------------------------------------------------------------
看看插件源代码类,我看到的是 RunMojo 和 RepackageMojo
@Mojo(name = "run", requiresProject = true, defaultPhase = LifecyclePhase.VALIDATE, requiresDependencyResolution = ResolutionScope.TEST)
@Execute(phase = LifecyclePhase.TEST_COMPILE)
public class RunMojo extends AbstractMojo {
认为@Execute 与它有关?
谢谢
【问题讨论】: