我希望我的“预集成-测试”阶段是以下目标的执行,在这个特殊的顺序。
阶段:预集成测试
有任何方法可以使用Maven 3来完成这个任务吗?
我面临的问题是,"maven-antrun- plugin : run“1& 2总是一个接一个地运行,因为它们是在同一个插件元素中定义的:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>display-port</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo>Displaying value of 'tomcat.http.port' property</echo>
<echo>[tomcat.http.port] ${tomcat.http.port}</echo>
</target>
</configuration>
</execution>
<execution>
<id>wait-for-startup</id>
<phase>pre-integration-test</phase>
<configuration>
<target>
<sleep seconds="10" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>现在,我找到的唯一方法就是复制pom文件中的"maven-antrun- plugin :“插件元素。但这给了我一个警告
'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration对于这个问题的范围,我并不是在寻找解决方案,比如改变“显示端口”或“等待启动”的插件,或者改变目标的阶段。
我只想知道我想做的事是否可能。
发布于 2021-05-12 10:11:46
如果多个执行都有相同的阶段,那么第一个要执行的执行将是内置的一个(例如maven-编译器-插件),它的id是默认的,那么其他的执行将按照它们在pom文件中出现的顺序进行。
https://stackoverflow.com/questions/50681112
复制相似问题