Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering Apache Maven 3
  • Table Of Contents Toc
Mastering Apache Maven 3

Mastering Apache Maven 3

By : Prabath Siriwardena
4.3 (3)
close
close
Mastering Apache Maven 3

Mastering Apache Maven 3

4.3 (3)
By: Prabath Siriwardena

Overview of this book

If you are working with Java or Java EE projects and you want to take full advantage of Maven in designing, executing, and maintaining your build system for optimal developer productivity, then this book is ideal for you. You should be well versed with Maven and its basic functionality if you wish to get the most out of the book.
Table of Contents (11 chapters)
close
close
10
Index

Plexus


Most of you might be familiar with Spring but not Plexus. Plexus provides an Inversion of Control (IoC) or a Dependency Injection (DI) framework similar to Spring. If you are new to the concept of Dependency Injection, it's highly recommended that you go through the article by Martin Fowler, Inversion of Control Containers and the Dependency Injection pattern at http://martinfowler.com/articles/injection.html.

Forget about Maven for a bit; let's see how to implement Dependency Injection with Plexus with the following steps:

  1. First, we need to define our own Java interface for our business service as follows. There can be more than one implementation of this service:

    package com.packt.di;
    public interface MessagingService {
    
      public void sendMessage(String recipient, String message);
    }
  2. Let's write a couple of implementations for the previous interface. The SMSMessagingService class will text the message to the recipient while the EmailMessagingService class will email the message, shown...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Mastering Apache Maven 3
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon