SlideShare ist ein Scribd-Unternehmen logo
1 von 37
Advanced Maven
Prepared By : Smita Prasad
Topics to be covered
• Plugins
• Reporting
• Licenses
• Organization
• Developers
• Contributors
• Environment Settings
• Debugging
• Release Automation
• Developing a MOJO
Plugins
• Used for adding a Plugin
• Added via a small declaration, very similar to a
dependency, in the <build> section of your pom.xml
Plugins
Core
Clean
Compiler
Packaging
Ear
Ejb
Reporting
Changelog
Javadoc
Tool
Antrun
Help
IDE
Eclipse
Plugins Categorization
Common Plugins
Maven Help Plugin
• mvn help:describe -Dplugin=<anygoal>
‣ Lists and describes plugin goals.
• mvn help:system
‣ Outputs environment variables and system
properties.
• mvn help:active-profiles
‣ See what profiles are being triggered by
environment, files, params.
• mvn help:effective-pom
‣ Outputs the resultant pom.
‣ Includes inherited sections.
Exec Plugin
• Run any Java main class or external tool.
• Builds classpath from pom dependencies.
• Primarily used for testing.
$ mvn exec:java -Dexec.mainClass="com.foo.Main“
Reporting
• Specifically for the site generation phase
• Can generate reports
– Like Javadoc reports
Report Sets
• Example: to configure
the javadoc:javadoc goal
to link to
"http://java.sun.com/j2s
e/1.5.0/docs/api/", but
only the javadoc goal
(not the goal maven-
javadoc-plugin:jar).
• We would also like this
configuration passed to
its children, and
set inherited to true.
Used to configure execution of a report plugin's goals.
Lisences
Licenses are legal documents defining how and when a project
(or parts of a project) may be used.
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
</licenses>
Organization
Projects are run by some sort of organization (business, private group, etc.)
<organization>
<name>Codehaus Mojo</name>
<url>http://mojo.codehaus.org</url>
</organization>
Developers
Developers are presumably members of the project's core development.
<developers>
<developer>
<id>jdoe</id>
<name>John Doe</name>
<email>jdoe@example.com<email>
<url>http://www.example.com/jdoe</url>
<organization>ACME</organization>
<organizationUrl>http://www.example.com</organizationUrl>
<roles>
<role>architect</role>
<role>developer</role>
</roles>
<timezone>America/New_York</timezone>
<properties>
<picUrl>http://www.example.com/jdoe/pic</picUrl>
</properties>
</developer>
</developers>
Contributors
• Contributors are like developers yet play an ancillary role in a project's lifecycle.
Perhaps the contributor sent in a bug fix, or added some important documentation.
<contributors>
<contributor>
<name>Noelle</name>
<email>some.name@gmail.com</email>
<url>http://noellemarie.com</url>
<organization>Noelle Marie</organization>
<organizationUrl>http://noellemarie.com</organizationUrl>
<roles>
<role>tester</role>
</roles>
<timezone>America/Vancouver</timezone>
<properties>
<gtalk>some.name@gmail.com</gtalk>
</properties>
</contributor>
</contributors>
Environment Settings
Issue Management
• This defines the defect tracking system
(Bugzilla, TestTrack, ClearQuest, etc) used.
• Although there is nothing stopping a plugin from
using this information for something, its primarily
used for generating project documentation.
<issueManagement>
<system>Bugzilla</system>
<url>http://127.0.0.1/bugzilla/</url>
</issueManagement>
Continuous Integration Management
• Configurations within the POM for Continuous integration build systems based upon triggers or
timings (such as, hourly or daily)
• Example : A notifier of type mail and configuring the email address to use on the specified
triggers sendOnError, sendOnFailure, and not sendOnSuccess or sendOnWarning.
<ciManagement>
<system>continuum</system>
<url>http://127.0.0.1:8080/continuum</url>
<notifiers>
<notifier>
<type>mail</type>
<sendOnError>true</sendOnError>
<sendOnFailure>true</sendOnFailure>
<sendOnSuccess>false</sendOnSuccess>
<sendOnWarning>false</sendOnWarning>
<configuration><address>continuum@127.0.0.1</address></configuration>
</notifier>
</notifiers>
</ciManagement>
Mailing Lists
• Mailing lists are a great tool for keeping in touch with people about a
project.
<mailingLists>
<mailingList>
<name>User List</name>
<subscribe>user-subscribe@127.0.0.1</subscribe>
<unsubscribe>user-unsubscribe@127.0.0.1</unsubscribe>
<post>user@127.0.0.1</post>
<archive>http://127.0.0.1/user/</archive>
<otherArchives>
<otherArchive>http://base.google.com/base/1/127.0.0.1</otherArchive>
</otherArchives>
</mailingList>
</mailingLists>
Source Code Control Integration
• Seamlessly integrates Maven
• processes with your SCM repo.
‣ mvn scm:diff
‣ Creates UNIX diff file
‣ mvn scm:tag
‣ mvn scm:status
• Dozens of SCM systems supported.
‣ CVS
‣ Subversion
‣ Git
• mvn release:prepare
‣ Increments all pom.xml version tags.
<scm>
<connection>scm:svn:http://127.0.0.1/svn/my-project</connection>
<developerConnection>scm:svn:https://127.0.0.1/svn/my-project</developerConnection>
<tag>HEAD</tag>
<url>http://127.0.0.1/websvn/my-project</url>
</scm>
Repositories
• Repositories exist as a place to collect and
store artifacts.
• In order to be a Maven repository artifact,
a POM file must live within the structure
$BASE_REPO/groupId/artifactId/version/artifactI
d-version.pom.
– $BASE_REPO can be local (file structure) or
remote (base URL);
– the remaining layout will be the same.
Distribution Management
• Manages the distribution of the artifact and supporting files generated
throughout the build process.
• Starting with the last elements first
• Status is set by Maven – It can have values like
– None : Default
– Converted : Converted from another maven version
– Partner: Synched with a partner repository.
– Deployed: Artifact was deployed from a Maven 2 or 3 instance.
– Verified: Project has been verified, and should be considered
finalized
<distributionManagement>
...
<downloadUrl>http://mojo.codehaus.org/my-project</downloadUrl>
<status>deployed</status>
</distributionManagement>
Repository
<distributionManagement>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>corp1</id>
<name>Corporate Repository</name>
<url>scp://repo/maven2</url>
<layout>default</layout>
</repository>
<snapshotRepository>
<uniqueVersion>true</uniqueVersion>
<id>propSnap</id>
<name>Propellors Snapshots</name>
<url>sftp://propellers.net/maven</url>
<layout>legacy</layout>
</snapshotRepository>
...
</distributionManagement>
Site Distribution
<distributionManagement>
...
<site>
<id>mojo.website</id>
<name>Mojo Website</name>
<url>scp://beaver.codehaus.org/home/projects/mojo/pu
blic_html/</url>
</site>
...
</distributionManagement>
Profiles
• A new feature of the POM 4.0
• Ability of a project to change settings depending on the environment
where it is being built.
• A profile element contains both an optional activation (a profile trigger)
and the set of changes to be made to the POM if that profile has been
activated.
• Examples:
– A project built for a test environment may point to a different database than
that of the final deployment.
– Dependencies may be pulled from different repositories based upon the JDK
version used
Activation
• Activations are the key of a
profile.
• The power of a profile comes
from its ability to modify the
basic POM only under certain
circumstances.
• Those circumstances are
specified via
an activation element.
Debugging
• Exception Full Stack Traces
– If a Maven plugin is reporting an error, to see the full detail of the exception’s stack trace run
Maven with the -e flag.
mvn <yourgoal> -e
• Output Debugging Info
– Whenever reporting a Maven bug, or troubleshooting a problem, turn on all the debugging info
by running Maven like so:
mvn <yourgoal> -X
• Debug Maven Core/Plugins
– Core Maven operations and plugins can be stepped through with any compatible debugger, the
most common option being Eclipse. When run in debug mode, Maven will wait for you to
connect your debugger to socket port 8000 before continuing with its lifecycle.
mvnDebug <yourgoal>
• Debug a Unit Test
– Your suite or an individual unit test can be debugged by telling the Surefire test-execution plugin
– to wait for you to attach a debugger to port 5005.
mvn test -Dmaven.surefire.debug
Release Automation
Maven Enterprise Repository
Several options available
• Nexus
• Artifactory
• Archiva
• File server...
Release Cycle
• Using the Maven Release Plugin
• Audits your code...
– Check that there is no uncommitted code
– Check that there are no snapshot dependencies
– Prompts for release tag, branch and new version numbers
• ...then does the bookkeeping
– Updates version numbers to release versions
– Creates a new release tag in SCM
– Updates version numbers to next SNAPSHOT versions
– Commit these changes to SCM
• $ mvn release:perform
• Do the real work
– Checkout a release version
– Build, test and deploy to the Enterprise repository
– Requires a file called release.properties to be present within the
project root directory
Increase your MoJo-tivity
Developing MOJO
• MOJO is Maven plain Old Java Object
• It’s a Java Plugin
• Name your plugin <yourplugin>-maven-plugin
• Plugin maven project packaging should be
• Specify a class as Mojo by annotating it with @Mojo annotation
• And it has to be extended from AbstractMojo class
POM for the MOJO
MOJO
Executing the Mojo
• Specify the plugin goal directly on the command
line
mvn groupId:artifactId:version:goal
• For example, to run the simple mojo in the sample
plugin, you would enter
"mvn sample.plugin:hello-maven-plugin:1.0-SNAPSHOT:sayhi"
on the command line.
Thanks

