On 2/14/2017 6:14 AM, Richard Eckart de Castilho wrote: > On 06.02.2017, at 21:39, Marshall Schor <[email protected]> wrote: >> now considering not using logback except via eclipse plugin dependency, to >> avoid >> license reciprocity issue. >> >> For normal binary packaging, would use slf4j + some backend, perhaps log4j 2. >> >> These would be "excluded" for the OSGi packaging. > UIMA as a library should not have dependencies on a particular logging > backend. I agree. It's not supposed to have any, but maybe I messed up. > > I guess when you talk about "normal binary packaging" you mean the binary > release > package that we do, right? Yes. > > So these instead of "excluding" a logging backend for OSGi, I think it would > rather > be "including" a logging backend only for OSGi and the binary packaging but > not > having it in any other way as a dependency in any POM (except maybe as a test > dependency). The Uima Logger is a facade that can be "switched" (just like slf4j - it predates slf4j) among multiple back ends (3: the built-into-Java logging framework, the log4j 2 framework, or a simple write to System out (not documented I think).
For the log4j 2 framework, I had to include a dependency for compiling on the log4j core. If you don't use the log4j back end, then this code is never called, and you don't need that jar in the runtime. The excluding was to have the Bundle build tool (which walks all your classes), not find these, while doing its work of building the runtime plugin manifest. The POM has logging dependencies for slf4j (which is a facade, no backend commitment), and these: - log4j-api - needed for the bridge code the UIMA logger implements to connect to this logger if it is specified as the back-end - log4j-core - needed for the bridge code too - slf4j-api the new facade - log4j-slf4j-impl - NOT NEEDED I can remove this dependency. I'm wondering about including it for convenience in the binary distribution package, so users, if they use slf4j, will have some back end available, without extra work. Opinions? -Marshall > > -- Richard
