[fedora-java] Naming of JavaEE-APIs (and 'Provides' in spec-file)

Chris Spike chris.spike at arcor.de
Tue Jul 20 15:45:13 UTC 2010


Hi folks,

We currently have some JavaEE-API packages on the way[1][2][3], and
there is a need for discussion. We already exchanged some arguments on
IRC (and some of us have some strong opinions :)), but eventually we
agreed, that the list is the proper place for this.

As you can see in bugzilla, the packages are named differently. One
approach is <api provider>-<api name> (like geronimo-jpa), another one
is <api provider>-<api name>-<api version>-api (like
geronimo-annotation-1.0-api). So the question is, how to do it.

The first thing you'll probably say is "Hey, version names don't belong
it the package name according to the naming guidelines". That's right.
But actually, annotation-1.0 has several different versions while
annotation-1.1 is a whole different animal. So the actual version of
annotation-1.0 would be 1.1.1 at the moment.[4]

Next argument was: "Well Fedora is bleeding edge, just do the lasted
version". Good point actually. But that is not always possible (maybe
impossible at all). Let's say, we just do the latest version of an api
and we would like to package ejb-3.1. ejb-3.1 explicitly requires
annotation-1.1 (great, the latest version there is) but also
interceptor-1.1 (damn, there is interceptor-3.0). The pom-file is very
specific about those version number and I wouln't bet on compatibility.

Some packages just rely on a certain API version (not package version)
and upstream does not always want to fix it. (i've seen asm ClassWriter
constructors with one boolean argument in one api version, and one int
argument in another. The upstream project just use the int-version,
explicitly demanded the corresponding API and said, there no necessity
to fix). So the "ship only lastest"-approach probably won't work here.

If you do a package that requires a certain version of an api, you have
to check the version. To do this with the <api provider>-<api name>,
every api package has to 'Provide: <api name> = spec_version'. This is a
bad idea, because it doesn't provide <api name> at all. It just provides
the interfaces (no implementation), and if someone comes along and does
a package that actually implements the interface, this could lead to
real trouble.
With the <api provider>-<api name>-<api version>-api approach, every api
would do a 'Provides: <api name>_<api version>_api = package version' .
You could just check for a certain api version and even for a package
version if you like. No troubles, if someone actually implements it.
(Actually tomcat does it like this)

It may be a good idead to look at the JPackage guys and how they did it.
Some of the Jpackage geronimo-spec (co-)maintainers should be on this
list (and probably some other JPackage guys, too) and maybe they can
tell us why they did it like they did it (or why we shouldn't do is like
they did at all :))


Regards, Chris



[1] https://bugzilla.redhat.com/show_bug.cgi?id=616354
[2] https://bugzilla.redhat.com/show_bug.cgi?id=615812
[3] https://bugzilla.redhat.com/show_bug.cgi?id=615809
[4] http://svn.apache.org/repos/asf/geronimo/specs/tags/


More information about the java-devel mailing list