Repository Management and Sonatype Nexus. Repository Management and Sonatype Nexus

Similar documents
Nexus for Component Management. Nexus for Component Management

Sonatype CLM Enforcement Points - Nexus. Sonatype CLM Enforcement Points - Nexus

Repository Management with Nexus

Topics covered. Introduction to Maven Maven for Dependency Management Maven Lifecycles and Plugins Hands on session. Maven 2

Apache Maven MarsJUG. Arnaud Héritier exo platform Software Factory Manager

Repository Management with Nexus

Repository Management with Nexus

MAVEN MOCK TEST MAVEN MOCK TEST I

Maven Introduction to Concepts: POM, Dependencies, Plugins, Phases

What is Maven? Apache Maven is a software project management and comprehension tool (build, test, packaging, reporting, site, deploy).

Maven POM project modelversion groupid artifactid packaging version name

Maven. INF5750/ Lecture 2 (Part II)

MAVEN INTERVIEW QUESTIONS

Component based Development. Table of Contents. Notes. Notes. Notes. Web Application Development. Zsolt Tóth

Sonatype CLM - CI User Guide. Sonatype CLM - CI User Guide

Apache Maven: Best Practices

The Actual Real World at EclipseCon/ALM

Simplified Build Management with Maven

Content. Development Tools 2(57)

Sonatype CLM - IDE User Guide. Sonatype CLM - IDE User Guide

Administering Apache Geronimo With Custom Server Assemblies and Maven. David Jencks

Apache Maven. Created by anova r&d bvba

Red Hat Fuse 7.0 Installing on Apache Karaf

I Got My Mojo Workin'

DevOps and Maven. Eamonn de Leastar Dr. Siobhán Drohan Produced by:

MAVEN MOCK TEST MAVEN MOCK TEST IV

Hello Maven. TestNG, Eclipse, IntelliJ IDEA. Óbuda University, Java Enterprise Edition John von Neumann Faculty of Informatics Lab 2.

sites</distribsiteroot>

SOA-14: Continuous Integration in SOA Projects Andreas Gies

Info Error Deploying Artifact Failed To Transfer File Return Code Is 401

Cheat Sheet: Wildfly Swarm

vpp-firstcut Documentation

CONTINUOUS DELIVERY IN THE ORACLE CLOUD

Tuscany: Applying OSGi modularity after the fact

maven Build System Making Projects Make Sense

Distributing JavaFX Applications with Java WebStart and Artifactory

MAVEN MOCK TEST MAVEN MOCK TEST III

BUILD AND DEPLOY SOA PROJECTS FROM DEVELOPER CLOUD SERVICE TO ORACLE SOA CLOUD SERVICE

Red Hat JBoss Web Server 3.1

Package Management and Build Tools

Sunday, May 1,

TM DevOps Use Case TechMinfy All Rights Reserved

JPA Tools Guide (v5.0)

Struts 2 Maven Archetypes

JDO Tools Guide (v5.1)

REASONS TO USE A BINARY REPOSITORY MANAGER WHEN DEVELOPING WITH. White Paper

From Continuous Integration To Continuous Delivery With Jenkins

Contents. Enterprise Systems Maven and Log4j. Maven. What is maven?

Developing Applications Using Continuous Integration 12c ( )

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

9 Reasons To Use a Binary Repository for Front-End Development with Bower

Unable To The Artifact From Any Repository Maven-clean-plugin

Red Hat JBoss Data Grid 7.2

Oracle Fusion Middleware

Create your own Carbon Component. Sameera Jayasoma Technical Lead and Product Manager of WSO2 Carbon

Class Dependency Analyzer CDA Developer Guide

Hello Gradle. TestNG, Eclipse, IntelliJ IDEA. Óbuda University, Java Enterprise Edition John von Neumann Faculty of Informatics Lab 2.

Red Hat JBoss Enterprise Application Platform 6.4

juddi Developer Guide

Moven. Machine/Deep Learning Models Distribution Relying on the Maven Infrastructure. Sergio Fernández (Redlink GmbH) November 14th, Sevilla

OSGi on the Server. Martin Lippert (it-agile GmbH)

Who Moved My Module? 1

Developing and Testing Java Microservices on Docker. Todd Fasullo Dir. Engineering

<put document name here> 1/13

Fat / Uber jars - Using the Shade Plugin

Red Hat JBoss Fuse 6.3

State of JTS. Presented by: James, Jody, Rob, (Martin)

Step 5 - Scan Applications. Step 5 - Scan Applications

TM DevOps Use Case. 2017TechMinfy All Rights Reserved

Con$nuous Integra$on Development Environment. Kovács Gábor

Red Hat Fuse 7.0 Installing on JBoss EAP

Red Hat JBoss Fuse 6.1

PHP Composer 9 Benefits of Using a Binary Repository Manager

Red Hat JBoss Fuse 6.2.1

AUTOMATION TESTING FRAMEWORK FOR LUMINOUS LMS

Sunil Shah SECURE, FLEXIBLE CONTINUOUS DELIVERY PIPELINES WITH GITLAB AND DC/OS Mesosphere, Inc. All Rights Reserved.

Maven in the wild. An introduction to Maven

Setting up a Maven Project

Red Hat Fuse 7.1 Installing on JBoss EAP

Jenkins: A complete solution. From Continuous Integration to Continuous Delivery For HSBC

Red Hat JBoss BRMS 6.4

APEX Installation Guide. Sven van der Meer, Liam Fallon, John Keeney. Version SNAPSHOT, T16:01:13Z

State of JTS. Presented by: James, Jody, Rob, (Martin)

TM DevOps Use Case. 2017TechMinfy All Rights Reserved

Pour aller plus loin : Programmation outillée

Error Code 407 Proxy Authentication Required Maven

Oracle Corporation

JavaLand Dirk Mahler

This tutorial explains how you can use Gradle as a build automation tool for Java as well as Groovy projects.

JBoss Enterprise Application Platform 6.2

ONAP Developer Typical Setup 2017 July ONAP Virtual Developers Event

Apache Maven. Péter Jeszenszky Faculty of Informatics, University of Debrecen Last modified: March 8, 2018

Red Hat Fuse 7.0 Getting Started

JenkinsPipelineUnit. Test your Continuous Delivery Pipeline. Ozan Gunalp - Emmanuel Quincerot

Developing ONOS Apps

Red Hat Fuse 7.1 Getting Started

Adobe Experience Manager

Action Developers Guide

The Workshop. Slides (you have a copy in the zip) Practical labs Ask questions

Continuous Integration INRIA

Transcription:

Repository Management and Sonatype Nexus i Repository Management and Sonatype Nexus

Repository Management and Sonatype Nexus ii Contents 1 Objectives 1 2 Development Today 1 3 But What Is A Component? 1 4 Manual Dependency Management 1 5 Declarative Dependency Managment 1 6 "Problems" With Declarative Approach 2 7 Adoption Stages and Advantages 2 8 Adoption Stages and Advantages 2 9 Adoption Stages and Advantages 2 10 Sonatype Nexus as Center Hub 3 11 Installing Nexus 3 12 Relationship Apache Maven and Nexus 3 13 Connecting Maven to Nexus 4 14 Component Coordinates 4 15 Maven Repository Format 5 16 What is a Repository? 5 17 Repository Manager Tasks 6 18 Repository Manager Advantages 6 19 Nexus User Interface Tour 6 20 Proxying 6 21 Release vs Snapshot Repositories 7 22 Deploying Internal Components 7 23 Deployments with Maven... 7

Repository Management and Sonatype Nexus iii 24 pom.xml - distributionmanagement 7 25 settings.xml - server 8 26 Maven Deploy Plugin 8 27 Advanced Features 8 28 Distributed Deployments 8 29 Component Lifecycle Management 9 30 Integrating with Nexus 9 31 Want to learn more? 9

Repository Management and Sonatype Nexus 1 / 9 1 Objectives Understand the benefits of using a repository manager Know how to start using Nexus Learn about Component Lifecycle Management 2 Development Today Uses components. Lots of them. more than 80% of a common enterprise software Facilitate the power of open source Don t reinvent the wheel 3 But What Is A Component? i. any artifact or library that your software needs in order to be built, released and to run Contains code, class files, object files, binary resources like images, property files, xml files... In jar, war, ear, swf, so, bin, apk, apklib, zip, tar.gz, rpm, deb files and so on Examples Google Guice jar file needed during runtime JUnit jar file needed for unit test execution JDBC driver for your database needed at runtime 4 Manual Dependency Management Painful Unreliable Overloads SCM Hard to maintain and document Note Unbelievably lots of developers still do this today! 5 Declarative Dependency Managment Automatic Including transitive dependencies Declarative - so easy to read and understand Support from tools

Repository Management and Sonatype Nexus 2 / 9 6 "Problems" With Declarative Approach Common complaint "Maven is downloading the internet, again!" In fact everything is cached locally (~/.m2/repository) Components are used from local repo in all your projects built with Maven Other tools also need to download components, and all use Central Repository Maven repository format This is where Sonatype Nexus can help! 7 Adoption Stages and Advantages Proxy external repositories Starting with Central Repository Reduced downloads, faster builds, increased stability Adding more proxy repositories only needs to be done on the server developers get access to more components without any work 8 Adoption Stages and Advantages Host external and internal artifacts Deploy once for everybody Share binary components like open source projects Improve cooperation between multiple, different teams (dev, qa, ops... ) 9 Adoption Stages and Advantages Lifecycle Integration Addition of CI server Controlling component usage - Procurement Improving release process - Staging Gaining license and security understanding of the components

Repository Management and Sonatype Nexus 3 / 9 10 Sonatype Nexus as Center Hub images/nexus-tool-suite-integration.png Nexus will be a key component of your enterprise development infrastructure 11 Installing Nexus 1. Install Java 7 2. Get the bundle with the embedded Jetty server from the download page 3. Extract archive, create symbolic link and run sudo cp nexus-professional-x.y.z-bundle.tar.gz /usr/local cd /usr/local sudo tar xvzf nexus-professional-x.y.z-bundle.tar.gz ln -s nexus-professional-x.y.z nexus cd nexus./bin/nexus console 4. Go to http://localhost:8081/nexus and log in with admin/admin123 Note Nexus Professional has enterprise benefits, but open source edition is perfect for getting started. 12 Relationship Apache Maven and Nexus Apache Maven introduced repository concept: storage for plugins and dependencies All are retrieved from repositories on the internet, by the default the Central Repository Nexus runs Open Source Repository Hosting OSSRH as input for the Central Repository Nexus can run as proxy on site for you Best of breed Maven Repository Manager MRM (and beyond) Read more about the scale needed to run OSSRH on the blog.

Repository Management and Sonatype Nexus 4 / 9 13 Connecting Maven to Nexus Establish system/user wide setting for Maven to use Nexus: modify/create ~/.m2/settings.xml to point to Nexus (see labs/settings/) build a few Maven projects see how it starts proxying <settings> <mirrors> <mirror> <id>nexus</id> <mirrorof>*</mirrorof> <url>http://localhost:8081/nexus/content/groups/public</url> </mirror> </mirrors> <profiles> <profile> <id>nexus</id> <repositories> <repository> <id>central</id> <url>http://central</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> </repositories> <pluginrepositories> <pluginrepository> <id>central</id> <url>http://central</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </pluginrepository> </pluginrepositories> </profile> </profiles> <activeprofiles> <activeprofile>nexus</activeprofile> </activeprofiles> </settings> For other build tools this will be different. 14 Component Coordinates Structure storage for components using unique "GAV" coordinates: g roupid, a rtifactid, v ersion - GAV optionally classifier and packaging

