joelittlejohn / embedmongo-maven-plugin

Maven plugin wrapper for the flapdoodle.de embedded MongoDB API
Apache License 2.0
88 stars 51 forks source link

Configuration parameters are ignored #4

Closed lure closed 12 years ago

lure commented 12 years ago

On 0.1.1. Nor version nor databaseDirectory doesn't work falling to default values. Most recent 0.1.2 is not available on maven.

joelittlejohn commented 12 years ago

Ah, thank you Alex.

I had forgotten to close my staging repo at oss.sonatype.org. This has now been released and will show up in maven central within 4hrs.

joelittlejohn commented 12 years ago

Could you explain more about how the parameters you have tried do not work?

I've tried using version and databaseDirectory (both with a value supplied and with defaults) and they both function correctly for me on 0.1.1.

Note: in embedmongo-maven-plugin:0.1.1 the default mongo version is 2.1.1 in embedmongo-maven-plugin:0.1.2 the default mongo version is 2.0.5

I switched to the stable release (2.0.x) as this seemed a better default.

lure commented 12 years ago

win platform for databaseDirectory set to tmp/mongotest database is created in c:\Users\lure\AppData\Local\Temp\mongo6662E4E6-CF94-44DD-9B26-061B1AB7378A This long name as I know is provided by OS function GetTempPath

Version set to 2.0.6 is ignored and 2.1.1 is started.

joelittlejohn commented 12 years ago

Alex, could you paste the section of your pom that invokes the plugin here? Thanks

lure commented 12 years ago
<plugin>
    <groupId>com.github.joelittlejohn.embedmongo</groupId>
    <artifactId>embedmongo-maven-plugin</artifactId>
    <version>0.1.1</version>
    <executions>
        <execution>
            <id>start</id>
            <goals>
                <goal>start</goal>
            </goals>
            <configuration>
                <version>2.0.6</version>
                <databaseDirectory>tmp/mongotest</databaseDirectory>  
            </configuration>
        </execution>
        <execution>
            <id>stop</id>
            <goals>
                <goal>stop</goal>
            </goals>
        </execution>
    </executions>
</plugin>
joelittlejohn commented 12 years ago

Alex, do you have a duplicate configuration in your pom? (another config for this plugin somewhere else?) I think you may be overriding what you've pasted here elsewhere in your pom.

2.0.6 is not supported in v0.1.1 of the plugin. When I use the above I see this error:

Unrecognised MongoDB version: '2.0.6', try one of the following:
[V1_6_5, V1_7_6, V1_8_0_rc0, V1_8_0, V1_8_1, V1_8_2_rc0, V1_8_2, V1_8_4, V1_8_5, V1_9_0, V2_0_1, V2_0_4, V2_1_0, V2_1_1, V1_6, V1_8, V2_0, V2_1]
lure commented 12 years ago

No. Doublechecked.

output] Fri Jul 13 18:35:23 [initandlisten] MongoDB starting : pid=5088 port=27017 dbpath=C:\Users\user\AppData\Local\Temp\embedmongo-db-0e4bf095-7a0c-424f-91da-7be2327bdc5f 64-bit host=kthp
[mongod output] Fri Jul 13 18:35:23 [initandlisten] 
[mongod output] Fri Jul 13 18:35:23 [initandlisten] ** NOTE: This is a development version (2.1.1) of MongoDB.
[mongod output] Fri Jul 13 18:35:23 [initandlisten] **       Not recommended for production.
[mongod output] Fri Jul 13 18:35:23 [initandlisten] 
[mongod output] Fri Jul 13 18:35:23 [initandlisten] db version v2.1.1, pdfile version 4.5
[mongod output] Fri Jul 13 18:35:23 [initandlisten] git version: 6c1c98b332a4ebe2604462ccbf9f1af475734460
[mongod output] Fri Jul 13 18:35:23 [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB_VERSION=1_49
[mongod output] Fri Jul 13 18:35:23 [initandlisten] options: { dbpath: "C:\Users\user\AppData\Local\Temp\embedmongo-db-0e4bf095-7a0c-424f-91da-7be2327bdc5f", noauth: true, nohttpinterface: true, nojournal: true, noprealloc: true, port: 27017, smallfiles: true, verbose: true }
[mongod output] Fri Jul 13 18:35:24 [initandlisten] opening db:  local

and pom:

           <plugin>
                <groupId>com.github.joelittlejohn.embedmongo</groupId>
                <artifactId>embedmongo-maven-plugin</artifactId>
                <version>0.1.2</version>
                <executions>
                    <execution>
                        <id>start</id>
                        <goals>
                            <goal>start</goal>
                        </goals>
                        <configuration>
                            <version>2.0.6</version>
                            <databaseDirectory>/tmp/mongotest</databaseDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>stop</id>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
joelittlejohn commented 12 years ago

Could you send me your entire pom? Feel free to email it to me if you don't want to post it here:

joelittlejohn@gmail.com

joelittlejohn commented 12 years ago

Alex. I've just used your pom.xml (I had to add a minimal web.xml to get the project to build), run mvn clean verify and I get the output I expect:

Maven 2: http://pastebin.com/raw.php?i=M7TLgp4D

Maven 3: http://pastebin.com/raw.php?i=hvQvfeAq

The build fails because 2.0.6 is not a recognised version. I notice that your pom includes the following dependency:

    <dependency>
        <groupId>de.flapdoodle.embedmongo</groupId>
        <artifactId>de.flapdoodle.embedmongo</artifactId>
        <version>1.16</version>
    </dependency>

Could you explain how you're using this dependency in your own code? Are you starting an instance of MongoDB yourself?

lure commented 12 years ago

Send you e-mail. Btw, thanks for a nice plugin. It's come really handy for me.