SlideShare a Scribd company logo
Deploying artifacts to Archiva
Allan
Agenda
● What is Artifact?
● What is Archiva?
● Features of Archiva
● Configuring Gradle to deploy to an Archiva repository
○ Creating a new Android Library
○ Publishing Library on Archiva
○ How to use myLibrary?
● Demo
● References
What is Artifact?
● Artifact is something that is either produced or used by a project.
● Each artifact has:
○ Group ID (usually a reversed domain name, like com.example.foo)
○ Artifact ID (just a name)
○ Version string
○ Dependencies
● Artifact repository in Maven is used to hold build artifacts and
dependencies of varying types.
What is Archiva?
● Apache Archiva is an extensible repository management software that
helps taking care of your own personal or enterprise-wide build artifact
repository.
● Archiva is the perfect companion for build tools such as Maven,
Continuum, and ANT.
How to distribute a Java/Android library?
How to distribute a Java/Android library?
Distribute libraries via Maven Repository
Distribute libraries via Maven Repository
Features of Archiva
● Security access management
● Remote repository proxying
● Upload artifact
● Browsing
● Project information
Security access management
Remote repository proxying
Jcenter
Archiva
Developer #1
Developer #2
Maven Central
Other repository
Remote repository proxying
Upload Artifact
Browsing
Project Information
Archiva DEMO
Configuring Gradle
to deploy to an
Archiva repository
Publish artifacts to Maven Repository
1. Create a new library module in the Android project
2. Create a java class in library module
3. Test and reference the library within the same Android project
4. Configure custom artifacts
5. Identity values in the generated POM
6. Publish a project to a Maven repository
Create a new Android Library
Create a new module
Default folders structure
Top-level build file ($Project/build.gradle)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath
'com.android.tools.build:gradle:2.1.0'
}
}
allprojects {
repositories {
jcenter()
}
}
Default build file
($Project/mylibrary/build.gradle)
buildTypes {
release {
minifyEnabled false
proguardFiles
getDefaultProguardFile('proguard-andr
oid.txt'), 'proguard-rules.pro'
}
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
Default build file (Dependencies)
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.1.1'
}
Create a java class in library module
Compile library project as a dependency
in app module
dependencies {
...
compile project(':middleware')
compile project(':mylibrary')
}
Test library in app module
Publish a project to a Maven repository
Apply the 'maven-publish' plugin in library
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
...
Declaring Maven repositories
publishing {
publications {
repositories.maven {
url 'http://archiva.url/repository/internal/'
credentials {
username "USERNAME"
password "PASSWORD"
}
}
....
Identity values in the generated POM
publishing {
publications {
...
maven(MavenPublication) {
artifacts {
groupId 'com.fuhu.pando'
artifactId 'mylibrary'
version '1.0'
artifact 'build/outputs/aar/mylibrary-release.aar'
pom.withXml { ...
Generate a POM file with dynamic
dependencies
...
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
configurations.compile.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
Example
Performing a publish
Check if the artifact exists
Check if the artifact exists
How to use myLibrary?
Create a demo application
Add the private Maven repository
in top-level build file
allprojects {
repositories {
jcenter()
maven {
url "http://archiva.url/repository/internal"
credentials {
username "USERNAME"
password "PASSWORD"
}
} ...
Add the Gradle dependency in app module
dependencies {
compile 'com.fuhu.pando:mylibrary:1.0'
}
Test library in app module
DEMO
References
● Apache Archiva Documentation
● Gradle User Guide
● Gradle User Guide - Chapter 34. Maven Publishing (new)
● Apache Maven
● Building your own Android library

More Related Content

PPTX
Infecciones causadas por bacterias anaerobias
DOC
Taxonomia de los estafilococos y estreptococos
PPTX
Blastocystis hominis
PDF
otros sistemas sanguíneos 7.pdf
PPTX
Salmonella spp ch
PPT
Triatominos hematofagos y fitofagos
PDF
Diapositivas salmonella..
Infecciones causadas por bacterias anaerobias
Taxonomia de los estafilococos y estreptococos
Blastocystis hominis
otros sistemas sanguíneos 7.pdf
Salmonella spp ch
Triatominos hematofagos y fitofagos
Diapositivas salmonella..

What's hot (18)

PPTX
Sistema kidd banco de sangre
PPTX
LEPTOSPIRA
PPTX
Tabla comparativa Parásitos Protozoarios y Helmintos
PPTX
Sistemas de secreción en bacterias
PPTX
Clostridium perfringens
PDF
Infografia Microbiologia
PPTX
Plesiomonas shigelloides
PPT
Artropodos
PPTX
SERRATIA EXPOSICION 2.pptx
PPTX
Campylobacter.jejuni
PPT
Virus De InteréS 1
PPTX
Tema 68 "Fundamento y descripción de las pruebas serológicas y de evaluación ...
PPTX
Medios de cultivo
PPTX
Salmonella spp.
PPTX
Familia enterobacteriaceae
PPT
Parasitologia generalidades - curso unrc
PPTX
Clasificacion de virus por material genetico y Baltimore
Sistema kidd banco de sangre
LEPTOSPIRA
Tabla comparativa Parásitos Protozoarios y Helmintos
Sistemas de secreción en bacterias
Clostridium perfringens
Infografia Microbiologia
Plesiomonas shigelloides
Artropodos
SERRATIA EXPOSICION 2.pptx
Campylobacter.jejuni
Virus De InteréS 1
Tema 68 "Fundamento y descripción de las pruebas serológicas y de evaluación ...
Medios de cultivo
Salmonella spp.
Familia enterobacteriaceae
Parasitologia generalidades - curso unrc
Clasificacion de virus por material genetico y Baltimore
Ad

Similar to Deploying artifacts to archiva (20)

PDF
Android Internal Library Management
PDF
Get started with AAR
PPTX
Apache maven and its impact on java 9 (Java One 2017)
PDF
Repository Management with JFrog Artifactory
PDF
Internal Android Library Management (DroidCon SF 2016, Droidcon Italy 2016)
PDF
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
PDF
Using Maven to build Java & Android program
PPT
An introduction to maven gradle and sbt
PDF
Writing Android Libraries
PPTX
The do's and don'ts with java 9 (Devoxx 2017)
PPTX
How maven makes your development group look like a bunch of professionals.
PDF
Антон Руткевич, Сборка Android-библиотеки нового поколения с помощью Gradle
PPTX
Android, Gradle & Dependecies
PPTX
Build your android app with gradle
PDF
Why your build matters
PDF
Android gradle-build-system-overview
PPTX
Building next gen android library with gradle
PPTX
Apache Maven supports all Java (JokerConf 2018)
PDF
Keeping your build tool updated in a multi repository world
Android Internal Library Management
Get started with AAR
Apache maven and its impact on java 9 (Java One 2017)
Repository Management with JFrog Artifactory
Internal Android Library Management (DroidCon SF 2016, Droidcon Italy 2016)
ID Android TechTalk Series #6 : Google Service and Gradle - Anton Nurdin Tuha...
Using Maven to build Java & Android program
An introduction to maven gradle and sbt
Writing Android Libraries
The do's and don'ts with java 9 (Devoxx 2017)
How maven makes your development group look like a bunch of professionals.
Антон Руткевич, Сборка Android-библиотеки нового поколения с помощью Gradle
Android, Gradle & Dependecies
Build your android app with gradle
Why your build matters
Android gradle-build-system-overview
Building next gen android library with gradle
Apache Maven supports all Java (JokerConf 2018)
Keeping your build tool updated in a multi repository world
Ad

More from allanh0526 (18)

PPTX
PPTX
Digital authentication
PDF
Integration of slather and jenkins
PDF
How to generate code coverage reports in xcode with slather
PDF
Unit testing in xcode 8 with swift
PDF
Ui testing in xcode
PDF
How to work with dates and times in swift 3
PDF
Using a model view-view model architecture for iOS apps
PDF
iOS architecture patterns
PDF
ThingMaker in Swift
PDF
Automatic reference counting in Swift
PDF
Core data in Swfit
PDF
From android/java to swift (3)
PDF
From android/ java to swift (2)
PDF
From android/java to swift (1)
PDF
WebRTC
PDF
Pipeline interface
PPT
Android httpclient
Digital authentication
Integration of slather and jenkins
How to generate code coverage reports in xcode with slather
Unit testing in xcode 8 with swift
Ui testing in xcode
How to work with dates and times in swift 3
Using a model view-view model architecture for iOS apps
iOS architecture patterns
ThingMaker in Swift
Automatic reference counting in Swift
Core data in Swfit
From android/java to swift (3)
From android/ java to swift (2)
From android/java to swift (1)
WebRTC
Pipeline interface
Android httpclient

Recently uploaded (20)

PPTX
history of c programming in notes for students .pptx
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
L1 - Introduction to python Backend.pptx
PDF
top salesforce developer skills in 2025.pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
ai tools demonstartion for schools and inter college
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
medical staffing services at VALiNTRY
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Digital Strategies for Manufacturing Companies
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Nekopoi APK 2025 free lastest update
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Transform Your Business with a Software ERP System
history of c programming in notes for students .pptx
Wondershare Filmora 15 Crack With Activation Key [2025
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
L1 - Introduction to python Backend.pptx
top salesforce developer skills in 2025.pdf
PTS Company Brochure 2025 (1).pdf.......
ai tools demonstartion for schools and inter college
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
medical staffing services at VALiNTRY
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Which alternative to Crystal Reports is best for small or large businesses.pdf
Digital Strategies for Manufacturing Companies
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Adobe Illustrator 28.6 Crack My Vision of Vector Design
CHAPTER 2 - PM Management and IT Context
Design an Analysis of Algorithms I-SECS-1021-03
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Nekopoi APK 2025 free lastest update
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Transform Your Business with a Software ERP System

Deploying artifacts to archiva

  • 1. Deploying artifacts to Archiva Allan
  • 2. Agenda ● What is Artifact? ● What is Archiva? ● Features of Archiva ● Configuring Gradle to deploy to an Archiva repository ○ Creating a new Android Library ○ Publishing Library on Archiva ○ How to use myLibrary? ● Demo ● References
  • 3. What is Artifact? ● Artifact is something that is either produced or used by a project. ● Each artifact has: ○ Group ID (usually a reversed domain name, like com.example.foo) ○ Artifact ID (just a name) ○ Version string ○ Dependencies ● Artifact repository in Maven is used to hold build artifacts and dependencies of varying types.
  • 4. What is Archiva? ● Apache Archiva is an extensible repository management software that helps taking care of your own personal or enterprise-wide build artifact repository. ● Archiva is the perfect companion for build tools such as Maven, Continuum, and ANT.
  • 5. How to distribute a Java/Android library?
  • 6. How to distribute a Java/Android library?
  • 7. Distribute libraries via Maven Repository
  • 8. Distribute libraries via Maven Repository
  • 9. Features of Archiva ● Security access management ● Remote repository proxying ● Upload artifact ● Browsing ● Project information
  • 11. Remote repository proxying Jcenter Archiva Developer #1 Developer #2 Maven Central Other repository
  • 17. Configuring Gradle to deploy to an Archiva repository
  • 18. Publish artifacts to Maven Repository 1. Create a new library module in the Android project 2. Create a java class in library module 3. Test and reference the library within the same Android project 4. Configure custom artifacts 5. Identity values in the generated POM 6. Publish a project to a Maven repository
  • 19. Create a new Android Library
  • 20. Create a new module
  • 22. Top-level build file ($Project/build.gradle) buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.1.0' } } allprojects { repositories { jcenter() } }
  • 23. Default build file ($Project/mylibrary/build.gradle) buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-andr oid.txt'), 'proguard-rules.pro' } } } apply plugin: 'com.android.library' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" }
  • 24. Default build file (Dependencies) dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:appcompat-v7:23.1.1' }
  • 25. Create a java class in library module
  • 26. Compile library project as a dependency in app module dependencies { ... compile project(':middleware') compile project(':mylibrary') }
  • 27. Test library in app module
  • 28. Publish a project to a Maven repository
  • 29. Apply the 'maven-publish' plugin in library apply plugin: 'com.android.library' apply plugin: 'maven-publish' android { compileSdkVersion 23 buildToolsVersion "23.0.2" ...
  • 30. Declaring Maven repositories publishing { publications { repositories.maven { url 'http://archiva.url/repository/internal/' credentials { username "USERNAME" password "PASSWORD" } } ....
  • 31. Identity values in the generated POM publishing { publications { ... maven(MavenPublication) { artifacts { groupId 'com.fuhu.pando' artifactId 'mylibrary' version '1.0' artifact 'build/outputs/aar/mylibrary-release.aar' pom.withXml { ...
  • 32. Generate a POM file with dynamic dependencies ... pom.withXml { def dependenciesNode = asNode().appendNode('dependencies') configurations.compile.allDependencies.each { def dependencyNode = dependenciesNode.appendNode('dependency') dependencyNode.appendNode('groupId', it.group) dependencyNode.appendNode('artifactId', it.name) dependencyNode.appendNode('version', it.version) } }
  • 35. Check if the artifact exists
  • 36. Check if the artifact exists
  • 37. How to use myLibrary?
  • 38. Create a demo application
  • 39. Add the private Maven repository in top-level build file allprojects { repositories { jcenter() maven { url "http://archiva.url/repository/internal" credentials { username "USERNAME" password "PASSWORD" } } ...
  • 40. Add the Gradle dependency in app module dependencies { compile 'com.fuhu.pando:mylibrary:1.0' }
  • 41. Test library in app module
  • 42. DEMO
  • 43. References ● Apache Archiva Documentation ● Gradle User Guide ● Gradle User Guide - Chapter 34. Maven Publishing (new) ● Apache Maven ● Building your own Android library