I am trying to get work this Maven by Example, using Eclipse + m2Eclipse plugin. However, I got this error
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project simple-weather: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java are missing or invalid
But I did specify mainClass in this way (screenshot below) with mainClass specified in the Profiles lines. Any idea why I still got wrong? Many thanks.
As the error message says, you are missing the parameter mainClass
.
You have put the parameters in the Profiles
part which is the wrong place.
Press the Add...
button and add the parameter and value in the box like this:
It should look like this when you press Ok
: