Skip to content

More Language Formats

Artifact Keeper supports additional package formats beyond the most common ones. This guide covers configuration and usage for Hex, Pub, Swift, CocoaPods, CRAN, SBT, and Conda.

Hex (Elixir / Erlang)

Hex is the package manager for the Erlang ecosystem, used by Elixir and Erlang projects.

Endpoint Information

  • Repository Type Key: hex
  • API Endpoint: /hex/{repo}
  • Clients: mix, rebar3

Client Configuration

Configure the HEX_MIRROR environment variable to point to your Artifact Keeper instance:

Terminal window
export HEX_MIRROR=https://artifact-keeper.example.com/hex/my-repo

For Mix projects, you can also configure the mirror in mix.exs:

defp deps do
[
{:my_package, "~> 1.0", organization: "my-repo"}
]
end

Publishing Packages

Publish packages using mix hex.publish:

Terminal window
# Build and publish
mix hex.build
mix hex.publish --organization my-repo

Installing Packages

Install packages using Mix:

Terminal window
mix deps.get

Or with rebar3:

Terminal window
rebar3 get-deps

Pub (Dart / Flutter)

Pub is the package manager for Dart and Flutter applications.

Endpoint Information

  • Repository Type Key: pub
  • API Endpoint: /pub/{repo}
  • Clients: dart pub, flutter pub

Client Configuration

Configure the PUB_HOSTED_URL environment variable:

Terminal window
export PUB_HOSTED_URL=https://artifact-keeper.example.com/pub/my-repo

Or configure it in pubspec.yaml:

dependencies:
my_package:
hosted:
url: https://artifact-keeper.example.com/pub/my-repo
version: ^1.0.0

Publishing Packages

Publish packages using dart pub publish or flutter pub publish:

Terminal window
# Dry run
dart pub publish --dry-run
# Publish
dart pub publish --server https://artifact-keeper.example.com/pub/my-repo

Installing Packages

Install packages using pub:

Terminal window
# Dart
dart pub get
# Flutter
flutter pub get

Swift

Swift Package Manager is the official package manager for Swift and Apple ecosystem projects.

Endpoint Information

  • Repository Type Key: swift
  • API Endpoint: /swift/{repo}
  • Clients: Swift Package Manager

Client Configuration

Configure package dependencies in Package.swift:

5.9
import PackageDescription
let package = Package(
name: "MyPackage",
dependencies: [
.package(
url: "https://artifact-keeper.example.com/swift/my-repo/MyDependency",
from: "1.0.0"
)
],
targets: [
.target(
name: "MyPackage",
dependencies: ["MyDependency"]
)
]
)

Publishing Packages

Swift packages are typically published via Git tags. Configure your repository URL to point to Artifact Keeper:

Terminal window
# Tag and push to Artifact Keeper
git tag 1.0.0
git push https://artifact-keeper.example.com/swift/my-repo/MyPackage --tags

Resolving Packages

Resolve and update packages:

Terminal window
swift package resolve
swift package update

CocoaPods (iOS / macOS)

CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects.

Endpoint Information

  • Repository Type Key: cocoapods
  • API Endpoint: /cocoapods/{repo}
  • Clients: pod

Client Configuration

Configure your Podfile to use Artifact Keeper as a source:

source 'https://artifact-keeper.example.com/cocoapods/my-repo'
source 'https://cdn.cocoapods.org/' # Fallback to public CocoaPods
platform :ios, '14.0'
target 'MyApp' do
use_frameworks!
pod 'MyPrivatePod', '~> 1.0'
pod 'Alamofire', '~> 5.0' # Public pod from CocoaPods
end

Publishing Pods

Publish a pod to your private repository:

Terminal window
# Validate podspec
pod spec lint MyPod.podspec
# Push to Artifact Keeper
pod repo add my-repo https://artifact-keeper.example.com/cocoapods/my-repo
pod repo push my-repo MyPod.podspec

Installing Pods

Install dependencies:

Terminal window
pod install
pod update

CRAN (R)

CRAN (Comprehensive R Archive Network) format for R packages.

Endpoint Information

  • Repository Type Key: cran
  • API Endpoint: /cran/{repo}
  • Clients: R, install.packages

