java - What is the best way to obtain a list of site resources when writing a Maven2 site plugin? -
when creating plugin executes in default life-cycle, it's easy obtain reference project , resources, i'm getting null instead of mavenproject object when creating plugins execute in site life-cycle.
any hints, tips or suggestions?
it turns out problem having related declaration of project parameter being passed mojo. since there's 1 instance of mavenproject within maven build, can't specify expression (and there's no java string can cast mavenproject object) parameter , default value has "${project}".
so access mavenproject within maven plugin mojo, phase, use following parameter declaration:
/** * project instance, used add new source directory build. * * @parameter expression="export.project" default-value="${project}" * @required * @readonly */ private mavenproject project;
Comments
Post a Comment