On Thu, Aug 18, 2011 at 10:40:23AM -0600, David Hoffer wrote: > I'm creating a plugin and having trouble getting the container > (plexus) to configure initial values. I've started with the > dependency plugin as a basis and see that somehow mojo parameters get > set with default values...I assume this is happening by the container > but what's the secret to making this work? I've added some new mojo
http://maven.apache.org/guides/plugin/guide-java-plugin-development.html You add a 'default-value="something"' to the @parameter annotation, and something (I'm not sure it's plexus, at least not directly) will evaluate the string value and attempt to convert it to something compatible with the type of the parameter field, if no value was configured externally. The bit that's not well documented is that you can pluck property values such as ${project.build.directory} out of the model by writing them in the default-value string. Apparently this is the proper way to discover model values and the like, though I've found nothing authoritative yet that actually says "do it this way". > parameters following the same convention and they are null at runtime > (running unit test). Is there some documentation on the > creating/wiring of plugin mojos to the container? Some. Not enough. When I figure out some of the missing stuff I will write some more. -- Mark H. Wood, Lead System Programmer mw...@iupui.edu Asking whether markets are efficient is like asking whether people are smart.
pgpfuDT2RpVxp.pgp
Description: PGP signature