As long as you have two ApiMetadata implementations **with different ids**, you can put both in the ServiceLoader file and jclouds will load them without problems, despite being in the same project.
I don't know how much code is common or changes, but we already have some common openstack code in a separate project [1], so it could be good to have the common glance code there too, and have one project per glance version, to allow users to include only the specific version dependency in their pom.xml. [1] https://github.com/jclouds/jclouds/tree/master/common El 21/01/2014 18:01, "Andrew Phillips" <[email protected]> escribió: > As the v1 and v2 contains a different metadata classes, is it possible to >> give support to both versions at the same time in a module? Is there any >> way of overriding the default value of the service file? Any suggestions >> here? >> > > Even though the ServiceLoader spec *does* allow multiple implementation > classes in a META-INF/services file (see [1]), I'm not sure the jclouds > code is written to handle that (although it never hurts to try ;-)). > > How hard would it be to make a "glance-common" module and then create two > providers, "glance-v1" and "glance-v2" (or something like that) which > simply configure the appropriate metadata correctly? > > That way, users could also choose to use one, or both of the versions > explicitly. > > ap > > [1] http://docs.oracle.com/javase/7/docs/api/java/util/ServiceLoader.html >
