managing your dependencies with n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Managing your dependencies with PowerPoint Presentation
Download Presentation
Managing your dependencies with

Loading in 2 Seconds...

play fullscreen
1 / 30

Managing your dependencies with - PowerPoint PPT Presentation


  • 81 Views
  • Uploaded on

Managing your dependencies with. Xavier Hanin xavier@apache.org. http://incubator.apache.org/ivy/. Speaker’s qualification. Xavier Hanin Creator of Ivy Member of JSR 277 (Java Module System) Expert Group Java developer and consultant since 1999 Independant consultant. Agenda.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Managing your dependencies with' - hafwen


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
managing your dependencies with

Managing your dependencies with

Xavier Hanin

xavier@apache.org

http://incubator.apache.org/ivy/

speaker s qualification
Speaker’s qualification
  • Xavier Hanin
    • Creator of Ivy
    • Member of JSR 277 (Java Module System) Expert Group
    • Java developer and consultant since 1999
  • Independant consultant

Managing your dependencies with Ivy - Apache Con EU 2007

agenda
Agenda
  • What is Ivy?
  • Why Ivy?
  • A little bit of history
  • First contact
  • Where do those files come from?
  • Modular development with Ivy
  • Ivy’s spirit
  • Q/A

Managing your dependencies with Ivy - Apache Con EU 2007

what is ivy
What is Ivy?
  • A tool for managing project dependencies

recording reporting

resolving publishing

  • Focus on flexibility and configurability
  • Ensure build reproducibility
  • Support large dependencies graph
  • Strong conflict management engine
  • Tight integration with Apache Ant
  • Compatible with Maven 2 repositories

Managing your dependencies with Ivy - Apache Con EU 2007

why ivy
Why Ivy?
  • Don’t reinvent the wheel: reuse
  • Modular systems are easier to develop and maintain
  • More and more complex components
  • Agile methodologies
  • => Manage your dependencies

Managing your dependencies with Ivy - Apache Con EU 2007

a little bit of history
A little bit of history

Created for the internal needs of Jayasoft

Join Apache Incubator

sponsored by Apache Ant

First release

1.0

1.2

1.3.1

2004

2005

2006

2007

1.4.1

1.1

1.3

1.4

First open source

version (0.5)

1.5-beta1-incubating ?

Managing your dependencies with Ivy - Apache Con EU 2007

first contact
First contact
  • No complex install, bootstrap!

<targetname="install-ivy"description="--> install ivy">

<mkdirdir="${ivy.jar.dir}"/>

<getsrc="${ivy.jar.url}"

dest="${ivy.jar.dir}/ivy.jar"usetimestamp="true"/>

<pathid="ivy.lib.path">

<filesetdir="${ivy.jar.dir}"includes="*.jar"/>

</path>

<taskdefresource="org/apache/ivy/ant/antlib.xml"

uri="antlib:org.apache.ivy.ant"

classpathref="ivy.lib.path"/>

</target>

Managing your dependencies with Ivy - Apache Con EU 2007

first contact1
First contact
  • Get your first dependency

<ivy:retrieve organisation="org.apache.struts"

module="struts2-core"

revision="2.0.5"

inline="true"/>

Managing your dependencies with Ivy - Apache Con EU 2007

slide9

Demo

Managing your dependencies with Ivy - Apache Con EU 2007

first contact2
First contact
  • Introducing ivy files
    • because one dependency is not enough
    • because dependencies declaration should not be part of the build.xml
    • because transitive dependencies require module metadata

Managing your dependencies with Ivy - Apache Con EU 2007

ivy files
Ivy files

<ivy-moduleversion="1.5">

<infoorganisation="org.apache.ivy"

module="ivy-demo-2" />

<configurations>

<confname="runtime"/>

<confname="test"/>

</configurations>

<dependencies>

<dependencyorg="org.apache.struts"

name="struts2-core"rev="2.0.5"

conf="runtime->default"/>

<dependencyorg="junit"

name="junit"rev="3.8.1"

conf="test->*"/>

</dependencies>

</ivy-module>

Managing your dependencies with Ivy - Apache Con EU 2007

resolve dependencies
Resolve dependencies

<ivy:retrieve

pattern="lib/[conf]/[artifact]-[revision].[ext]"/>

Managing your dependencies with Ivy - Apache Con EU 2007

understanding your dependencies
Understanding your dependencies

<ivy:reporttodir="report"/>

Managing your dependencies with Ivy - Apache Con EU 2007

understanding your dependencies1
Understanding your dependencies

Managing your dependencies with Ivy - Apache Con EU 2007

where do those files come from
Where do those files come from?
  • Notion of repository
    • stores modules artifacts and metadata
    • very flexible
      • anything can be a repository!
      • possible to split modules across repositories
        • ex: metadata in one place and artifacts in another
        • ex: thirdparty modules on one server and internal on another
      • possible to split versions across repositories
        • example: one repository for integration builds, one for releases, one for archive, …

Managing your dependencies with Ivy - Apache Con EU 2007

where do those files come from1
Where do those files come from?
  • Default settings
    • Use maven 2 public repository
    • Use a shared and local repository
    • Easy to use, but not suitable to all situations
  • Custom settings
    • Define your own repository architecture
    • Simple xml file
    • Clean separation with metadata

