Search code examples
seleniummavenintellij-ideacucumber

How to resolve Inteliji Maven Configuration error for cucumberOutput?


There is an error in pom.xml with Inteliji, same pom.xml is working fine in Eclipse ,

           <plugin>
                <groupId>net.masterthought</groupId>
                <artifactId>maven-cucumber-reporting</artifactId>
                <version>5.6.0</version>
                <executions>
                    <execution>
                        <id>execution</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <projectName>Automation</projectName>
                            <outputDirectory>${project.build.directory}/cucumber-report-html</outputDirectory>
                            <cucumberOutput>${project.build.directory}cucumber/cucumber.json</cucumberOutput>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Error is at <cucumberOutput>${project.build.directory}cucumber/cucumber.json</cucumberOutput>

Error message :

Element cucumberOutput is not allowed here


Solution

  • Version 5.6.0 no longer uses the <cucumberOutput> tag for the configuration.

    It has been replaced with:

    <inputDirectory>${project.build.directory}</inputDirectory> <!-- this is where the cucumber.json files is saved -->
    <jsonFiles>
       <param>cucumber.json</param> <!-- the name/regex of the cucumber report json file -->
    </jsonFiles>
    

    Here is an example of my configuration:

    <plugin>
       <groupId>net.masterthought</groupId>
       <artifactId>maven-cucumber-reporting</artifactId>
       <version>5.6.0</version>
       <executions>
          <execution>
              <id>execution</id>
              <phase>verify</phase>
              <goals>
                 <goal>generate</goal>
              </goals>
              <configuration>
                 <projectName>App-Under-Test</projectName>
                 <outputDirectory>${project.build.directory}</outputDirectory>
                 <inputDirectory>${project.build.directory}</inputDirectory>
                 <jsonFiles>
                    <param>cucumber-*.json</param>
                 </jsonFiles>
                 <mergeFeaturesById>false</mergeFeaturesById>
                 <mergeFeaturesWithRetest>false</mergeFeaturesWithRetest>
                 <checkBuildResult>false</checkBuildResult>
                 <buildNumber>1</buildNumber>
              </configuration>
          </execution>
       </executions>
    </plugin>