Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Development Resources/HOWTO/The Eclipse Code Namespace Policy"

(Java Package Names)
m
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
Eclipse projects must carefully manage their namespaces in order to help identify the producer of components and avoid namespace collisions.
 
Eclipse projects must carefully manage their namespaces in order to help identify the producer of components and avoid namespace collisions.
  
Exceptions to these rules must be approved by the Project Management Committee and the EMO(ED).
+
Some of the content here is presented in the form of guidelines ("should"), and some in the form of rules ("must"). In general, it's about being a good citizen and playing well with others. We believe/hope that exceptions to the rules are rare; exceptions to rules must be approved by the Project Management Committee and the EMO.
  
=Java Package Names=
+
=Languages=
Java package names take the following form:
+
==Java Package Names==
 +
 
 +
Java package naming conventions are well-established and so Java package names '''must''' take the standard [http://en.wikipedia.org/wiki/Reverse-DNS reverse DNS] form:
 
  org.<forge>.<shortname>.<component>.*
 
  org.<forge>.<shortname>.<component>.*
 
Where:
 
Where:
* ''forge'' is the short name of the hosting forge, e.g. "eclipse", "locationtech", or "polarsys";
+
* ''forge'' is the short name of the hosting [[Forges|forge]], e.g. "eclipse", "locationtech", or "polarsys";
 
* ''shortname'' is the short name of the project (i.e. the last segment of the project id), e.g. "dali", "egit", "udig"; and
 
* ''shortname'' is the short name of the project (i.e. the last segment of the project id), e.g. "dali", "egit", "udig"; and
 
* ''component'' is project-specific
 
* ''component'' is project-specific
Line 14: Line 16:
  
 
Examples:
 
Examples:
* <code>org.eclipse.emf.core</code>, <code>org.eclipse.emf.edit</code>, <code>org.eclipse.emf.edit.ui</code>;
+
* <code>org.eclipse.emf.core</code>, <code>org.eclipse.emf.edit</code>, <code>org.eclipse.emf.edit.ui</code>; and
 
* <code>org.locationtech.udig.resources</code>
 
* <code>org.locationtech.udig.resources</code>
  
Line 20: Line 22:
 
* e.g. <code>org.eclipse.graphiti.core</code>, not <strike><code>org.eclipse.modeling.mdt.graphiti.core</code></strike> or <strike><code>org.eclipse.mdt.graphiti.core</code></strike>.
 
* e.g. <code>org.eclipse.graphiti.core</code>, not <strike><code>org.eclipse.modeling.mdt.graphiti.core</code></strike> or <strike><code>org.eclipse.mdt.graphiti.core</code></strike>.
  
=OSGi Bundle Names=
+
==Scala Package Names==
 +
 
 +
TBD
 +
 
 +
=Packaging/Distribution=
 +
==Features==
 +
 
 +
The feature name should be descriptive of the feature. There is no need to include the project name in the feature name. Think of a descriptive name that is useful to the end user/consumer.
 +
 
 +
The provider name should be the full project name. If the name does not already do so, then prefix it with the name of the forge, e.g. "Eclipse EGit", "Eclipse SWTBot", or "LocationTech uDig".
 +
 
 +
==OSGi Bundle Names==
 +
 
 +
OSGi Bundle names '''must''' follow the same rules as [[#Java Package Names|Java Package Names]].
 +
 
 +
The Bundle-Vendor should be the full project name. If the name does not already do so, then prefix it with the name of the forge, e.g. "Eclipse EGit", "Eclipse SWTBot", or "LocationTech uDig".
 +
 
 +
==Maven Repositories==
 +
{{Warning|This is a work in progress.}}
 +
These guidelines/rules apply primarily for Eclipse Foundation-hosted Maven repositories. We believe that it is in the best interests of the broader community to consistently apply these guidelines/rules outside of that scope as well.
 +
 
 +
===Maven Group Ids===
 +
Per [http://maven.apache.org/guides/mini/guide-naming-conventions.html Maven naming conventions], the Maven group id '''must''' follow the standard reverse DNS naming convention:
 +
org.<forge>.<short-name>
 +
Use of more specific group ids is also possible:
 +
org.<forge>.<short-name>.<component>.*
 +
Where:
 +
* ''forge'' is the short name of the hosting [[Forges|forge]], e.g. "eclipse", "locationtech", or "polarsys";
 +
* ''short-name'' is the short name of the project (the name used in IPZilla, and the in project information pages]
 +
* ''component'' is project-specific
 +
Examples:
 +
* <code>org.eclipse.egit</code>, <code>org.eclipse.birt</code>
 +
* <code>org.locationtech.udig</code>, <code>org.locationtech.geomesa</code>
 +
* <code>org.polarsys.reqcycle</code>, <code>org.polarsys.cotsaq</code>
 +
 
 +
For discussion, please see [https://bugs.locationtech.org/bugs/show_bug.cgi?id=28].
 +
 
 +
===Maven Artifacts===
 +
 
 +
===Maven Versions===
 +
 
 +
==Java Archive (JAR/WAR/EAR) Names==
 +
 
 +
TBD
  
OSGi Bundle names follow the same rules as [[#Java Package Names|Java Package Names]].
+
<hr/>
 +
''This page is moderated by the EMO.''

Revision as of 05:28, 12 April 2017

Eclipse projects must carefully manage their namespaces in order to help identify the producer of components and avoid namespace collisions.

Some of the content here is presented in the form of guidelines ("should"), and some in the form of rules ("must"). In general, it's about being a good citizen and playing well with others. We believe/hope that exceptions to the rules are rare; exceptions to rules must be approved by the Project Management Committee and the EMO.

Languages

Java Package Names

Java package naming conventions are well-established and so Java package names must take the standard reverse DNS form:

org.<forge>.<shortname>.<component>.*

Where:

  • forge is the short name of the hosting forge, e.g. "eclipse", "locationtech", or "polarsys";
  • shortname is the short name of the project (i.e. the last segment of the project id), e.g. "dali", "egit", "udig"; and
  • component is project-specific

Multiple component segments are permitted.

Examples:

  • org.eclipse.emf.core, org.eclipse.emf.edit, org.eclipse.emf.edit.ui; and
  • org.locationtech.udig.resources

Java package names use the "flat" or "short" project name in the third segment; they should not include, for example, the name of the top-level project or any parent/container project.

  • e.g. org.eclipse.graphiti.core, not org.eclipse.modeling.mdt.graphiti.core or org.eclipse.mdt.graphiti.core.

Scala Package Names

TBD

Packaging/Distribution

Features

The feature name should be descriptive of the feature. There is no need to include the project name in the feature name. Think of a descriptive name that is useful to the end user/consumer.

The provider name should be the full project name. If the name does not already do so, then prefix it with the name of the forge, e.g. "Eclipse EGit", "Eclipse SWTBot", or "LocationTech uDig".

OSGi Bundle Names

OSGi Bundle names must follow the same rules as Java Package Names.

The Bundle-Vendor should be the full project name. If the name does not already do so, then prefix it with the name of the forge, e.g. "Eclipse EGit", "Eclipse SWTBot", or "LocationTech uDig".

Maven Repositories

Warning2.png
This is a work in progress.

These guidelines/rules apply primarily for Eclipse Foundation-hosted Maven repositories. We believe that it is in the best interests of the broader community to consistently apply these guidelines/rules outside of that scope as well.

Maven Group Ids

Per Maven naming conventions, the Maven group id must follow the standard reverse DNS naming convention:

org.<forge>.<short-name>

Use of more specific group ids is also possible:

org.<forge>.<short-name>.<component>.*

Where:

  • forge is the short name of the hosting forge, e.g. "eclipse", "locationtech", or "polarsys";
  • short-name is the short name of the project (the name used in IPZilla, and the in project information pages]
  • component is project-specific

Examples:

  • org.eclipse.egit, org.eclipse.birt
  • org.locationtech.udig, org.locationtech.geomesa
  • org.polarsys.reqcycle, org.polarsys.cotsaq

For discussion, please see [1].

Maven Artifacts

Maven Versions

Java Archive (JAR/WAR/EAR) Names

TBD


This page is moderated by the EMO.

Back to the top