Mastering Apache Maven 3
eBook - ePub

Mastering Apache Maven 3

Prabath Siriwardena

Buch teilen
  1. 298 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Mastering Apache Maven 3

Prabath Siriwardena

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

Maven is the number one build tool used by developers for more than a decade. Maven stands out among other build tools due to its extremely extensible architecture, which is built on top of the concept "convention over configuration". This has made Maven the de-facto tool used to manage and build Java projects.

This book is a technical guide to the difficult and complex concepts in Maven and build automation. It starts with the core Maven concepts and its architecture, and then explains how to build extensions such as plugins, archetypes, and lifecycles in depth.

This book is a step-by-step guide that shows you how to use Apache Maven in an optimal way to address your enterprise build requirements.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Mastering Apache Maven 3 als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Mastering Apache Maven 3 von Prabath Siriwardena im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Computer Science & Programming in Java. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2014
ISBN
9781783983865

Mastering Apache Maven 3


Table of Contents

Mastering Apache Maven 3
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Apache Maven Quick Start
A quick introduction
Installing Apache Maven
Installing Apache Maven on Ubuntu
Installing Apache Maven on Mac OS X
Installing Apache Maven on Microsoft Windows
Configuring the heap size
Monitoring the build
Remote debugging
Convention over configuration
IDE integration
NetBeans integration
IntelliJ IDEA integration
Eclipse integration
Troubleshooting
Enabling Maven debug-level logs
Building dependency tree
Viewing all environment variables and system properties
Viewing the effective POM file
Viewing the dependency classpath
Summary
2. Demystifying Project Object Model
Project Object Model
The POM hierarchy
Super POM
POM extending and overriding
Maven coordinates
Parent POM file
Managing POM dependencies
Transitive dependencies
Dependency scopes
Optional dependencies
Dependency exclusion
Summary
3. Maven Configuration
Maven Wagon
Wagon HTTP(S) transport
Wagon system properties
Proxy authentication
Secured repositories
Encrypting credentials in settings.xml
Source Control Management systems
Maven with Subversion
Local repository location
Mirrored repositories
The internal corporate repository
Advanced mirror configurations
Deploying artifacts
Deploying file-based artifacts
Deploying SSH-based artifacts
Deploying FTP-based artifacts
Enabling Maven logging
Summary
4. Build Lifecycles
Standard lifecycles in Maven
The clean lifecycle
The default lifecycle
The site lifecycle
Lifecycle bindings
Building a custom lifecycle
Lifecycle extensions
Summary
5. Maven Plugins
Common Maven plugins
The clean plugin
The compiler plugin
The install plugin
The deploy plugin
The surefire plugin
The site plugin
The jar plugin
The source plugin
The resources plugin
The release plugin
Plugin discovery and execution
Plugin management
Plugin repositories
Plugin as an extension
Plexus
Maven and Dependency Injection
Google Guice
Developing custom plugins
Associating a plugin with a lifecycle
The plugin execution order
Inside the execute method
Summary
6. Maven Assemblies
The assembly plugin
The assembly descriptor
Artifact/resource filtering
Assembly help
A runnable, standalone Maven project
Summary
7. Maven Archetypes
Archetype quickstart
The batch mode
Archetype catalogues
Building an archetype catalogue
Public archetype catalogues
The anatomy of archetype-catalog.xml
The archetype plugin goals
Maven plugins with the archetype plugin
Java EE web applications with the archetype plugin
Deploying web applications to a remote Apache Tomcat server
Android mobile applications with the archetype plugin
EJB archives with the archetype plugin
JIRA plugins with the archetype plugin
Spring MVC applications with the archetype plugin
Building a custom archetype
The archetype descriptor
Generating a multimodule Maven project
archetype:create-from-project with custom properties
Summary
8. Maven Repository Management
Maven repositories
The update policy
Multiple repositories
Repositories in settings.xml
The Maven repository manager
Repository management with Nexus
Installing and running Nexus
Creating a hosted repository
Creating a proxy repository
Creating a virtual repository
Blocking selected artifacts
Inclusive and exclusive routing
Scheduled tasks
Artifact indexing
Nexus plugins
A repository metadata model
Summary
9. Best Practices
Dependency management
Defining a parent module
POM properties
Avoiding repetitive groupId and version tags and inherit from the parent POM
Following naming conventions
Maven profiles
Think twice before you write your own plugin
The Maven release plugin
The Maven enforcer plugin
Avoid using un-versioned plugins
Using exclusive and inclusive routes
Avoid having both release and snapshot repositories in the same group repository
Avoid having both proxy and hosted repositories in the same group repository
Minimizing the number of repositories
Using mirrorOf instead of changing repository URLs
Descriptive parent POM files
Documentation is your friend
Avoid overriding the default directory structure
Using SNAPSHOT versioning during development
Get rid of unused dependencies
Avoid keeping credentials in application POM files
Avoid using deprecated references
Avoid repetition – use archetypes
Avoid using maven.test.skip
Share resources – avoid duplicates
Summary
Index

Mastering Apache Maven 3

Copyright © 2014 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: December 2014
Production reference: 1221214
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78398-386-5
www.packtpub.com

Credits

Author
Prabath Siriwardena
Reviewers
Petri Kainulainen
Michał Kozik
Pavithra Gunasekara
Sagara Gunathunga
Bhavani P Polimetla
Commissioning Editor
Akram Hussain
Acquisition Editor
Subho Gupta
Content Development Editor
Ruchita Bhansali
Technical Editors
Shubhangi Dhamgaye
Shweta Pant
Mohita Vyas
Project Coordinator
Kranti Berde
Copy Editors
Roshni Banerjee
Deepa Nambiar
Rashmi Sawant
Proofreaders
Simran Bhogal
Mario Cecere
Lucy Rowland
Indexer
Tejal Soni
Graphics
Valentina D'silva
Abhinash Sahu
Production Coordinator
Manu Joseph
Cover Work
Manu Joseph

About the Author

Prabath Siriwardena is the Director of Security Architecture at WSO2 Inc., a company...

Inhaltsverzeichnis