Weitere ähnliche Inhalte

Was ist angesagt?

Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules uploadRyan Cuprak
 
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012Sam Brannen
 
Batching and Java EE (jdk.io)
Batching and Java EE (jdk.io)Batching and Java EE (jdk.io)
Batching and Java EE (jdk.io)Ryan Cuprak
 
DockerCon SF 2015: A New Model for Image Distribution
DockerCon SF 2015: A New Model for Image DistributionDockerCon SF 2015: A New Model for Image Distribution
DockerCon SF 2015: A New Model for Image DistributionDocker, Inc.
 
Java EE 8 Update
Java EE 8 UpdateJava EE 8 Update
Java EE 8 UpdateRyan Cuprak
 
Continuous Delivery with Jenkins
Continuous Delivery with JenkinsContinuous Delivery with Jenkins
Continuous Delivery with JenkinsJadson Santos
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with GradleRyan Cuprak
 
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012kennethaliu
 
Testing Java EE apps with Arquillian
Testing Java EE apps with ArquillianTesting Java EE apps with Arquillian
Testing Java EE apps with ArquillianIvan Ivanov
 
Cd with Github Travis CI and Heroku
Cd with Github Travis CI and HerokuCd with Github Travis CI and Heroku
Cd with Github Travis CI and HerokuJadson Santos
 
