Maven
Hussain Mansoor
Folio3 (26 Feb 2014)
Maven defined
 Declarative Dependencies
 External modules
 Build Order
 Directories
 Plug-ins
 Build Management
 Do...
Support
 Languages
 Primarily Java
 C#, Ruby, Scala
 IDEs
 Eclipse, NetBeans, IntelliJ (by default), Jbuilder,
Jdevel...
Build Life cycle
 process-resources
 compile
 process-test-resources
 test-compile
 test
 package
 install
 deploy
 <modelVersion>4.0.0</modelVersion>
 <groupId>com.project</groupId>
 <artifactId>Project</artifactId>
 <version>1.1</v...
 Dependencies
 Scope
 compile, runtime, test, system, and provided
 System path
 Local path, deprecated
 groupId
 a...
Tags defined
• A universally unique identifier for a project. It is
normal to use a fully-qualified package name to
distin...
The central repository
 Online central repository which hosts all the
dependencies
 Can search from group-id, artifact-i...
How to use?
 POM (pom.xml) file is the main file all the xml data
in it.
 Dependent projects (if any) should also have
p...
<build>
<plugins> <plugin>
<groupId>com.jayway.maven.plugins.android.generation2
</groupId>
<artifactId>android-maven-plug...
How to add
dependencies<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</...
Local .jar file
 mvn install:install-file
-DgroupId=com.personagraph
-DartifactId=richinsights
-Dversion=1.4
-Dpackaging=...
cmd
 mvn clean
 mvn test
 mvn compile
 mvn deploy
Issues with Andriod
 Maven 3.1.1 is required with Android version 3.8.0
 Google-services aren’t supported
 Create a loc...
References
 http://maven.apache.org
 http://en.wikipedia.org/wiki/Apache_Maven
Maven basics (Android & IntelliJ)
Maven basics (Android & IntelliJ)
Upcoming SlideShare
Loading in …5
×

Maven basics (Android & IntelliJ)

1,581 views

Published on

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
1,581
On SlideShare
0
From Embeds
0
Number of Embeds
583
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Maven basics (Android & IntelliJ)

  1. 1. Maven Hussain Mansoor Folio3 (26 Feb 2014)
  2. 2. Maven defined  Declarative Dependencies  External modules  Build Order  Directories  Plug-ins  Build Management  Downloads dependencies and maintains local cache
  3. 3. Support  Languages  Primarily Java  C#, Ruby, Scala  IDEs  Eclipse, NetBeans, IntelliJ (by default), Jbuilder, Jdeveloper, MyEclipse…
  4. 4. Build Life cycle  process-resources  compile  process-test-resources  test-compile  test  package  install  deploy
  5. 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. 6.  Dependencies  Scope  compile, runtime, test, system, and provided  System path  Local path, deprecated  groupId  artifactId  Packaging  apk, jar, …
  7. 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. 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. 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. 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. 11. How to add dependencies<dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.10</version> <scope>test</scope> </dependency> </dependencies>
  12. 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. 13. cmd  mvn clean  mvn test  mvn compile  mvn deploy
  14. 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. 15. References  http://maven.apache.org  http://en.wikipedia.org/wiki/Apache_Maven

×