Вы находитесь на странице: 1из 18

Maven & Nexus

A Project Dependency Solution

Alan Preston
Lyndon Washington
Marcel Thibault
Agenda

• Demo: Showing the Refactored Workflow Build


• Demo: Creating a Jar project
• Explanation of What Was Just Shown
– Dependency Landscape
– What is Maven
– What is Nexus
• Q&A

2 © Novell, Inc. All rights reserved.


Project Build With Maven

• Pom build recipe


• VCS for Source artifacts
• Maven repositories for
libraries.

3 © Novell, Inc. All rights reserved.


VCS Dependency Resolution Solution

• Maintain a reproducible
build
• Rely on dependencies to
be stored and versioned
in the repository

4 © Novell, Inc. All rights reserved.


Maven Dependency Resolution
Solution
• Builds rely on artifacts to
be stored and versioned
in Maven repository
• Artifacts can come from
remote repo's.
• Artifacts can come from
local builds.

5 © Novell, Inc. All rights reserved.


Maven Details
Project Object Model

• Project ID provides
“coordinates”
• Dependencies can be
scoped (runtime, compile,
test).
• Plugins can perform new
build activities.
• Repo details can specify
locations to deploy.
• Possible to generate
“site” report about the
project and build.
7 © Novell, Inc. All rights reserved.
Maven Life Cycle: Default

8 © Novell, Inc. All rights reserved.


Maven Life Cycle: Clean & Site

9 © Novell, Inc. All rights reserved.


Archetypes (Project Structures)

• Template structure
• Includes project artifact
type.
• Test contains unit-test
source and resources
• Target contains
generated artifacts
• Able to create your own
archetypes

10 © Novell, Inc. All rights reserved.


Maven Plugin

• Contain maven
“coordinates”.
• Are made up of Mojos
that do specific tasks.
• Mojos can be bound to
default life cycle phases.
• Mojos Can require a
project or execute
independently
• Mojos can take
parameters (derived or
supplied).
11 © Novell, Inc. All rights reserved.
Nexus Details
Before Nexus

• Workstation maintains
separate links to repos.
• Repos are static http
resources.
• Hierarchy is based on
groupId

13 © Novell, Inc. All rights reserved.


Using Nexus

• Department repos are


Nexus instances
• Nexus proxies and
caches for other repos
• Provides an enforcement
layer.
• Requires local maven to
be configured to use
Nexus (settings.xml).

14 © Novell, Inc. All rights reserved.


Q&A
Interesting Links
• Maven: The Complete Reference
– http://www.sonatype.com/books/mvnref-book/reference/public-book.html
• Codehaus Mojo Site
– http://mojo.codehaus.org/
• m2Eclipse Site
– http://m2eclipse.sonatype.org/
• Department Nexus Server
– http://ulna.qalab.cam.novell.com:8081/nexus/index.html
• Worflow Refactor Teaming Site
– https://teaming.innerweb.novell.com/teaming/workspace/osgi-workflow

16 © Novell, Inc. All rights reserved.


Unpublished Work of Novell, Inc. All Rights Reserved.
This work is an unpublished work and contains confidential, proprietary, and trade secret information of Novell, Inc.
Access to this work is restricted to Novell employees who have a need to know to perform tasks within the scope
of their assignments. No part of this work may be practiced, performed, copied, distributed, revised, modified,
translated, abridged, condensed, expanded, collected, or adapted without the prior written consent of Novell, Inc.
Any use or exploitation of this work without authorization could subject the perpetrator to criminal and civil liability.

General Disclaimer
This document is not to be construed as a promise by any participating company to develop, deliver, or market a
product. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in
making purchasing decisions. Novell, Inc. makes no representations or warranties with respect to the contents
of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any
particular purpose. The development, release, and timing of features or functionality described for Novell products
remains at the sole discretion of Novell. Further, Novell, Inc. reserves the right to revise this document and to
make changes to its content, at any time, without obligation to notify any person or entity of such revisions or
changes. All Novell marks referenced in this presentation are trademarks or registered trademarks of Novell, Inc.
in the United States and other countries. All third-party trademarks are the property of their respective owners.

Вам также может понравиться