Java 9 and the impact on Maven Projects (Devoxx 2016)
Java 9 and the impact on Maven Projects (Devoxx 2016)Java 9 and the impact on Maven Projects (Devoxx 2016)
Java 9 and the impact on Maven Projects (Devoxx 2016)Robert Scholte
 
Workshop Framework(J2EE/OSGi/RCP)
Workshop Framework(J2EE/OSGi/RCP)Workshop Framework(J2EE/OSGi/RCP)
Workshop Framework(J2EE/OSGi/RCP)Summer Lu
 
20171108 PDN HOL React Basics
20171108 PDN HOL React Basics20171108 PDN HOL React Basics
20171108 PDN HOL React BasicsRich Ross
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot IntroductionJeevesh Pandey
 
Database Migrations with Gradle and Liquibase
Database Migrations with Gradle and LiquibaseDatabase Migrations with Gradle and Liquibase
Database Migrations with Gradle and LiquibaseDan Stine
 

Was ist angesagt? (20)

Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
 
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
 
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
 
Batching and Java EE (jdk.io)
Batching and Java EE (jdk.io)Batching and Java EE (jdk.io)
Batching and Java EE (jdk.io)
 
DockerCon SF 2015: A New Model for Image Distribution
DockerCon SF 2015: A New Model for Image DistributionDockerCon SF 2015: A New Model for Image Distribution
DockerCon SF 2015: A New Model for Image Distribution
 
Java EE 8 Update
Java EE 8 UpdateJava EE 8 Update
Java EE 8 Update
 
Maven
MavenMaven
Maven
 
Gradle - Build System
Gradle - Build SystemGradle - Build System
Gradle - Build System
 
Continuous Delivery with Jenkins
Continuous Delivery with JenkinsContinuous Delivery with Jenkins
Continuous Delivery with Jenkins
 
Apache Lucene for Java EE Developers
Apache Lucene for Java EE DevelopersApache Lucene for Java EE Developers
Apache Lucene for Java EE Developers
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
 
