On Aug 15, 2007, at 2:43 PM, Andreas Schaefer wrote:

Hi Jason

Thanks for that fast reply. Maybe I am using Maven1 too much to see why this has to be this way but I have to say that this something I don't like with the Mojos. Compared to Jelly plugins that is quite complicated and looks way too much like Ant.

On the other hand maybe the project website: http:// mojo.codehaus.org/groovy/guide-groovy-plugin-development.html which shows in the section for "Copying files" this:

def dir = "${project.build.directory}/backup"

ant.mkdir(dir: dir)

ant.copy(todir: dir) {
    fileset(dir: "${project.build.outputDirectoy}") {
        include(name: '**/*')
    }
}

which will not work either, does it?

You need to define a MavenProject field and then it will work, I'll update the docs to make that clearer to folks who are just getting started. So add an import:

    import org.apache.maven.project.MavenProject

And the define a field:

    /**
     * @parameter expression="${project}"
     * @required
     * @readonly
     */
    MavenProject project

And then the ${project. references will work as expected.

--jason

Reply via email to