Shared Java library for repository integrations in the MARS framework.
The library contains the common pieces that target repository services need when they translate repository-specific responses back into a MARS receipt:
- ISA-JSON model classes used by repository services
- MARS receipt model classes
MarsReceiptProvider, the base class for building MARS-compatible receiptsReceiptAccessionsMap, a small mapping object for connecting ISA-JSON fields to repository accessionsMarsReceiptException, a receipt-aware runtime exception for conversion errors
Repository service modules, such as ENA or BioSamples converters, should use this library instead of keeping local copies of the receipt and ISA model code.
- Java 17
- Gradle wrapper included in this repository
./gradlew buildMARS services can consume a local development version from your Maven local repository:
./gradlew publishToMavenLocalThis publishes:
com.elixir.mars:mars-repository:0.0.2-SNAPSHOT
Then make sure the consuming service has mavenLocal() enabled and depends on
the same version:
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation 'com.elixir.mars:mars-repository:0.0.2-SNAPSHOT'
}To release a new library version:
-
Update the version in
build.gradlefrom the current-SNAPSHOTvalue to the release version, for example0.0.2. -
Run the build to confirm the code still passes:
./gradlew build
-
Commit the version bump.
-
Create and push a git tag for the release, for example:
git tag v0.0.2 git push origin v0.0.2
-
After the release is published, bump
build.gradleto the next-SNAPSHOTversion, such as0.0.3-SNAPSHOT, and commit that change. -
Create a release based on the tag on Github to produce a changelog.
Target repository integrations typically extend MarsReceiptProvider, collect
repository accessions, and let the base class build the MARS receipt paths.
public final class EnaReceiptProvider extends MarsReceiptProvider {
public EnaReceiptProvider() {
super("ena");
}
@Override
public String convertMarsReceiptToJson() {
return getMarsReceipt().toString();
}
}Use ReceiptAccessionsMap instances to describe which ISA-JSON field identifies
each object and which repository accession belongs to each field value. The base
provider can then produce MarsAccession entries pointing back to the relevant
study, source, sample, other material, or data file in the ISA-JSON document.
com.elixir.mars.repository
com.elixir.mars.repository.models.isa
com.elixir.mars.repository.models.receipt
This project is licensed under the MIT License. See LICENSE.