embedmongo-maven-plugin
embedmongo-maven-plugin copied to clipboard
Ease of use mongo-import goal
In https://github.com/joelittlejohn/embedmongo-maven-plugin/issues/48 an easier way to import collections has been implemented, but I also think that being able to point to a "directory" instead of a single file(or list, whatever) would definetly increase the ease of use of this goal
<execution>
<id>mongo-import</id>
<phase>process-test-resources</phase>
<goals>
<goal>mongo-import</goal>
</goals>
<configuration>
<imports>
<import>
<database>${mongodb.database.name}</database>
<file>${basedir}/src/test/resources/mongodata</file>
</import>
</imports>
</configuration>
</execution>
In mongodata I have a few dozen of json files which are created by following the convention described in issue https://github.com/joelittlejohn/embedmongo-maven-plugin/issues/48.
Sounds good to me. I don't think we need to search directories recursively (this can introduce new edge-cases and issues) but definitely iterating every file in a given directory would be good.
Happy to accept a pull request for this if you have the time.
Ah, I just saw your pull request! :smiley: