Jörg Schaible wrote: >> >>> But how would it be possible to say that the samples block depends on >>> any implementation which implements a certain API, like the roles >>> are used in Cocoon today? For example, my-block-samples-block needs >>> an XSL:FO processor but does not depend on a concrete implementation >>> (e.g. Xalan). >>> >> >> I don't think maven allows this at the moment. It's a valid usecase >> though. > > You can define the dependency as optional (although this is partly still > buggy). >
Good point! I forgot all about this property. .... I asked around on #maven about this. The general opinion there is that if you have a project that can use multiple implementations of a library, you should split up the project and make multiple poms for this. Idea is that all optional libraries need to be redeclared by the user using the pom they are declared in, not very user friendly. So in effect this could be realized in the scheme ./api pom.xml ./implBase pom.xml ./implA pom.xml ./implB pom.xml Both implA and implB include implBase as dependency and additionally declare the implementation for the optional libraries. That way our users would only need to point to implA or implB and can do so without pom editing. Regards Jorg
