Your SlideShare is downloading. ×
Maven basics (Android & IntelliJ)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Maven basics (Android & IntelliJ)

852
views

Published on

A presentation I have given about Maven basic use for Android project

A presentation I have given about Maven basic use for Android project

Published in: Self Improvement

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
852
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Maven Hussain Mansoor Folio3 (26 Feb 2014)
  • 2. Maven defined  Declarative Dependencies  External modules  Build Order  Directories  Plug-ins  Build Management  Downloads dependencies and maintains local cache
  • 3. Support  Languages  Primarily Java  C#, Ruby, Scala  IDEs  Eclipse, NetBeans, IntelliJ (by default), Jbuilder, Jdeveloper, MyEclipse…
  • 4. Build Life cycle  process-resources  compile  process-test-resources  test-compile  test  package  install  deploy
  • 5.  <modelVersion>4.0.0</modelVersion>  <groupId>com.project</groupId>  <artifactId>Project</artifactId>  <version>1.1</version>  <packaging>apk</packaging>  <name>Project-Maven</name>
  • 6.  Dependencies  Scope  compile, runtime, test, system, and provided  System path  Local path, deprecated  groupId  artifactId  Packaging  apk, jar, …
  • 7. Tags defined • A universally unique identifier for a project. It is normal to use a fully-qualified package name to distinguish it from other projects with a similar name (eg. org.apache.maven, com.project)  The identifier for this artifact that is unique within the group given by the group ID. An artifact is something that is either produced or used by a project. Examples of artifacts produced by Maven for a project include: JARs, source and binary distributions, and WARs.  E.g: android, mockito-all, junit
  • 8. The central repository  Online central repository which hosts all the dependencies  Can search from group-id, artifact-id, version  Can also download jars, pom, etc
  • 9. How to use?  POM (pom.xml) file is the main file all the xml data in it.  Dependent projects (if any) should also have pom  There are 3 major parts:  Add dependencies  add dependencies with local path  add dependencies of custom jars (not in maven)
  • 10. <build> <plugins> <plugin> <groupId>com.jayway.maven.plugins.android.generation2 </groupId> <artifactId>android-maven-plugin</artifactId> <version>3.8.0</version> <configuration> <sdk> <platform>8</platform></sdk> </configuration> </plugin> </plugins> </build>
  • 11. How to add dependencies<dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.10</version> <scope>test</scope> </dependency> </dependencies>
  • 12. Local .jar file  mvn install:install-file -DgroupId=com.personagraph -DartifactId=richinsights -Dversion=1.4 -Dpackaging=jar -Dfile=libs/AndroidSDK-1.4- SNAPSHOT.jar
  • 13. cmd  mvn clean  mvn test  mvn compile  mvn deploy
  • 14. Issues with Andriod  Maven 3.1.1 is required with Android version 3.8.0  Google-services aren’t supported  Create a local jar and include them
  • 15. References  http://maven.apache.org  http://en.wikipedia.org/wiki/Apache_Maven