Intellij jar runtime to compile time
#Intellij jar runtime to compile time code#
The library is marked as "optional" because you don't have to have Joda in order to use XStream.įor example, if you are using XStream to do XOM marshaling on XML that does not have dates/times, well then the code that uses Joda will never be reached. Joda is a date/time library that supports parsing date/times from strings and formatting strings from date/times, amongst other things. Let's pick the well-known one, Joda Time. These are libraries that XStream uses for lower-level XML stuff.īut what are all of these optional dependencies? Note that there are only two dependencies here that are not listed as optional, xmlpull and xpp3_min. If we check, these are the listed dependencies for XStream: Group What you find, especially when you deploy your OSGi bundles, is that you not only have your direct dependencies like the servlet spec jar or the XStream jar, but there are also indirect dependencies to deal with. Runtime dependencies are not as straight forward. That's really it you need a class from, say, the XStream XOM package, well then you declare your dependency on in it your adle file and your code compiles just fine.
Oh, you want to create a servlet filter? Fine, you just have a compile time dependency as expressed in a adle file like:ĬompileOnly group: "rvlet", name: "rvlet-api", version: "3.0.1"īasically a compile time dependency is a dependency needed by the compiler to compile your java files into class files. There are compile time dependencies and there are runtime dependencies.Ĭompile time dependencies are those direct dependencies that we developers are always familiar with. So here's the thing - dependencies come in two forms. īasically a developer was able to get Apache POI pulled into a module, but they did so by replicating all of the "optional" directives into the bnd.bnd file and eventually putting it into the bundle's manifest. Just a quick blog post to talk about compile time vs runtime dependencies in the OSGi container, inspired by this thread.