[ http://jira.codehaus.org/browse/MNG-1421?page=comments#action_50027 ]
Vincent Massol commented on MNG-1421: ------------------------------------- Hi Fabrizio, This is already possible using either the maven-it-plugin (in the sandbbox) or using the Maven embedder in your test (see for example: http://svn.cargo.codehaus.org/cargo/trunk/samples/extensions/maven2/src/test/it/org/codehaus/cargo/samples/maven2/) > provide a way to test plugins without installing them > ----------------------------------------------------- > > Key: MNG-1421 > URL: http://jira.codehaus.org/browse/MNG-1421 > Project: Maven 2 > Type: Improvement > Components: maven-core > Versions: 2.0 > Reporter: fabrizio giustina > > > Sometimes unit tests for plugins can't be really affordable (other than > harder to write) when not using a "real" maven execution. Manually setting > needed properties in the Mojo and calling execute() is error prone, doesn't > test real parameters from pom.xml, and it's hard to deal wih multiprojects... > Maven should provide a way to test plugins without installing them and a base > class for testing. Ideally, plugins found on the classpath should always be > used instead of the currently installed version. (btw, that's how also the > Eclipse plugin environment work: when a plugin is found on the classpath, > it's loaded and the currently installed version is ignored). > A plugin test should be easy to write just like: > MavenTest maven = new MavenTest(); // load a new maven test instances, > plugins found in classpath override installed ones > maven.setBaseDir(basedir); > maven.setProfile(myprofile); > maven.execute("eclipse:eclipse") > At the moment this is really needed in the site plugin and eclipse plugin > (actually some tests are performed executing maven from command line) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
