Difference between revisions of "Developing gCube Maven Components"
From Gcube Wiki
Line 2: | Line 2: | ||
= Common = | = Common = | ||
− | + | ==== Maven Coordinates ==== | |
+ | Maven components' coordinates must follow these conventions: | ||
* their <code>groupId</code> must be of the following form: | * their <code>groupId</code> must be of the following form: | ||
Line 12: | Line 13: | ||
* their <code>artifactId</code> must follow Maven conventions (e.g. ''avoid capital letters or punctuation other than hyphens''). | * their <code>artifactId</code> must follow Maven conventions (e.g. ''avoid capital letters or punctuation other than hyphens''). | ||
− | + | ==== Parent ==== | |
+ | All gCube components must inherit from '''maven-parent'''. This ensure and promotes compliance with project-wide requirements, from the enforcement of minimal Java and Maven versions to generation and packaging of Javadoc documentation and component sources. | ||
+ | |||
+ | <source lang="xml"> | ||
+ | <parent> | ||
+ | <artifactId>maven-parent</artifactId> | ||
+ | <groupId>org.gcube.tools</groupId> | ||
+ | <version>1.0.0</version> | ||
+ | <relativePath /> | ||
+ | </parent> | ||
+ | </source> | ||
+ | |||
+ | ==== Service Archive (SA) ==== | ||
+ | Whenever they are associated with a gCube Software Archive (SA), they must produce it as a secondary <code>tar.gz</code> artefact with classifier <code>servicearchive</code>. Note that the SA of Maven components does ''not'' need to include Javadoc documentation (as this documentation is produced and published directly as a Maven artefact); | ||
* for each deployable artefact they produce (primary or secondary), they must include the Maven coordinates of the arteact in the corresponding package section of the gCube Software Profile. Specifying package dependencies in the Software Profile, on the other hand, is no longer required; | * for each deployable artefact they produce (primary or secondary), they must include the Maven coordinates of the arteact in the corresponding package section of the gCube Software Profile. Specifying package dependencies in the Software Profile, on the other hand, is no longer required; |
Revision as of 15:45, 18 July 2012
Contents
Common
Maven Coordinates
Maven components' coordinates must follow these conventions:
- their
groupId
must be of the following form:
org.gcube.<class>
- where class identifies a functionally correlated set of components and helps a range of users (developers, administrator) to discover components in various UIs/reports used within the system and in tools. Logically, the class corresponds to the gCube class of the component's, as specified in its gCube Software Profile. However, more specific, or else cross-class groups may be agreed upon among developers. In all cases, the group should align with official Maven guidelines. By agreement, for example, components in gCube class
DataAccess
declare agroupId
oforg.gcube.data.access
and those in gCube classDataTransfer
declare agroupId
oforg.gcube.data.transfer
. On the other hand, also by agreement, components in gCube classInformationSystem
declare agroupId
oforg.gcube.informationsystem
.
- their
artifactId
must follow Maven conventions (e.g. avoid capital letters or punctuation other than hyphens).
Parent
All gCube components must inherit from maven-parent. This ensure and promotes compliance with project-wide requirements, from the enforcement of minimal Java and Maven versions to generation and packaging of Javadoc documentation and component sources.
<parent> <artifactId>maven-parent</artifactId> <groupId>org.gcube.tools</groupId> <version>1.0.0</version> <relativePath /> </parent>
Service Archive (SA)
Whenever they are associated with a gCube Software Archive (SA), they must produce it as a secondary tar.gz
artefact with classifier servicearchive
. Note that the SA of Maven components does not need to include Javadoc documentation (as this documentation is produced and published directly as a Maven artefact);
- for each deployable artefact they produce (primary or secondary), they must include the Maven coordinates of the arteact in the corresponding package section of the gCube Software Profile. Specifying package dependencies in the Software Profile, on the other hand, is no longer required;
- whenever they are associated with a gCube Software Archive (SA), they must produce it as a secondary
tar.gz
artefact with classifierservicearchive
. Note that the SA of Maven components does not need to include Javadoc documentation (as this documentation is produced and published directly as a Maven artefact);