Download presentation
Presentation is loading. Please wait.
1
prepared by hasan.we4tech.com
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
8
Where is maven?
10
How can maven helps on development?
11
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…
12
Dependency management!
14
Centralizing module dependency!!
16
Standard project layout!!
18
What is maven repository?
19
Build a sample project
20
Mavenized terms
21
What is POM (Project Object Model)?
What is artifact? What is group? What is archetype? What is goal? What is dependency?
22
POM
23
Goal mvn package mvn compile mvn clean mvn test mvn javadoc:javadoc
mvn site …
24
Dependency <dependencies> <dependency>
<groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies>
25
Maven phases
26
validate generate-sources process-sources generate-resources process-resources compile
27
Typical goals and usages
28
Create parent project POM file.
Create a new maven project Create a web application module Generate intelliJ IDEA project files Packaging whole project
29
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> </repository> </repositories> <dependencies> <dependency> <artifactId>xom</artifactId> <groupId>xom</groupId> <version>1.1</version> </dependency> </dependencies> </project>
30
Create a new maven project
mvn archetype:create \ –DgroupId=com.company.project \ –DartifactId=project-core
31
Create a new web application module
mvn archetype:create \ –DgroupId=com.company.project \ –DartifactId=project-core \ –DarchetypeArtifactId=maven-archetype-webapp
32
Generate intelliJ IDEA or eclipse project files
mvn idea:idea Or mvn eclipse:eclipse
33
Packaging whole project
mvn install Or mvn package
34
Configure somewhere repository
Go to maven_home/conf/settings.xml Set the following line – <localRepository>\\ \software\24_maven_repository</localRepository>
35
How to find artifact? Search google – i.e : maven xom
Manually browse public repository [directory indexing is not enabled]
36
How to use somewhere in Continuous build server?
37
Changes on your pom file.
<ciManagement> <system>continuum</system> <notifiers> <notifier> <type>mail</type> <configuration> </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> </scm>
38
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 –
39
That’s all :D
40
Thank you every one and those who brought such a nice tool
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.