I'm currently writing a Maven plugin with automates releasing of modules by
- detecting if a module has changes which should be released
- releasing all modules using the
maven-release-plugin
- adjusting dependencies in all affected projects
I'm trying to test it using the maven-invoker-plugin
, which uses the following setup in the integration-test poms:
<build>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<executions>
<execution>
<id>my-id</id>
<phase>generate-sources</phase>
<goals>
<goal>my-goal</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
The roadblock I'm hitting is that the maven-dependency-plugin
forbids this release since I reference a SNAPSHOT plugin in my pom.xml ( the @project.version@
above ). Fair enough.
I discovered that this check is made in CheckDependencySnapshotsPhase , which is a plexus component:
@plexus.component role="org.apache.maven.shared.release.phase.ReleasePhase" role-hint="check-dependency-snapshots"
Can I somehow override this component and plug in my own? Alternatively, how can I run this integration test without being blocked by the 'no snapshot depenendencies' check?