> -----Original Message----- > From: Brett Porter [mailto:[EMAIL PROTECTED] > Sent: dimanche 17 avril 2005 15:33 > To: Maven Developers List > Subject: Re: [M2] Testing a m2 plugin > > Vincent Massol wrote: > > >I think a verifier plugin that simply verifies existence/nonexistence of > >files/dir and their contents would be a good first step. > > > >It could be configured with: > > > ><configuration> > > <files> > > <file> > > <location>${basedir}/target/clover/clover.db</location> > > <contains>[enter a regexp here - This is optional]</contains> > > <test>exist (default)|notfound</test> > > </file> > > <file>[...] > > </files> > ></configuration> > > > > > Also requires the hooks to remove the files beforehand. But sounds good
Yes, I still don't understand how you do this in m2... Is this goal aliasing? > - do you think it is too verbose for configuration? Maybe better to > externalise it in files and use the configuration to point to that. I was going to say that my preference goes to pom.xml but then you're completely right: It's a test and it should go elsewhere. Something like: <project>/ |_ src/ |_ test/ |_ java/ |_ [...] |_ verifier|filechecker/ |_ some config file here. Could be java, XML, properties, etc. My preference goes to XML. > Will you be able to implement this? I hadn't seen it being ready for > alpha-2, though perhaps if it is required for proper mojo testing it > should be. I could give it a try. I'd rather name is something like "filechecker" rather than verifier which is too generic. > Ideally, the verifier could be converted to a mojo and used in both the > bootstrap and the m2 integration test phase for plugins. I'm not too familiar with the existing code. > >Could you please tell me where I can find the list of the existing > lifecycle > >phases? > > > maven-core/src/main/resources/META-INF/plexus/components.xml (there > should be an older version of a doc in src/site/apt as well). Ok cool, found it. Ok, so this where the default bindings are. So the different build types from my previous email could actually be different configurations of org.apache.maven.lifecycle.DefaultLifecycleExecutor. I guess there's currently no way for a user to define a custom lifecycle, right? Maybe goal aliasing could be combined with this to give something like: <lifecycles> <lifecycle> <id>customelifecycle1</id> <default>true</default> <phases> [...] <phase> <id>process-resources</id> <goals> <goal>mycustomresources:resources</goal> </goals> </phase> [...] </phases> </lifecycle> </lifecycles> And it would be called with "m2 -l customlifecycle1 install" (or simply "m2 install" because it's configured to be the default lifecycle). Of course in most cases you wouldn't need to define custom lifecycles... Hmm... this sounds a bit too complex... However you do need a way to tell the build how you would want the different phases to be bound to, no? Maybe the m1 model is actually the simplest (where there are no phases and the user decides on the ordering of the goals)? > > >This verifier plugin could be bound to a terminal phase. > > > > > There is meant to be an integration testing phase between package and > install, which is what you are looking for. Yep. This integration testing phase would be required for this verifier|filechecker plugin to work. Thanks -Vincent ___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]