How to configure maven to checkout multiple modules before module reactor fails

306 Views Asked by At

How should I configure maven parent pom to checkout code before Module list fails because the pom cannot be found.

It seems the maven's reactor test for a module's pom occurs before the generate-sources phase when scm checkouts the projects with the projects' pom.

How can I fix this ?

<modules>
  <module>target/mod-1</module>
  <module>target/mod-2</module>
</modules>

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-scm-plugin</artifactId>
      <version>1.9.4</version>
      <executions>
        <execution>
          <id>mod-1</id>
          <phase>generate-sources</phase>
          <configuration>
            <connectionUrl>${mod-1.url}</connectionUrl>
            <scmVersionType>${mod-1.versionType}</scmVersionType>
            <scmVersion>${mod-1.version}</scmVersion>
            <checkoutDirectory>${mod-1.directory}</checkoutDirectory>
          </configuration>
          <goals>
            <goal>checkout</goal>
          </goals>
        </execution>
        <execution>
          <id>mod-2</id>
          <phase>generate-sources</phase>
          <configuration>
            <connectionUrl>${mod-2.url}</connectionUrl>
            <scmVersionType>${mod-2.versionType}</scmVersionType>
            <scmVersion>${mod-2.version}</scmVersion>
            <checkoutDirectory>${mod-2.directory}</checkoutDirectory>
          </configuration>
          <goals>
            <goal>checkout</goal>
          </goals>
        </execution>
      </executions>

.....

</build>
0

There are 0 best solutions below