모듈을 올바르게 테스트하고 생성하기 위해 서브 모듈이있는 프로젝트를 얻으려고하고 있지만 문제가 있습니다. 다중 모듈 프로젝트를위한 Maven 리포팅 및 사이트 생성
나는 다음과 같은 프로젝트 구조를 가지고 :parent
|-test1
|-test2
및 parent
에 대한 pom.xml 파일은 다음과 같습니다
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>parent</groupId>
<artifactId>parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>test1</module>
<module>test2</module>
</modules>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.16</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.3</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<configuration>
<aggregate>true</aggregate>
<reportsDirectories>
<reportsDirectory>${basedir}/target/surefire-reports</reportsDirectory>
</reportsDirectories>
</configuration>
<reportSets>
<reportSet>
<inherited>false</inherited>
<reports>
<report>report-only</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
내가 프로젝트를 빌드 테스트를 실행하고 생성하는 mvn clean install site
를 사용 사이트 (maven 사이트 플러그인을 사용하고, maven surefire 리포트 플러그인을 사용하여 테스트 리포트를 생성 함).
이 문제는 부모의 pom.xml은 모든 단계와 실행입니다 (청소, 설치 및 사이트) 서브 모듈 '의 pom.xml 전에 실행된다, 따라서 test1
및 test2
로부터 시험 보고서는 parent
에 집계되지 않습니다.
한 줄에 mvn clean install site
을 실행하는 방법이 있습니까? 아니면 mvn clean install
을 먼저 실행하고 mvn site
을 실행해야합니까?
의견을 보내 주셔서 감사합니다.
이 문제에 대한 좋은 해결책 인 통합 자에 대한 의견을 보내 주셔서 감사합니다. 또한 "이전 파일이 있으므로 집계가 해당 파일에서 작동합니다"라고 정확하게 예측했습니다. :) – stackoverflower