Uploading a jar package to the perfSONAR repository
From GEANT2-JRA1 Wiki
This project has its own jar repository that can be used in ant or maven scripts for resolving library dependencies.
If you don't find a jar file in general repositories, such as Maven2, or you've developed something which is part of the perfSONAR development, you have to upload to the perfSONAR repository.
The structure of a repository is:
|- jar-repository (main folder)
|
|- name of the group (it's the name of the project)
|
|- name of the release (it's the name of the file)
|
|- version
|
|- name_of_the_release-version.jar (the jar file)
|- name_of_the_release-version.jar.sha1 (a file containing the SHA1 hash of the jar file)
|- name_of_the_release-version.pom (the metadata of the jar file)
|- name_of_the_release-version.pom.sha1 (a file containing the SHA1 hash of the metadata file)
We'll explain better with the next example:
A developer want to upload the jar file perfsonar-base version 1.0.20070702, which belongs to the perfSONAR project. So, he should create the next structure:
|- jar-repository
|
|- perfsonar
|
|- perfsonar-base
|
|- 1.0.20070702
|
|- perfsonar-base-1.0.20070702.jar
|- perfsonar-base-1.0.20070702.jar.sha1
|- perfsonar-base-1.0.20070702.pom
|- perfsonar-base-1.0.20070702.pom.sha1
Where,
- perfsonar-base-1.0.20070702.jar: contains the set of Java classes.
- perfsonar-base-1.0.20070702.jar.sha1: the SHA1 hash of the jar file. This content is:
1c15e78ace68b05896ce552f5fbbb633adb2e68b perfsonar-base-1.0.20070702.jar
- perfsonar-base-1.0.20070702.pom: the metadata of this release. This content is:
<project> <modelVersion>4.0.0</modelVersion> <groupId>perfsonar</groupId> <artifactId>perfsonar-base</artifactId> <version>1.0.20070702</version> </project>
- Where modelVersion is always 4.0.0.
- perfsonar-base-1.0.20070702.pom.sha1: the SHA1 hash of the pom file. This content is:
3643988d3c807d551bef1edaadc1552e15e76a05 perfsonar-base-1.0.20070702.pom
After we have those four files in that directory, we can upload them to the SVN (where the repository is located at). There are some nice pages about how to use the perfSONAR SVN at PerfSONAR_Developers_information page.
SHA1 hash
There are too many ways of obtaining the SHA1 hash of a file:
- Based on openssl:
$ openssl sha1 perfsonar-base-1.0.20070702.pom SHA1(perfsonar-base-1.0.20070702.pom)= 3643988d3c807d551bef1edaadc1552e15e76a05

