1 / 40

M a ven

M a ven. prepared by hasan.we4tech.com. What is maven?. Java based project management tool. Automated software build management tool. Repository centric dependent library resolution. Project status reporting tool Project documenting tool Product release management tool

washi
Download Presentation

M a ven

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Maven prepared by hasan.we4tech.com

  2. What is maven?

  3. Java based project management tool. • Automated software build management tool. • Repository centric dependent library resolution. • Project status reporting tool • Project documenting tool • Product release management tool • Configuration management supporting tool

  4. Why is maven?

  5. Java based project management. • Project document management. • Project status report management. • Project goal wise module separation tool. • Company wide snapshot or release repository • Better product and module centric approach. • Easy to use

  6. Typical project iteration

  7. Where is maven?

  8. How can maven helps on development?

  9. Making build process much easier. • Dependency management • Centralizing module dependency. • Maintaining a standard project layout. • Generating report on broken code, broken coding convention, unit test code coverage etc…

  10. Dependency management!

  11. Centralizing module dependency!!

  12. Standard project layout!!

  13. What is maven repository?

  14. Build a sample project

  15. Mavenized terms

  16. What is POM (Project Object Model)? • What is artifact? • What is group? • What is archetype? • What is goal? • What is dependency?

  17. POM

  18. Goal • mvn package • mvn compile • mvn clean • mvn test • mvn javadoc:javadoc • mvn site • …

  19. Dependency <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies>

  20. Maven phases

  21. validate • generate-sources • process-sources • generate-resources • process-resources • compile

  22. Typical goals and usages

  23. Create parent project POM file. • Create a new maven project • Create a web application module • Generate intelliJ IDEA project files • Packaging whole project

  24. Create parent project POM file. <?xml version="1.0" encoding="UTF-8"?> <project> <modelVersion>4.0.0</modelVersion><groupId>com.company.project</groupId> <artifactId>project-parent</artifactId><packaging>pom</packaging> <version>1.0-SNAPSHOT</version> <name>project name</name> <modules> <!--module>project-core</module--> </modules> <!-- somewhere in repository --> <repositories> <repository> <id>somewherein</id> <url>http://maven.somewherein.net/</url> </repository> </repositories> <dependencies> <dependency> <artifactId>xom</artifactId> <groupId>xom</groupId> <version>1.1</version> </dependency> </dependencies> </project>

  25. Create a new maven project mvn archetype:create \ –DgroupId=com.company.project \ –DartifactId=project-core

  26. Create a new web application module mvn archetype:create \ –DgroupId=com.company.project \ –DartifactId=project-core \ –DarchetypeArtifactId=maven-archetype-webapp

  27. Generate intelliJ IDEA or eclipse project files mvn idea:idea Or mvn eclipse:eclipse

  28. Packaging whole project mvn install Or mvn package

  29. Configure somewhere repository • Go to maven_home/conf/settings.xml • Set the following line – • <localRepository>\\192.168.1.254\software\24_maven_repository</localRepository>

  30. How to find artifact? • Search google – i.e : maven xom • Manually browse public repository • http://ibiblio.org/maven/ • http://repo1.maven.org/maven2/ • http://maven.somewherein.net • [directory indexing is not enabled]

  31. How to use somewhere in Continuous build server?

  32. Changes on your pom file. <ciManagement> <system>continuum</system> <notifiers> <notifier> <type>mail</type> <configuration> <address>hasan@somewherein.net</address> </configuration> </notifier> </notifiers> </ciManagement> <scm> <connection>svn://host/os/project/trunk/</connection> <developerConnection>svn://somewhereindhaka.net/os/ideabase/idea_content_repo/trunk/development</developerConnection> <tag>HEAD</tag> <url>http://somewhereindhaka.net/os/ideabase/idea_content_repo/trunk/development</url> </scm>

  33. Go to (ask me for url) continuum server url • Login using user and password (ask me if you need user and password) • Select “maven 2.0+ project” from right side menu. • Give your maven pom file url from. i.e – http://host/svn/project/pom.xml

  34. That’s all :D

  35. Thank you every one and those who brought such a nice tool

More Related