Closed cruftex closed 6 years ago
The README tells exactly what you have to do.
@vladmihalcea please reconsider this. That is a bad OOTB experience.
Where is it written in the README that I need to register with Oracle to run the tests against PostgreSQL?!
BTW, the README says exactly:
The Unit Tests are run against HSQLDB, so no preliminary set-ups are required.
How should I do this?
Just comment the Oracle repository if you don't want to set it up. The tests compile even without the Oracle JDBC Driver.
Sure, that's what I did. However, a lot of other people will have the same experience and need to do the same.
If you like, I can do a PR with a suggestion how to solve this with a Maven profile.
To run the tests with Oracle one would need to do mvn -Poracle test
then.
In IntelliJ you can enable the profiles in the Maven tool window.
I did something similar here: https://github.com/cruftex/jsr107-test-zoo/blob/master/pom.xml
If you don't like the idea, that's okay too.
The project is really nice!
Ultimately I would recommend working towards something like:
# run the tests with embedded SQL:
mvn test
# run the integration tests with Oracle:
mvn -Poracle verify
# run the integration tests with MySQL:
mvn -Pmysql verify
# run integration tests for performance on PostgreSQL:
mvn -Pperformance,postgresql verify
I'll use a profile activated by an environment variable.
Fixed. The Oracle repo must now be activated explicitly.
@vladmihalcea please mind that you need to move the JDBC driver dependency into the profile as well.
The driver scope is provided so it won't be required during compile. So, it should be just fine.
Scope provided
means that it is not packaged, since present at the target environment.
It's used for compiling.
If you don't want it in the compile
scope, then the scope runtime
is the correct one.
However, runtime
would be present during running the tests.
You're right. Unfortunately, Maven does not have a test-runtime
scope, so only moving the dependency to the oracle
profile does the trick. I pushed a new change to do that. Thanks for the tip.
When I do
There is the error:
When removing the Oracle dependency compilation works.
Probably the Oracle JDBC cannot be obtained from Maven central. One solution would be to put the Oracle dependency in a separate Maven profile.