-
Notifications
You must be signed in to change notification settings - Fork 229
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
Sql2o should not be dependend on jodatime #38
Comments
I'm not too familiar with maven, but does this just mean adding |
Hmm. Could it be that easy? |
So I just tried it out, and I think it works. After reading this article, it might make sense to approach a lot of things like flyway does. I don't know if you are familiar with flyway, but it's a database migration library that has a similar situation with optional dependencies on many different database implementations. Easiest way to handle it seems to be have optional dependencies, and check for existence at run time, which you are already doing with joda's DateTime in Convert.java. The article I linked above includes a useful utility for dealing with this:
|
Nice, this is definitely the way to go. I will assign you to this ticket, then I will try to do something similar with the slf4j dependency. I think we should cache the result of the isPresent method after it has run, I suspect it may have a performance issue if not. Something like this:
|
Ok great. Looks like this strategy will work for dealing with Convert.java, but it will not work with |
I have a suggestion: |
instead, it should use jodatime if available.
The text was updated successfully, but these errors were encountered: