SlideShare a Scribd company logo
1 of 25
Download to read offline
Continuous Integration (CI)
with Maven
for Android applications
Hugo Josefson @ GTUG Malmö 2011
Agenda
● What's the problem?
– Dependency management
– Developer /
Build server mismatch
– Running tests
● Maven & CI
– Dependency management
– Developer /
Build server mismatch
– Running tests
● DEMO!
– How to set up Android apps for Maven
– How to set up Android tests for Maven
– How to set up Continuous Integration
What's the problem?
What's the problem?
- Dependency management
• External jars
• Hunt down the jars
• Where to store them? (svn/git? non-optimal!)
• What version was this jar?
• What version of other dependency jars does it work with?
– all handled manually
What's the problem?
- Dependency management
• Inter-project dependencies
• common library jar
– our-common-lib.jar
• several apk projects depend on it
– MyApp1.apk
– MyApp2.apk
What's the problem?
- Developer / Build server mismatch
• Script vs IDE for building
– Is the binary built the same way across
developers and build servers?
• Script vs IDE for testing
– Is the binary tested the same way across
developers and build servers?
What's the problem?
- Running tests
• Common excuses
– "I don't have time for tests before commit!"
– "I can't be bothered with tests before commit!"
– “I forgot...”
• Regressions creep in...
Maven
What is Maven?
• A build tool (and more: bit.ly/whatIsMaven)
• Default directory structure – overridable
• Plugins
Maven as Build Tool
• Tell Maven:
– My project is a jar / war / apk / ...
– I need library jar commons-lang:2.5
• Maven knows how to build that
• Maven knows how to fetch libraries
• (No need to specify directories,
nor handle library jars)
Maven
Default Directory Structure
Maven Plugins
• Built-in for core functionality
– Building jar
– Building war
– JavaDoc
– Running Tests
– … lots more
• Extra for e.g. building / testing / deploying apk
– maven-android-plugin
Maven vs
Dependency management
• External jars Dependency declaration→
<dependency>
<groupId>commons-lang</groupId>
<artifactid>commons-lang</artifactId>
<version>2.5</version>
</dependency>
Maven vs
Dependency management
• Inter-project dependencies Dep. declaration→
– Example: morse-lib by Manfred Moser
Maven vs
Developer / Build server mismatch
• Solved when both use same build and test tool
– Build server can use Maven
– Developer can use Maven
– Maven builds and runs tests in one go
– Reproducible Same build result→
DEMO TIME!
How to set up
Android apps for Maven
[DEMO]
How to set up
Android tests for Maven
[DEMO]
How to set up
Continuous Integration
[DEMO]
Jenkins + Android SDK
Android Emulator Plugin
Maven project
Maven Android resources
Getting Started + discussion group:
http://code.google.com/p/maven-android-plugin
Google: maven android
Questions?
Extra stuff
(if time allows)
Robotium
• Write UI tests for Android easily with Robotium
– www.robotium.org
– Standalone jar (Apache License 2)
– Makes it easier to write instrumentation tests
– Handles all the hard stuff:
– Toasts, Context menus, Timing issues,
following current Activity...
Robotium, cont'd...
• Write UI tests for Android easily with Robotium
– www.robotium.org
– Use normal instrumentation test class, e.g.
ActivityInstrumentationTestCase2
– Some Maven-enabled robotium-samples
git clone --recursive 
git://github.com/jayway/robotium-samples.git
Multi-module projects
• Share code & resources between Android apps
– Share code + Java resources
Dependency to jar→
– Share Android resources
Dependency to apklib→
» ApkLib on maven-android-plugin wiki
» libraryprojects/ in Samples (beta)
Continuous Integration with Maven for Android apps

More Related Content

What's hot

What's hot (20)

Git essentials
Git essentialsGit essentials
Git essentials
 
Let’s start Continuous Integration with jenkins
Let’s start Continuous Integration with jenkinsLet’s start Continuous Integration with jenkins
Let’s start Continuous Integration with jenkins
 
Continuous integration & Continuous Delivery @DeVz
Continuous integration & Continuous Delivery @DeVzContinuous integration & Continuous Delivery @DeVz
Continuous integration & Continuous Delivery @DeVz
 
Continuous operations in AWS
Continuous operations in AWSContinuous operations in AWS
Continuous operations in AWS
 
Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
CI and CD with Jenkins
CI and CD with JenkinsCI and CD with Jenkins
CI and CD with Jenkins
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
 
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
Managing Jenkins with Jenkins (Jenkins User Conference Palo Alto, 2013)
 
