1

Is it possible to have control on listed folders for Maven Project(target folder), If we don't want to generate it ?

Maven-Target Folder

One of it called "surefire-reports" is from "maven-surefire-plugin", Can we have configuration to control it ? If we don't want to generate those.

POM.XML :

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.0</version>
                <configuration>
                     <suiteXmlFiles> 
                         <suiteXmlFile>testng.xml</suiteXmlFile> 
                     </suiteXmlFiles>                       
                </configuration>
            </plugin>
        </plugins>
    </build>
Ishita Shah
  • 3,955
  • 2
  • 27
  • 51

1 Answers1

0

skipSurefireReport:

If set to true the surefire report generation will be skipped.

  1. Type: boolean

  2. Required: No

  3. User Property:skipSurefireReport

  4. Default: false

https://maven.apache.org/surefire/maven-surefire-report-plugin/report-mojo.html#skipSurefireReport.

skipSurefireTests:

Goal:

mvn clean verify -DskipTests=true

try with this code with goal as mentioned above

 <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <maven.compiler.source>1.8</maven.compiler.source>
            <maven.compiler.target>1.8</maven.compiler.target>
        </properties>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.0</version>
                    <configuration>
                   <skip.surefire.tests>${skipTests}</skip.surefire.tests>
                    </configuration>
                </plugin>
            </plugins>
        </build>

this code will skip the surefire tests.

Skip report generation using TestNG and sure-fire plugin

Prevent unit tests in maven but allow integration tests

RamanaMuttana
  • 481
  • 6
  • 22