Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoDB + Skip by dialect #75

Closed
wants to merge 18 commits into from
Closed

Conversation

Sanne
Copy link
Member

@Sanne Sanne commented Apr 24, 2012

This can be merged into master to include MongoDB in it.

If you don't like the idea yet, please merge it in mongodb

After merging we'll have to let know people using it that the default build does not build (nor test) the mongodb dialect, but the Maven profile mongodb needs to be activated, for example:

mvn clean install -Pmongodb

@Sanne
Copy link
Member Author

Sanne commented Apr 26, 2012

@emmanuelbernard I've added a commit to resolve for https://hibernate.onjira.com/browse/OGM-166

I couldn't find any way to "hardcode" the different hostname in your profile: the project pom always has precedence.
Of course environment and parameters have precedence on the project pom, so it should work fine for you by using

build clean install -Dmongodb.hostname=yourvm

This seems to work fine for Eclipse as well, and I guess IDEA too as it's the same pattern we use in Search to inject the H2 connection properties.

P.S. you'll have to set the environment property in the IDE as well

@emmanuelbernard
Copy link
Member

:(
Thinking again at the release plugin, I am not sure -D will work as the release plugin does fork to run some of the steps.
Do we have to put these default propertiles in the pom itself? The default values are already in our codebase. And if these are not set in the pom, maybe the setting.xml could be used.

@Sanne
Copy link
Member Author

Sanne commented Apr 26, 2012

After a long fight with Maven about properties I'm tempted to propose this new approach, imho cleaner:

  • no need to change your settings.xml
  • define an environment property: MONGODB_PORT
  • and MONGODB_HOSTNAME

The mongo module will kick in just by having these env settings in your environment. Make sure you IDE has the same environment to be able to launch unit tests.

I had to read the env directly from our code as with Maven there was no way to have both the build and the IDE working; I'm copying them to system properties and let the Hibernate configuration read them from there.
(We can't have them read env properties directly as it's illegal to define environment properties with dots)

See 2a9a9ea , which replaces the previous commit in the pull.

@emmanuelbernard
Copy link
Member

I am closing this pull request as it is superseded by #77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants