STAMP-project / dspot

Automatically detect and generate missing assertions for Junit test cases (also known as test amplification)
https://dspot-demo.stamp-project.eu/
GNU Lesser General Public License v3.0
114 stars 28 forks source link

Bug: Cannot find default setter for parameter project in class org.apache.maven.project.MavenProject #749

Closed danglotb closed 5 years ago

danglotb commented 5 years ago

dspot-maven-plugin has an issue with TAF.

see below:

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.github.claremontqualitymanagement.TestAutomationFramework:Core:jar:2.8.7
[WARNING] 'version' contains an expression but should be a constant. @ com.github.claremontqualitymanagement.TestAutomationFramework:Core:${capability.core.version}, /tmp/TestAutomationFramework/Core/pom.xml, line 13, column 14
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] --< com.github.claremontqualitymanagement.TestAutomationFramework:Core >--
[INFO] Building TAF - Core 2.8.7
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- dspot-maven:2.0.0:amplify-unit-tests (default-cli) @ Core ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.832 s
[INFO] Finished at: 2019-04-08T11:33:20+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal eu.stamp-project:dspot-maven:2.0.0:amplify-unit-tests (default-cli) on project Core: Unable to parse configuration of mojo eu.stamp-project:dspot-maven:2.0.0:amplify-unit-tests for parameter project: Cannot find default setter in class org.apache.maven.project.MavenProject -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginConfigurationException

Investigating.

danglotb commented 5 years ago

This is not a bug, but more a misuse.

This happens because there is in the pom:

<plugin>
    <groupId>eu.stamp-project</groupId>
    <artifactId>dspot-maven</artifactId>
    <version>2.0.0</version>
    <configuration>
        <project>C:\Users\kejsa\source\java\TestAutomationFramework_2.7.12</project>
    </configuration>
</plugin>

In particular, the configuration of the project, which is wrong.

Removing the dspot-maven plugin allows to run the following command:

mvn eu.stamp-project:dspot-maven:2.0.1-SNAPSHOT:amplify-unit-tests -Dverbose

@kejsardamberg if you have any question on how to configure the maven plugin, please open a new issue, or drop a pull request on the documentation or anything. Thank you.