Testing Java EE apps with Arquillian
Testing Java EE apps with ArquillianTesting Java EE apps with Arquillian
Testing Java EE apps with Arquillian
 
Cd with Github Travis CI and Heroku
Cd with Github Travis CI and HerokuCd with Github Travis CI and Heroku
Cd with Github Travis CI and Heroku
 
Java 9 and the impact on Maven Projects (Devoxx 2016)
Java 9 and the impact on Maven Projects (Devoxx 2016)Java 9 and the impact on Maven Projects (Devoxx 2016)
Java 9 and the impact on Maven Projects (Devoxx 2016)
 
Workshop Framework(J2EE/OSGi/RCP)
Workshop Framework(J2EE/OSGi/RCP)Workshop Framework(J2EE/OSGi/RCP)
Workshop Framework(J2EE/OSGi/RCP)
 
20171108 PDN HOL React Basics
20171108 PDN HOL React Basics20171108 PDN HOL React Basics
20171108 PDN HOL React Basics
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
 
Angular beans
Angular beansAngular beans
Angular beans
 
Database Migrations with Gradle and Liquibase
Database Migrations with Gradle and LiquibaseDatabase Migrations with Gradle and Liquibase
Database Migrations with Gradle and Liquibase
 

Ähnlich wie Maven advanced

Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulMert Çalışkan
 
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.Richard Langlois P. Eng.
 
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 DevOpsSISTechnologies
 
Training in Android with Maven
Training in Android with MavenTraining in Android with Maven
Training in Android with MavenArcadian Learning
 
Enterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudEnterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudCarlos Sanchez
 
Continuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenContinuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenAlan Parkinson
 
Maven introduction in Mule
Maven introduction in MuleMaven introduction in Mule
Maven introduction in MuleShahid Shaik
 
Apache maven, a software project management tool
Apache maven, a software project management toolApache maven, a software project management tool
Apache maven, a software project management toolRenato Primavera
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenMert Çalışkan
 

Ähnlich wie Maven advanced (20)

Maven
MavenMaven
Maven
 
Releasing Projects Using Maven
Releasing Projects Using MavenReleasing Projects Using Maven
Releasing Projects Using Maven
 
Apache Maven basics
Apache Maven basicsApache Maven basics
Apache Maven basics
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
 
Maven
MavenMaven
Maven
 
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
 
Maven basic concept
Maven basic conceptMaven basic concept
Maven basic concept
 
Maven in Mule
Maven in MuleMaven in Mule
Maven in Mule
 
Training in Android with Maven
Training in Android with MavenTraining in Android with Maven
Training in Android with Maven
 
Enterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudEnterprise Build And Test In The Cloud
Enterprise Build And Test In The Cloud
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
4 maven junit
4 maven junit4 maven junit
4 maven junit
 
Continuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenContinuous Deployment Pipeline with maven
Continuous Deployment Pipeline with maven
 
Build system
Build systemBuild system
Build system
 
Maven
MavenMaven
Maven
 
Maven introduction in Mule
Maven introduction in MuleMaven introduction in Mule
Maven introduction in Mule
 
Apache maven, a software project management tool
Apache maven, a software project management toolApache maven, a software project management tool
Apache maven, a software project management tool
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with Maven
 

Mehr von Smita Prasad

Spring @Transactional Explained
Spring @Transactional ExplainedSpring @Transactional Explained
Spring @Transactional ExplainedSmita Prasad
 
Learn Apache Shiro
Learn Apache ShiroLearn Apache Shiro
Learn Apache ShiroSmita Prasad
 
PostgreSQL- An Introduction
PostgreSQL- An IntroductionPostgreSQL- An Introduction
PostgreSQL- An IntroductionSmita Prasad
 
Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - ExplainedSmita Prasad
 

Mehr von Smita Prasad (6)

Intro to React.js
Intro to React.jsIntro to React.js
Intro to React.js
 
Spring @Transactional Explained
Spring @Transactional ExplainedSpring @Transactional Explained
Spring @Transactional Explained
 
Learn Apache Shiro
Learn Apache ShiroLearn Apache Shiro
Learn Apache Shiro
 
Clean code
Clean codeClean code
Clean code
 
PostgreSQL- An Introduction
PostgreSQL- An IntroductionPostgreSQL- An Introduction
PostgreSQL- An Introduction
 
Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - Explained
 

