Skip to content

Open Liberty naming guidelines

Tom Evans edited this page May 22, 2020 · 43 revisions

ALL NEW Open Liberty artifacts MUST follow the same naming conventions

API - io.openliberty.xxx

SPI - io.openliberty.xxx.spi

Internal - io.openliberty.xxx.internal


Within reason, this applies to everything. e.g.

  • Java packages
  • Project names
  • OSGi Bundle names
  • API/SPI jar names
  • Feature names (long)

xxx is the short name for the external feature. When used within a package name, it would not normally include a version number (package versioning is done by other means). Project, bundle, jar and feature names should include the version.

These guidelines are most important for user visible elements such as API/SPI Java Packages and Jars. There is flexibility when it comes to internals but it is important to maintain consistency. It is difficult to cover all the possible variations but here some examples.

Examples

A brand new Open Liberty feature called example-1.0 would have the following;

  • Short Feature name = example-1.0

  • Long Feature name = io.openliberty.example-1.0

  • API Java package = io.openliberty.example

  • SPI Java package = io.openliberty.example.spi

  • Internal Java package = io.openliberty.example.internal

  • API project/bundle name = io.openliberty.example-1.0

  • SPI project/bundle name = io.openliberty.example-1.0.spi

  • Internal project/bundle name = io.openliberty.example-1.0.internal

  • Internal project/bundle name = io.openliberty.example-1.0.internal.subname

  • External Specification bundle = io.openliberty.org.eclipse.microprofile.newspec-2.0

  • Third party library bundle = io.openliberty.org.acme.widget

Note that the third party library bundle does not have a version in the name. Doing so makes it harder to upgrade the version later on.

An example project for an API bundle & jar might look like this;

dev/io.openliberty.example-1.0/
   src/io/openliberty/example/Example.java

An example SPI;

dev/io.openliberty.example-1.0.spi/
   src/io/openliberty/example/spi/ExampleSPI.java

An implementation bundle;

dev/io.openliberty.example-1.0.internal/
   src/io/openliberty/example/internal/ExampleImpl.java
   test/io/openliberty/example/internal/test/ExampleTest.java

Another implementation bundle;

dev/io.openliberty.example-1.0.internal.subname/
   src/io/openliberty/example/internal/subname/ExampleImpl.java
   test/io/openliberty/example/internal/subname/test/ExampleTest.java
Clone this wiki locally