-
Notifications
You must be signed in to change notification settings - Fork 625
Open Liberty naming guidelines
Within reason, this applies to everything. e.g.
- Java packages
- Project names
- OSGi Bundle names
- API/SPI jar names
- Feature names (long)
- Liberty Configuration PIDs
- System properties
- Maven artifact IDs
xxx is a short component name. It may be composed of multiple elements (xxx.yyy).
Ideally, xxx is the short name for the external feature, including its version. Project, bundle and jar names should include the that feature version but use a dot rather than a dash (example-1.0 -> example.1.0). A Java package name would normally omit the version as package versioning is done by other means.
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.
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 -
Open Liberty API project/bundle name =
io.openliberty.example.1.0- Maven Coordinates =
io.openliberty.api:io.openliberty.example:1.0.40(40 is the release minor version)
- Maven Coordinates =
-
Open Liberty SPI project/bundle name =
io.openliberty.example.1.0.spi- Maven Coordinates =
io.openliberty.spi:io.openliberty.example.spi:1.0.40(40 is the release minor version)
- Maven Coordinates =
-
Internal project/bundle name =
io.openliberty.example.1.0.internal -
Internal project/bundle name =
io.openliberty.example.1.0.internal.subname -
Internal common component project/bundle name =
io.openliberty.mycontainer.common.internal- The name of the common component is
mycontainer.common. It is used internally by multiple features.
- The name of the common component is
-
External Specification bundle =
io.openliberty.jakarta.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.
- Feature short name =
mpNewSpec-2.0 - Feature long name =
io.openliberty.mpNewSpec-2.0 - MicroProfile API project/bundle =
io.openliberty.org.eclipse.microprofile.newspec.2.0 - Internal implementation project/bundle =
io.openliberty.microprofile.newspec.2.0.internal - Third party library project/bundle =
io.openliberty.org.acme.widget
dev/io.openliberty.example.1.0/
src/io/openliberty/example/Example.java
dev/io.openliberty.example.1.0.spi/
src/io/openliberty/example/spi/ExampleSPI.java
dev/io.openliberty.example.1.0.internal/
src/io/openliberty/example/internal/ExampleImpl.java
test/io/openliberty/example/internal/test/ExampleTest.java
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