No comments?  Is there another way to get specific 'testing' versions
of artifacts installed into the local repo before the install phase?

--jason


On 3/3/07, Jason Dillon <[EMAIL PROTECTED]> wrote:
Any comments on adding a 'forceVersion' param to the maven-install-
plugin, which will for all artifacts (including attached) to be
installed with the given version?

I'm thinking this would be really helpful for testing maven plugins,
so that in the pre-integration-test phase, one could use the m-
install-p to force all artifacts to be installed with a 'testing'
version, then in the 'integration-test' phase run the m-invoker-p to
execute a set of maven projects to test/validate the plugin works as
expected, and then once that passes, the normal m-install-p execution
will install the real versions of the artifacts into the repository.

This would allow the src/it/**/pom.xml files to use <version>testing</
version> for all of the plugin artifacts, and would prevent broken
artifacts (which don't pass tests) from making it into the local repo
cache (and thus available to other projects).

For example:

----8<----
     <build>
         <plugins>
           <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-install-plugin</artifactId>
                 <executions>
                     <execution>
                         <phase>pre-integration-test</phase>
                         <goals>
                             <goal>run</goal>
                         </goals>
                         <configuration>
                             <forceVersion>testing</forceVersion>
                         </configuration>
                     </execution>
                 </executions>
             </plugin>

             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-invoker-plugin</artifactId>
                 <executions>
                     <execution>
                         <phase>integration-test</phase>
                         <goals>
                             <goal>run</goal>
                         </goals>
                         <configuration>
                             <projectsDirectory>${pom.basedir}/src/
it</projectsDirectory>
                             <pomIncludes>
                                 <pomInclude>**/pom.xml</pomInclude>
<!-- all of these poms use <version>testing</version> -->
                             </pomIncludes>
                         </configuration>
                     </execution>
                 </executions>
             </plugin>
         </plugins>
     </build>
---->8----

I've been digging around trying to figure out how to test my
plugins... so far I have not found a single example that just works
out of the box... I've gotten the groovy-maven-plugin ( http://
svn.codehaus.org/mojo/trunk/mojo/mojo-sandbox/groovy-maven-plugin/ )
to work *almost* as I'd like... the only exception is that right now
I have to hard-code the version of the plugin being tested in each
src/it/**/pom.xml... which I would really like to avoid.

I've seen a few other plugins use the maven-plugin-management-
plugin... but I've no idea what it does... same thing with maven-plug-
it-plugin... both look like they might do something along the lines
to allow src/it/**/pom.xml to not need hardcoded plugin versions...
but I really can't tell.

Anyways... I think simply adding a 'forceVersion' to the maven-
install-plugin should solve this... and not introduce more plugins to
support/maintain.

--jason


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to