如何配置Maven在模块反应堆发生故障之前检出多个模块

时间:2019-03-23 20:51:16

标签: maven maven-3 maven-scm maven-module

由于无法找到pom,如何在模块列表失败之前将maven父pom配置为检出代码。

当scm用项目的pom签出项目时,看来maven对模块pom的反应堆测试发生在 generate-sources 阶段之前。

我该如何解决?

<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 个答案:

没有答案