Kürzlich hochgeladen

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 

Kürzlich hochgeladen (20)

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 

Maven advanced

  • 1. Advanced Maven Prepared By : Smita Prasad
  • 2. Topics to be covered • Plugins • Reporting • Licenses • Organization • Developers • Contributors • Environment Settings • Debugging • Release Automation • Developing a MOJO
  • 3. Plugins • Used for adding a Plugin • Added via a small declaration, very similar to a dependency, in the <build> section of your pom.xml
  • 6. Maven Help Plugin • mvn help:describe -Dplugin=<anygoal> ‣ Lists and describes plugin goals. • mvn help:system ‣ Outputs environment variables and system properties. • mvn help:active-profiles ‣ See what profiles are being triggered by environment, files, params. • mvn help:effective-pom ‣ Outputs the resultant pom. ‣ Includes inherited sections.
  • 7. Exec Plugin • Run any Java main class or external tool. • Builds classpath from pom dependencies. • Primarily used for testing. $ mvn exec:java -Dexec.mainClass="com.foo.Main“
  • 8. Reporting • Specifically for the site generation phase • Can generate reports – Like Javadoc reports
  • 9. Report Sets • Example: to configure the javadoc:javadoc goal to link to "http://java.sun.com/j2s e/1.5.0/docs/api/", but only the javadoc goal (not the goal maven- javadoc-plugin:jar). • We would also like this configuration passed to its children, and set inherited to true. Used to configure execution of a report plugin's goals.
  • 10. Lisences Licenses are legal documents defining how and when a project (or parts of a project) may be used. <licenses> <license> <name>Apache License, Version 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> <distribution>repo</distribution> <comments>A business-friendly OSS license</comments> </license> </licenses>
  • 11. Organization Projects are run by some sort of organization (business, private group, etc.) <organization> <name>Codehaus Mojo</name> <url>http://mojo.codehaus.org</url> </organization>
  • 12. Developers Developers are presumably members of the project's core development. <developers> <developer> <id>jdoe</id> <name>John Doe</name> <email>jdoe@example.com<email> <url>http://www.example.com/jdoe</url> <organization>ACME</organization> <organizationUrl>http://www.example.com</organizationUrl> <roles> <role>architect</role> <role>developer</role> </roles> <timezone>America/New_York</timezone> <properties> <picUrl>http://www.example.com/jdoe/pic</picUrl> </properties> </developer> </developers>
  • 13. Contributors • Contributors are like developers yet play an ancillary role in a project's lifecycle. Perhaps the contributor sent in a bug fix, or added some important documentation. <contributors> <contributor> <name>Noelle</name> <email>some.name@gmail.com</email> <url>http://noellemarie.com</url> <organization>Noelle Marie</organization> <organizationUrl>http://noellemarie.com</organizationUrl> <roles> <role>tester</role> </roles> <timezone>America/Vancouver</timezone> <properties> <gtalk>some.name@gmail.com</gtalk> </properties> </contributor> </contributors>
  • 15. Issue Management • This defines the defect tracking system (Bugzilla, TestTrack, ClearQuest, etc) used. • Although there is nothing stopping a plugin from using this information for something, its primarily used for generating project documentation. <issueManagement> <system>Bugzilla</system> <url>http://127.0.0.1/bugzilla/</url> </issueManagement>
  • 16. Continuous Integration Management • Configurations within the POM for Continuous integration build systems based upon triggers or timings (such as, hourly or daily) • Example : A notifier of type mail and configuring the email address to use on the specified triggers sendOnError, sendOnFailure, and not sendOnSuccess or sendOnWarning. <ciManagement> <system>continuum</system> <url>http://127.0.0.1:8080/continuum</url> <notifiers> <notifier> <type>mail</type> <sendOnError>true</sendOnError> <sendOnFailure>true</sendOnFailure> <sendOnSuccess>false</sendOnSuccess> <sendOnWarning>false</sendOnWarning> <configuration><address>continuum@127.0.0.1</address></configuration> </notifier> </notifiers> </ciManagement>
  • 17. Mailing Lists • Mailing lists are a great tool for keeping in touch with people about a project. <mailingLists> <mailingList> <name>User List</name> <subscribe>user-subscribe@127.0.0.1</subscribe> <unsubscribe>user-unsubscribe@127.0.0.1</unsubscribe> <post>user@127.0.0.1</post> <archive>http://127.0.0.1/user/</archive> <otherArchives> <otherArchive>http://base.google.com/base/1/127.0.0.1</otherArchive> </otherArchives> </mailingList> </mailingLists>
  • 18. Source Code Control Integration • Seamlessly integrates Maven • processes with your SCM repo. ‣ mvn scm:diff ‣ Creates UNIX diff file ‣ mvn scm:tag ‣ mvn scm:status • Dozens of SCM systems supported. ‣ CVS ‣ Subversion ‣ Git • mvn release:prepare ‣ Increments all pom.xml version tags. <scm> <connection>scm:svn:http://127.0.0.1/svn/my-project</connection> <developerConnection>scm:svn:https://127.0.0.1/svn/my-project</developerConnection> <tag>HEAD</tag> <url>http://127.0.0.1/websvn/my-project</url> </scm>
  • 19. Repositories • Repositories exist as a place to collect and store artifacts. • In order to be a Maven repository artifact, a POM file must live within the structure $BASE_REPO/groupId/artifactId/version/artifactI d-version.pom. – $BASE_REPO can be local (file structure) or remote (base URL); – the remaining layout will be the same.
  • 20.
  • 21. Distribution Management • Manages the distribution of the artifact and supporting files generated throughout the build process. • Starting with the last elements first • Status is set by Maven – It can have values like – None : Default – Converted : Converted from another maven version – Partner: Synched with a partner repository. – Deployed: Artifact was deployed from a Maven 2 or 3 instance. – Verified: Project has been verified, and should be considered finalized <distributionManagement> ... <downloadUrl>http://mojo.codehaus.org/my-project</downloadUrl> <status>deployed</status> </distributionManagement>
  • 24. Profiles • A new feature of the POM 4.0 • Ability of a project to change settings depending on the environment where it is being built. • A profile element contains both an optional activation (a profile trigger) and the set of changes to be made to the POM if that profile has been activated. • Examples: – A project built for a test environment may point to a different database than that of the final deployment. – Dependencies may be pulled from different repositories based upon the JDK version used
  • 25. Activation • Activations are the key of a profile. • The power of a profile comes from its ability to modify the basic POM only under certain circumstances. • Those circumstances are specified via an activation element.
  • 26. Debugging • Exception Full Stack Traces – If a Maven plugin is reporting an error, to see the full detail of the exception’s stack trace run Maven with the -e flag. mvn <yourgoal> -e • Output Debugging Info – Whenever reporting a Maven bug, or troubleshooting a problem, turn on all the debugging info by running Maven like so: mvn <yourgoal> -X • Debug Maven Core/Plugins – Core Maven operations and plugins can be stepped through with any compatible debugger, the most common option being Eclipse. When run in debug mode, Maven will wait for you to connect your debugger to socket port 8000 before continuing with its lifecycle. mvnDebug <yourgoal> • Debug a Unit Test – Your suite or an individual unit test can be debugged by telling the Surefire test-execution plugin – to wait for you to attach a debugger to port 5005. mvn test -Dmaven.surefire.debug
  • 28. Maven Enterprise Repository Several options available • Nexus • Artifactory • Archiva • File server...
  • 29. Release Cycle • Using the Maven Release Plugin • Audits your code... – Check that there is no uncommitted code – Check that there are no snapshot dependencies – Prompts for release tag, branch and new version numbers • ...then does the bookkeeping – Updates version numbers to release versions – Creates a new release tag in SCM – Updates version numbers to next SNAPSHOT versions – Commit these changes to SCM
  • 30. • $ mvn release:perform • Do the real work – Checkout a release version – Build, test and deploy to the Enterprise repository – Requires a file called release.properties to be present within the project root directory
  • 32. Developing MOJO • MOJO is Maven plain Old Java Object • It’s a Java Plugin • Name your plugin <yourplugin>-maven-plugin • Plugin maven project packaging should be • Specify a class as Mojo by annotating it with @Mojo annotation • And it has to be extended from AbstractMojo class
  • 33. POM for the MOJO
  • 34. MOJO
  • 35. Executing the Mojo • Specify the plugin goal directly on the command line mvn groupId:artifactId:version:goal • For example, to run the simple mojo in the sample plugin, you would enter "mvn sample.plugin:hello-maven-plugin:1.0-SNAPSHOT:sayhi" on the command line.
  • 36.