Continuous delivery with open source tools
Continuous delivery with open source toolsContinuous delivery with open source tools
Continuous delivery with open source tools
 
Jenkins
JenkinsJenkins
Jenkins
 
Dev ops for mobile apps at microsoft teams
Dev ops for mobile apps at microsoft teamsDev ops for mobile apps at microsoft teams
Dev ops for mobile apps at microsoft teams
 
Make It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version ControlMake It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version Control
 
Meetup React Sanca - 29/11/18 - React Testing
Meetup React Sanca - 29/11/18 - React TestingMeetup React Sanca - 29/11/18 - React Testing
Meetup React Sanca - 29/11/18 - React Testing
 
Version Controlling
Version ControllingVersion Controlling
Version Controlling
 
Cypress report
Cypress reportCypress report
Cypress report
 
Pipeline as code using Jenkins -Ministry of Testing
Pipeline as code using Jenkins -Ministry of TestingPipeline as code using Jenkins -Ministry of Testing
Pipeline as code using Jenkins -Ministry of Testing
 
TDD on OSGi, in practice.
TDD on OSGi, in practice.TDD on OSGi, in practice.
TDD on OSGi, in practice.
 
Continuous Integration and PHP
Continuous Integration and PHPContinuous Integration and PHP
Continuous Integration and PHP
 
Ice breaker with dev ops
Ice breaker with dev opsIce breaker with dev ops
Ice breaker with dev ops
 
Testing as a container
Testing as a containerTesting as a container
Testing as a container
 

Viewers also liked

2014 11-06-sonarqube-asfws-141110031042-conversion-gate01
2014 11-06-sonarqube-asfws-141110031042-conversion-gate012014 11-06-sonarqube-asfws-141110031042-conversion-gate01
2014 11-06-sonarqube-asfws-141110031042-conversion-gate01
Cyber Security Alliance
 

Viewers also liked (20)

27 jan 2012[1]
27 jan 2012[1]27 jan 2012[1]
27 jan 2012[1]
 
Owasp A9 USING KNOWN VULNERABLE COMPONENTS IT 6873 presentation
Owasp A9 USING KNOWN VULNERABLE COMPONENTS   IT 6873 presentationOwasp A9 USING KNOWN VULNERABLE COMPONENTS   IT 6873 presentation
Owasp A9 USING KNOWN VULNERABLE COMPONENTS IT 6873 presentation
 
2014 11-06-sonarqube-asfws-141110031042-conversion-gate01
2014 11-06-sonarqube-asfws-141110031042-conversion-gate012014 11-06-sonarqube-asfws-141110031042-conversion-gate01
2014 11-06-sonarqube-asfws-141110031042-conversion-gate01
 
Managing Security in External Software Dependencies
Managing Security in External Software DependenciesManaging Security in External Software Dependencies
Managing Security in External Software Dependencies
 
Continuous Security - TCCC
Continuous Security - TCCCContinuous Security - TCCC
Continuous Security - TCCC
 
12 Tips to Become a more Professional Tester
12 Tips to Become a more Professional Tester12 Tips to Become a more Professional Tester
12 Tips to Become a more Professional Tester
 
Building frameworks over Selenium
Building frameworks over SeleniumBuilding frameworks over Selenium
Building frameworks over Selenium
 
Dependency check
Dependency checkDependency check
Dependency check
 
Hiding in Plain Sight: The Danger of Known Vulnerabilities
Hiding in Plain Sight: The Danger of Known VulnerabilitiesHiding in Plain Sight: The Danger of Known Vulnerabilities
Hiding in Plain Sight: The Danger of Known Vulnerabilities
 
Live 2014 Survey Results: Open Source Development and Application Security Su...
Live 2014 Survey Results: Open Source Development and Application Security Su...Live 2014 Survey Results: Open Source Development and Application Security Su...
Live 2014 Survey Results: Open Source Development and Application Security Su...
 
Managing third party libraries
Managing third party librariesManaging third party libraries
Managing third party libraries
 
Being a professional software tester
Being a professional software testerBeing a professional software tester
Being a professional software tester
 
Abusing, Exploiting and Pwning with Firefox Add-ons: OWASP Appsec 2013 Presen...
Abusing, Exploiting and Pwning with Firefox Add-ons: OWASP Appsec 2013 Presen...Abusing, Exploiting and Pwning with Firefox Add-ons: OWASP Appsec 2013 Presen...
Abusing, Exploiting and Pwning with Firefox Add-ons: OWASP Appsec 2013 Presen...
 
