从 org.apache.maven.archetype 执行中删除集成测试目标
Posted
技术标签:
【中文标题】从 org.apache.maven.archetype 执行中删除集成测试目标【英文标题】:Removing integration-test goal from org.apache.maven.archetype execution 【发布时间】:2020-11-12 14:54:48 【问题描述】:我正在尝试从其源代码构建 JBPM。我正在使用skipTests = true进行maven构建。我认为它失败了,因为 maven 原型插件在“集成测试”期间生成文件
[WARNING] Contents of file src\main\resources\rules.drl are not equal
[WARNING] Contents of file src\test\java\it\pkg\RuleTest.java are not equal
[WARNING] Contents of file src\test\resources\log4j.properties are not equal
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for KIE :: API Parent 7.39.0.Final-redhat-00007:
[INFO]
[INFO] KIE :: API Parent .................................. SUCCESS [ 8.784 s]
[INFO] KIE :: Public API .................................. SUCCESS [ 48.164 s]
[INFO] KIE :: Internal .................................... SUCCESS [ 34.910 s]
[INFO] KIE :: Maven Archetypes ............................ SUCCESS [ 0.175 s]
[INFO] KIE :: Drools Maven Archetype ...................... FAILURE [ 3.405 s]
[INFO] KIE :: Model Archetype ............................. SKIPPED
[INFO] KIE :: KJAR Archetype .............................. SKIPPED
[INFO] KIE :: Service Spring Boot Archetype ............... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:38 min
[INFO] Finished at: 2020-11-12T09:10:02-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:integration-test (default-integration-test) on project kie-drools-archetype:
[ERROR] Archetype IT 'integrationtestDefaults' failed: Some content are not equals
[ERROR] Archetype IT 'integrationtestWithCEP' failed: Some content are not equals
[ERROR] Archetype IT 'integrationtestWithEclipse' failed: Some content are not equals
但是,我不关心原型生成,因为我没有使用该工具构建的那部分(即,它将生成的文件已经由另一个工具构建)。如何删除此 maven 插件的“集成测试”错误或忽略目标? pom.file 没有明确提及任何目标,也没有明确执行任务(根据How do I run a maven plugin's integration tests?,这似乎是必需的)。这是 pom.xml(在标题之后):
<properties>
<dollar>$</dollar>
</properties>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<extensions>
<extension>
<groupId>org.apache.maven.archetype</groupId>
<artifactId>archetype-packaging</artifactId>
<version>2.2</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-archetype-plugin</artifactId>
<version>2.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
而父 pom.xml 简单地声明了这个模块。谢谢!
【问题讨论】:
【参考方案1】:简单的解决方案:
<properties>
<archetype.test.skip>true</archetype.test.skip>
</properties>
请注意,这种跳过不同于跳过测试或跳过集成测试(通常)。两者都有自己的配置。
【讨论】:
以上是关于从 org.apache.maven.archetype 执行中删除集成测试目标的主要内容,如果未能解决你的问题,请参考以下文章