Build the index via `mvn exec:exec@build-index`
This patch configures an unbound execution (with `build-index` for id) to call the Loader. This is a better approach than the previous one of using profiles since this avoids the bad interaction when trying to do things like `mvn clean compile -Pindex` (which would fail the flatbuffers code generation).
- Id
- a812fc4f894cccd0e3315c11b19edeb064b99a73
- Author
- Caio
- Commit time
- 2019-02-10T00:00:49+01:00
Modified pom.xml
<goal>exec</goal>
</goals>
<phase>generate-sources</phase>
+ <configuration>
+ <executable>${project.build.directory}/bin/flatc</executable>
+ <workingDirectory>${flatbuffers.sources}</workingDirectory>
+ <arguments>
+ <argument>--java</argument>
+ <argument>-o</argument>
+ <argument>${flatbuffers.generated.sources}</argument>
+ <argument>recipe.fbs</argument>
+ </arguments>
+ </configuration>
+ </execution>
+ <execution>
+ <id>build-index</id>
+ <configuration>
+ <workingDirectory>${project.basedir}</workingDirectory>
+ <executable>java</executable>
+ <arguments>
+ <argument>-classpath</argument>
+ <classpath/>
+ <argument>-Xmx1024m</argument>
+ <argument>-Xms1024m</argument>
+ <argument>-Dlogback.configurationFile=src/test/resources/logback-test.xml</argument>
+ <argument>co.caio.cerberus.Loader</argument>
+ <argument>src/main/resources/cerberus.properties</argument>
+ <argument>tmp/document.jsonlines</argument>
+ </arguments>
+ </configuration>
</execution>
</executions>
- <configuration>
- <executable>${project.build.directory}/bin/flatc</executable>
- <workingDirectory>${flatbuffers.sources}</workingDirectory>
- <arguments>
- <argument>--java</argument>
- <argument>-o</argument>
- <argument>${flatbuffers.generated.sources}</argument>
- <argument>recipe.fbs</argument>
- </arguments>
- </configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<!-- flatbuffers end -->
</plugins>
</build>
-
- <profiles>
- <profile>
- <id>index</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.6.0</version>
- <configuration>
- <workingDirectory>${project.basedir}</workingDirectory>
- <executable>java</executable>
- <arguments>
- <argument>-classpath</argument>
- <classpath/>
- <argument>-Xmx1024m</argument>
- <argument>-Xms1024m</argument>
- <argument>-Dlogback.configurationFile=src/test/resources/logback-test.xml</argument>
- <argument>co.caio.cerberus.Loader</argument>
- <argument>src/main/resources/cerberus.properties</argument>
- <argument>tmp/document.jsonlines</argument>
- </arguments>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
</project>