0

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?

4

1 回答 1

0

原来答案就在我面前。无需在 IT 项目 pom.xml 中配置插件,只需指示maven-invoker-plugin执行它(删节):

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <configuration>
          <goals>
            <goal>package</goal>
            <goal>${project.groupId}:${project.artifactId}:${project.version}:inspect-changes</goal>
          </goals>
        </configuration>
      </plugin>
于 2013-07-25T17:19:36.533 回答