[Poland] SecOps live cooking with OWASP appsec tools
[Poland] SecOps live cooking with OWASP appsec tools[Poland] SecOps live cooking with OWASP appsec tools
[Poland] SecOps live cooking with OWASP appsec tools
 
News Bytes - December 2015
News Bytes - December 2015News Bytes - December 2015
News Bytes - December 2015
 
Stc 2016 regional-round-iot testing in agile.
Stc 2016 regional-round-iot testing in agile.Stc 2016 regional-round-iot testing in agile.
Stc 2016 regional-round-iot testing in agile.
 
DevOpsCon 2016 - Continuous Security Testing - Stephan Kaps
DevOpsCon 2016 - Continuous Security Testing - Stephan KapsDevOpsCon 2016 - Continuous Security Testing - Stephan Kaps
DevOpsCon 2016 - Continuous Security Testing - Stephan Kaps
 
Simplify Dev with Complicated Security Tools
Simplify Dev with Complicated Security ToolsSimplify Dev with Complicated Security Tools
Simplify Dev with Complicated Security Tools
 
Les principales failles de sécurité des applications web actuelles
Les principales failles de sécurité des applications web actuellesLes principales failles de sécurité des applications web actuelles
Les principales failles de sécurité des applications web actuelles
 
Cross-browser testing in the real world
Cross-browser testing in the real worldCross-browser testing in the real world
Cross-browser testing in the real world
 

Similar to Continuous Integration with Maven for Android apps

DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
Simplilearn
 

Similar to Continuous Integration with Maven for Android apps (20)

Build tool
Build toolBuild tool
Build tool
 
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
 
Ci jenkins maven svn
Ci jenkins maven svnCi jenkins maven svn
Ci jenkins maven svn
 
S/W Design and Modularity using Maven
S/W Design and Modularity using MavenS/W Design and Modularity using Maven
S/W Design and Modularity using Maven
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
SE2018_Lec-22_-Continuous-Integration-Tools
SE2018_Lec-22_-Continuous-Integration-ToolsSE2018_Lec-22_-Continuous-Integration-Tools
SE2018_Lec-22_-Continuous-Integration-Tools
 
Introduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOpsIntroduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOps
 
Java is evolving rapidly: Maven helps you staying on track
Java is evolving rapidly:  Maven helps you staying on trackJava is evolving rapidly:  Maven helps you staying on track
Java is evolving rapidly: Maven helps you staying on track
 
From Ant to Maven to Gradle a tale of CI tools for JVM
From Ant to Maven to Gradle a tale of CI tools for JVMFrom Ant to Maven to Gradle a tale of CI tools for JVM
From Ant to Maven to Gradle a tale of CI tools for JVM
 
Mavennotes.pdf
Mavennotes.pdfMavennotes.pdf
Mavennotes.pdf
 
(Re)-Introduction to Maven
(Re)-Introduction to Maven(Re)-Introduction to Maven
(Re)-Introduction to Maven
 
Vagrant to-aws-flow
Vagrant to-aws-flowVagrant to-aws-flow
Vagrant to-aws-flow
 
Devops
DevopsDevops
Devops
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
 
What is maven
What is mavenWhat is maven
What is maven
 
software technology benchmarking
software  technology benchmarkingsoftware  technology benchmarking
software technology benchmarking
 
Apache Maven - eXo TN presentation
Apache Maven - eXo TN presentationApache Maven - eXo TN presentation
Apache Maven - eXo TN presentation
 
4 maven junit
4 maven junit4 maven junit
4 maven junit
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
 
