I am trying to build my first groovy project with maven but I am getting the following error from maven.. its somettype of source error but Idont understand why I am getting it.
Your 1st clue is the error: No such property: project for class: org.jsmith.Example
Apologies for restating your error as your answer but let me explain. It's saying that somewhere in your source you have a reference to a variable project
. (possible in source you haven't posted or possibly in the source before you inadvertnly changed it and before you posted??)
I imagine you probably had a typo in the package name or some extra test code after your class definition? For Eg. something like this could generate such an error:
package org.smith
/**
* Example Groovy class.
*/
class Example
{
def show() {
println 'Hello World'
}
}
println project.path
Again, you should post both the updated code at the time of the error and the exact error matching the code. It's hard to determine based on what you have above where your problems lie.
You will have to define project and bind to mavenProject if you are using script rather than inline.
def project = ${project}; // this will bind to the Maven Project property.
likewise
def session = ${session} //will bind to MavenSession
Source - Look for custom properties