I am working with an eclipse product where we use a combination of a maven/tycho build system and OSGI: Equinox to build our product. I was wondering if there was a dedicated p2 repository for the flyway-core jar file?
1 Answers
There isn't.
But you can add it as a pom dependency in an eclipse-repository project or a deployable feature project. Both of these project types build P2 repositories. You can then add that repository to your target platform.
I wrote a more general answer to the question of using third-party bundles with Tycho here.
Incidentally, I found that flyway-core 2.0.3 doesn't work very well in an OSGi container, and specifically Eclipse. For example, it uses the TCCL (thread context class loader) for finding both your migrations and its internal scripts. I couldn't find a way to get it to work without creating a URLClassLoader configured with the URL of my bundle with the migrations, and the URL of the flyway-core bundle. Logging is also difficult to configure in a robust way that can't affect other OSGi bundles, because of the use of commons-logging.
My impression is that flyway is more effort than it's worth in an OSGi environment right now. I've seen these issues reported on the Google Code project. It looks like the class-loading issue might get fixed, but logging isn't accepted as a problem.

- 1
- 1

- 9,603
- 42
- 53
-
the commons-logging dependency is now optional in the OSGI manifest (was erroneously still marked as required in 2.0.3 even though the code doesn't need it) – Axel Fontaine Feb 11 '13 at 17:19
-
I guess that helps. But if that's all that's changed, it's still likely to be difficult to configure logging to do something useful in an Eclipse plugin. That is, even if the manifest declares it as optional, Eclipse will still decide it can provide it, so the behaviour is the same. – Martin Ellis Feb 11 '13 at 17:33
-
Yeah, I was having some difficulties even getting the flyway plugin to even work in some sample code for my project. I will mark this as an answer for now, sorry for the delay. – user2062037 Apr 03 '13 at 12:37