Manen Ant SVN
Manen Ant SVNManen Ant SVN
Manen Ant SVN
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Continuous Integration with Maven for Android apps

  • 1. Continuous Integration (CI) with Maven for Android applications Hugo Josefson @ GTUG Malmö 2011
  • 2. Agenda ● What's the problem? – Dependency management – Developer / Build server mismatch – Running tests ● Maven & CI – Dependency management – Developer / Build server mismatch – Running tests ● DEMO! – How to set up Android apps for Maven – How to set up Android tests for Maven – How to set up Continuous Integration
  • 4. What's the problem? - Dependency management • External jars • Hunt down the jars • Where to store them? (svn/git? non-optimal!) • What version was this jar? • What version of other dependency jars does it work with? – all handled manually
  • 5. What's the problem? - Dependency management • Inter-project dependencies • common library jar – our-common-lib.jar • several apk projects depend on it – MyApp1.apk – MyApp2.apk
  • 6. What's the problem? - Developer / Build server mismatch • Script vs IDE for building – Is the binary built the same way across developers and build servers? • Script vs IDE for testing – Is the binary tested the same way across developers and build servers?
  • 7. What's the problem? - Running tests • Common excuses – "I don't have time for tests before commit!" – "I can't be bothered with tests before commit!" – “I forgot...” • Regressions creep in...
  • 9. What is Maven? • A build tool (and more: bit.ly/whatIsMaven) • Default directory structure – overridable • Plugins
  • 10. Maven as Build Tool • Tell Maven: – My project is a jar / war / apk / ... – I need library jar commons-lang:2.5 • Maven knows how to build that • Maven knows how to fetch libraries • (No need to specify directories, nor handle library jars)
  • 12. Maven Plugins • Built-in for core functionality – Building jar – Building war – JavaDoc – Running Tests – … lots more • Extra for e.g. building / testing / deploying apk – maven-android-plugin
  • 13. Maven vs Dependency management • External jars Dependency declaration→ <dependency> <groupId>commons-lang</groupId> <artifactid>commons-lang</artifactId> <version>2.5</version> </dependency>
  • 14. Maven vs Dependency management • Inter-project dependencies Dep. declaration→ – Example: morse-lib by Manfred Moser
  • 15. Maven vs Developer / Build server mismatch • Solved when both use same build and test tool – Build server can use Maven – Developer can use Maven – Maven builds and runs tests in one go – Reproducible Same build result→
  • 17. How to set up Android apps for Maven [DEMO]
  • 18. How to set up Android tests for Maven [DEMO]
  • 19. How to set up Continuous Integration [DEMO] Jenkins + Android SDK Android Emulator Plugin Maven project
  • 20. Maven Android resources Getting Started + discussion group: http://code.google.com/p/maven-android-plugin Google: maven android Questions?
  • 22. Robotium • Write UI tests for Android easily with Robotium – www.robotium.org – Standalone jar (Apache License 2) – Makes it easier to write instrumentation tests – Handles all the hard stuff: – Toasts, Context menus, Timing issues, following current Activity...
  • 23. Robotium, cont'd... • Write UI tests for Android easily with Robotium – www.robotium.org – Use normal instrumentation test class, e.g. ActivityInstrumentationTestCase2 – Some Maven-enabled robotium-samples git clone --recursive git://github.com/jayway/robotium-samples.git
  • 24. Multi-module projects • Share code & resources between Android apps – Share code + Java resources Dependency to jar→ – Share Android resources Dependency to apklib→ » ApkLib on maven-android-plugin wiki » libraryprojects/ in Samples (beta)

Editor's Notes

  1. Yes, there are notes for some slides :)
  2. You find+download jars, what are they named? Sometimes/Usually not w/ version numbers. Git/Svn not designed for multi-MB binary blobs. The history becomes heavy. (affects backups for svn,git; clone for git) Where can I find dependency information? Hopefully in “some documentation” on each jar&apos;s website.
  3. How do you keep track of which version of the common lib you are using? (in each of the apk projects)
  4. Customer says: “Doesn&apos;t work!” Developer says: “Works for me!” How do you know what each person is using, if the build server built the app one way and the developer some other way?
  5. Let me show you what Maven and a Continuous Integration server can bring to the table, addressing each of these issues... But first, what is Maven?...
  6. - It&apos;s more than a build tool, because it lets you define the project in terms of /what it is/ rather than defining /all the build steps/ needed to arrive at the output artifact. – You define your project in a project object model (pom file), where you tell Maven what the packaging type of your application is: jar, war, apk. It then knows what build steps are needed to build your project and where your code and resources are located by default.
  7. – You can override the defaults if you want.
  8. – Plugins contain the functionality: built-in core plugins for default things such as compiling a jar, and 3:rd party such as maven-android-plugin for building Android apk:s.
  9. Maven downloads this from a Central OpenSource repository. - cached locally - If what you need is not already there, you can have your own repository where you store 3:rd party jars.
  10. – In this case, the Library is a simple jar project, containing the main functionality. It&apos;s not tied to a particular platform, and is unit-testable. – The App project is an apk, and uses the Library via Maven dependency declaration.