Repository Management and Sonatype Nexus 5 / 9 <dependency> <groupid>org.testng</groupid> <artifactid>testng</artifactid> <version>6.1.1</version> </dependency> <dependency> <groupid>com.google.inject</groupid> <artifactid>guice</artifactid> <version>3.0</version> <classifier>no_aop</classifier> </dependency> <dependency> <groupid>org.glassfish.admingui</groupid> <artifactid>war</artifactid> <version>10.0-b28</version> <type>war</type> </dependency> 15 Maven Repository Format Uses the GAV component coordinates. Coordinates map to specific locations in a Maven repository. <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-core</artifactid> <version>3.4.1</version> </dependency> Maps to: org/apache/camel/ camel-core/ 3.4.1/ camel-core-3.4.1.pom camel-core-3.4.1.jar File names are created using artifactid-version-classifier.packaging Classifiers javadoc and sources are appended to file name: camel-core-3.4.1-javadoc.jar camel-core-3.4.1-sources.jar Other repository formats use a different structure, but the Maven structure is understood and used by many tools. 16 What is a Repository? Organized storage and access container for artifacts Uses artifact coordinates for structure A Repository Manager helps with administration and usage

Repository Management and Sonatype Nexus 6 / 9 17 Repository Manager Tasks Proxy and managing access to public repositories Storing components that are not in public repositories Managing releases and snapshots Controlling available and allowed dependencies Facilitate internal collaboration across components and teams 18 Repository Manager Advantages Increased speed Reduced bandwidth usage Predictability Ability to control and audit - all components under your control Improved management of 3rd party artifacts Internal collaboration enabled Distribution of components made possible 19 Nexus User Interface Tour Search for components, including advanced search View component details including security and license details Repositories Server administration Security 20 Proxying Public Group is exposed to users can be changed on server for all users takes security access rights into account Examples: add an additional external proxy repository add an internal hosted repository manually deploy component into 3rd party hosted repository Demo time!

Repository Management and Sonatype Nexus 7 / 9 21 Release vs Snapshot Repositories Release Repositories Store "point-in-time" Releases Releases never change Publish a Release Both the artifact and meta-data "live forever" Snapshot Repositories Used for development-only Transient No promise SNAPSHOT artifacts will remain the same Repositiory Groups merge them and expose the all under one URL. 22 Deploying Internal Components is when the benefits step up to the next level: Sharing of binary components and not specification documents No more building each others components End of large multi-module builds Choice of build system 23 Deployments with Maven... mvn clean deploy pom.xml distributionmanagement snapshotrepository releaserepository settings.xml server 24 pom.xml - distributionmanagement <distributionmanagement> <repository> <id>nexus-releases</id> <url>http://localhost:8081/nexus/content/repositories/releases</url> </repository> <snapshotrepository> <id>nexus-snapshots</id> <url>http://localhost:8081/nexus/content/repositories/snapshots</url> </snapshotrepository> </distributionmanagement>

Repository Management and Sonatype Nexus 8 / 9 25 settings.xml - server <servers> <server> <id>nexus</id> <username>admin</username> <password>admin123</password> </server> </servers> 26 Maven Deploy Plugin Use the example project in labs/maven-deploy-example mvn clean deploy mvn versions:set -DnewVersion=1.0.0 mvn clean deploy Snapshot versions can be deployed multiple times. Releases only once. Now components are available for everybody via the public group. Your continuous integration server could do the deployment. 27 Advanced Features Procurement Control availability of components Staging multi-step, controlled release process including reruns Maven Settings Distribution via Nexus Maven Plugin Security Enhanced LDAP, Atlassian Crowd Other repository formats NuGet, Site, P2, OBR, YUM 28 Distributed Deployments Scale your organization, while maintaining performance for everybody! images/nexus-smart-proxy.png

Repository Management and Sonatype Nexus 9 / 9 Various scenarios and setups are common, including: integration with component providers cooperation with external development teams component distribution to clients 29 Component Lifecycle Management Component lifecycle management can be defined as the practice of analyzing, controlling, and monitoring the components used in your software development lifecycle. Sonatype CLM integration in Hudson/Jenkins Eclipse Nexus... 30 Integrating with Nexus Lots of build tools can integrate with Maven repositories Ant/Ivy, Gradle, SBT, Grails,... All functionality is available in REST API Java Client for REST API available Plugin architecture with examples to create your own 31 Want to learn more? Nexus Opens Source OSS website Nexus Professional website Screen cast recordings Repository Management with Nexus - free book Nexus Professional Trial Bundle and Guide - some examples can be used with Nexus OSS as well Mailing lists Talk to the developers/support - HipChat Training classes