Managing your dependencies with Ivy - Apache Con EU 2007

where do those files come from2
Where do those files come from?

<ivysettings>

<properties

file="${ivy.settings.file}/ivysettings.properties"/>

<settingsdefaultResolver="public"/>

<includefile="path/to/another-ivysettings.xml" />

<resolvers>

<ibiblioname="public"m2compatible="true"

root="http://repo1.maven.org/maven2"/>

</resolvers>

</ivysettings>

Managing your dependencies with Ivy - Apache Con EU 2007

slide18

Demo

Managing your dependencies with Ivy - Apache Con EU 2007

modular development with ivy
Modular development with Ivy
  • Ivy helps resolve third party dependencies, but it’s even more useful for internal dependencies changing frequently

project A

local repository

project B

shared repository

Managing your dependencies with Ivy - Apache Con EU 2007

ivy file
Ivy file

<ivy-moduleversion="1.5">

<infoorganisation="org.apache.ivy"

module="ivy-demo-3-B" />

<configurations>

<confname="runtime"/>

<confname="test"/>

</configurations>

<dependencies>

<dependencyorg="org.apache.struts"

name="struts2-core"rev="2.0.5"

conf="runtime->default"/>

<dependencyname="ivy-demo-3-A"rev="latest.integration"/>

</dependencies>

</ivy-module>

Managing your dependencies with Ivy - Apache Con EU 2007

settings
Settings

<ivysettings>

<settingsdefaultCache="${ivy.home}/cache"

defaultResolver="public"/>

<resolvers>

<chainname="main"returnFirst="true">

<filesystemname="local">

<ivypattern="${ivy.settings.dir}/local/[module]/ivy.xml"/>

<artifactpattern="${ivy.settings.dir}/local/[module]/[artifact].[ext]"/>

</filesystem>

<sshuser="${user}"keyFile="path/to/key/file"keyFilePassword="${password}">

<ivypattern="ssh://yourserver.com/path/to/repos/[module]/[revision]/ivy.xml"/>

<artifactpattern="ssh://myserver.com/path/to/my/repos/[artifact].[ext]"/>

</ssh>

</chain>

<ibiblioname="public"m2compatible="true"

root="http://repo1.maven.org/maven2"/>

</resolvers>

<modules>

<moduleorg="mycompany"resolver="main"/>

</modules>

</ivysettings>

Managing your dependencies with Ivy - Apache Con EU 2007

slide22

Demo

Managing your dependencies with Ivy - Apache Con EU 2007

ivy s spirit flexibility
Ivy’s spirit: flexibility
  • Adapt to your environment and requirements
  • Many things are configurable and pluggable
  • Large choice of repositories, with very flexible layout
  • Wide set of flexible ant tasks

Managing your dependencies with Ivy - Apache Con EU 2007

ivy s spirit flexibility1
Ivy’s spirit: flexibility
  • Some examples of pluggability
    • pluggable module descriptor format,
      • support Ivy files and maven 2 pom out of the box
    • pluggable versioning scheme,
      • define which version is greater than another
      • define your own version constraints
    • pluggable conflict managers
    • plug into the engine with triggers

Managing your dependencies with Ivy - Apache Con EU 2007

ivy s spirit flexibility2
Ivy’s spirit: flexibility
  • Some examples of tasks
    • use artifacts directly from Ivy cache
    • or copy them to your lib directory
    • reuse dependency resolution result
    • generate numerous reports
    • install modules and their dependencies from one repository to another one

Managing your dependencies with Ivy - Apache Con EU 2007

ivy s spirit flexibility3
Ivy’s spirit: flexibility
  • Some examples in Ivy files
    • define as many module configurations as you need
    • use powerful configurations mapping to suit your specific cases, and define your own defaults
    • embed your configurations declaration or define them in separate files
    • declare as many artifacts per module as you want
    • create your own extra attributes with no complex settings

Managing your dependencies with Ivy - Apache Con EU 2007

ivy maven2 comparison
Ivy / Maven2 comparison
  • Better compare Ant+Ivy vs Maven
  • No silver bullet
  • Ant+Ivy Pros
    • Flexible
    • Better control
    • No « magic »
    • Easier migration (if you already use Ant)
  • Maven Pros
    • out of the box feature rich build system
    • reusable experience
    • better maven 2 compatibility

Managing your dependencies with Ivy - Apache Con EU 2007

future
Future
  • Release 1.5
  • Recruit contributors / committers
  • Graduate

We need your help!

Managing your dependencies with Ivy - Apache Con EU 2007

links
Links
  • Ivy web site:
    • http://incubator.apache.org/ivy/
  • Download:
    • http://incubator.apache.org/ivy/download
  • Mailing lists:
    • ivy-user@incubator.apache.org
    • ivy-dev@incubator.apache.org
  • Issue tracking:
    • http://issues.apache.org/jira/browse/IVY
  • These slides:
    • http://incubator.apache.org/ivy/presentations/apache-con-2007/slides.ppt

Managing your dependencies with Ivy - Apache Con EU 2007

slide30

Questions

and (hopefully) Answers

Managing your dependencies with Ivy - Apache Con EU 2007