Ivy|Working with Ivy - Artifactory
Working with Ivy - Artifactory - Confluence
Setting up Ivy to work with ArtifactoryIn order to make Ivy work with Artifactory, the following files must be present and configured:
Ivy Settings - ivysettings.xmlThe ivysettings.xml file holds a chain of Ivy resolvers, which are used for both resolution and publishing (deployment). Resolvers exist for both regular artifacts and Ivy module files. The iBiblio ResolverThis resolver is used strictly for dependency resolution. By default it assumes artifacts in your repository are laid-out in the popular standard Maven 2 format (which may not always be the case). <ibiblio name="artifactory" m2compatible="true" root="http://localhost:8080/artifactory/libs-releases"/>
The URL ResolverThe URL resolver can be used for dependency resolution and/or deployment of both regular artifacts and Ivy module files. To publish or resolve artifacts to/from Artifactory configure a URL resolver with the pattern that matches your target repository layout for both Ivy and artifact files, e.g.: <url name="artifactory-publish"> <!-- You can use m2compatible="true" instead of specifying your own pattern --> <artifact pattern= "http://localhost:8080/artifactory/libs-snapshots-local/\]\[organization\]/\[module\]/\[revision\]/\[artifact\]-\[revision\].\[ext\]"/> <ivy pattern="http://localhost:8080/[organization]/[module]/[revision]/ivy-[revision].xml" /> </url>
Using a Chain ResolverYou can mix resolvers under a chain resolver in Ivy which will use sub-resolvers for dependency resolution and publishing. Please refer to the relevant Ivy documentation. Ivy Modules - ivy.xmlivy.xml files contain a list of dependency declarations that are needed to be resolved for the build. Ant Build - build.xmlTo work with Ivy for dependency resolution you need to use <ivy:configure/> in your build.xml file. This will load the ivysettings.xml. Publishing to ArtifactoryIn order to publish to Artifactory the <ivy:publish> command needs to be used. Ivy will use the configured resolver to deploy your artifact into Artifactory. For example: <ivy:publish resolver="artifactory-publish" overwrite="true"> <!-- Use overwrite="true" if you wish to overwrite existing artifacts and publishivy="false" if you only want to publish artifacts not module descriptors --> <artifacts/> </ivy:publish> Please consult the Ivy documentation for more detailed information. Searching the Content of Ivy ModulesYou can search the content of Ivy modules in Artifactory.
|
No comments:
Post a Comment