Client Configuration

Configure R to use Artifact Keeper as a repository:

# In R console or .Rprofile
options(repos = c(
my_repo = "https://artifact-keeper.example.com/cran/my-repo",
CRAN = "https://cran.r-project.org"
))

Or set it per-session:

# Single session
repos <- c(
"https://artifact-keeper.example.com/cran/my-repo",
"https://cran.r-project.org"
)

Publishing Packages

Build and publish R packages:

Terminal window
# Build package
R CMD build my-package
# Submit to Artifact Keeper (via API or web interface)
curl -X POST \
-H "Authorization: Bearer ${API_TOKEN}" \
-F "file=@my-package_1.0.0.tar.gz" \
https://artifact-keeper.example.com/cran/my-repo/upload

Installing Packages

Install packages from your repository:

# Install from configured repository
install.packages("my-package")
# Install from specific repository
install.packages("my-package", repos = "https://artifact-keeper.example.com/cran/my-repo")

SBT (Scala / JVM)

SBT (Scala Build Tool) uses Ivy repository format for Scala and JVM projects.

Endpoint Information

  • Repository Type Key: sbt
  • API Endpoint: /ivy/{repo}
  • Clients: sbt, Ivy

Client Configuration

Configure build.sbt to use Artifact Keeper as a resolver:

build.sbt
ThisBuild / organization := "com.example"
ThisBuild / version := "1.0.0"
ThisBuild / scalaVersion := "3.3.1"
resolvers ++= Seq(
"Artifact Keeper" at "https://artifact-keeper.example.com/ivy/my-repo",
Resolver.defaultLocal
)
libraryDependencies ++= Seq(
"com.example" %% "my-library" % "1.0.0"
)

For publishing, configure credentials in ~/.sbt/1.0/credentials.sbt:

credentials += Credentials(
"Artifact Keeper",
"artifact-keeper.example.com",
"username",
"token"
)

Publishing Artifacts

Publish your library:

// In build.sbt, add publishing configuration
publishTo := Some(
"Artifact Keeper" at "https://artifact-keeper.example.com/ivy/my-repo"
)
publishMavenStyle := false // Use Ivy style

Then publish:

Terminal window
sbt publish

Resolving Dependencies

Resolve and update dependencies:

Terminal window
sbt update
sbt compile

Conda

Conda is a cross-platform package manager used primarily in data science and scientific computing.

Endpoint Information

  • Repository Type Key: conda_native
  • API Endpoint: /conda/{repo}
  • Alias: Routes through PyPI for simple API compatibility
  • Clients: conda, mamba, micromamba

Client Configuration

Configure Conda channels in .condarc or via command line:

~/.condarc
channels:
- https://artifact-keeper.example.com/conda/my-repo
- conda-forge
- defaults
channel_alias: https://artifact-keeper.example.com/conda

Or configure per-environment:

Terminal window
# Add channel
conda config --add channels https://artifact-keeper.example.com/conda/my-repo
# Set channel priority
conda config --set channel_priority strict

Publishing Packages

Build and publish Conda packages:

Terminal window
# Build package
conda build my-package
# Upload to Artifact Keeper
anaconda upload \
--token ${API_TOKEN} \
--url https://artifact-keeper.example.com/conda/my-repo \
/path/to/my-package-1.0.0-py39_0.tar.bz2

Or use the API directly:

Terminal window
curl -X POST \
-H "Authorization: Bearer ${API_TOKEN}" \
-F "file=@my-package-1.0.0-py39_0.tar.bz2" \
https://artifact-keeper.example.com/conda/my-repo/upload

Installing Packages

Install packages from your channel:

Terminal window
# Install with conda
conda install -c https://artifact-keeper.example.com/conda/my-repo my-package
# Install with mamba (faster)
mamba install -c https://artifact-keeper.example.com/conda/my-repo my-package
# Install with micromamba
micromamba install -c https://artifact-keeper.example.com/conda/my-repo my-package

Create environment with specific channel:

Terminal window
conda create -n myenv \
-c https://artifact-keeper.example.com/conda/my-repo \
python=3.9 my-package

See Also