Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[#1130] Docs: add ivysettings example for reuse of local maven repo a…

…nd repository manager
  • Loading branch information...
commit fcd3d17497ceffc9913d6d82ff00415b941755fd 1 parent add6a63
Georg Engel authored Peter Hilton committed
Showing with 46 additions and 8 deletions.
  1. +46 −8 documentation/manual/dependency.textile
View
54 documentation/manual/dependency.textile
@@ -320,22 +320,60 @@ Note: don't forget to run @play dependencies myplayapp@.
h3. Custom ivy settings
-Play is using Ivy under the hood. If you require a special configuration such as setting a proxy, basic authentication for an internal maven nexus repository, you can edit the ivysettings.xml file. It is located in the .ivy2 folder in your home directory.
+Play is using Ivy under the hood. If you require a special configuration such as setting a proxy, basic authentication for an internal maven nexus repository, you can edit the ivysettings.xml file. It is located in the @.ivy2@ folder in your home directory.
-bc. Example1, you want ivy to ignore checksums:
-# .ivy2/ivysettings.xml
+Example 1, you want Ivy to ignore checksums:
+
+bc. <!-- .ivy2/ivysettings.xml -->
<ivysettings>
<property name="ivy.checksums" value=""/>
</ivysettings>
-bc. Example2, you want to use basic auth:
-# .ivy2/ivysettings.xml
+Example 2, you want to use basic authentication:
+
+bc. <!-- .ivy2/ivysettings.xml -->
<ivysettings>
- <credentials host="maven-repo.xxx" realm="Sonatype Nexus Repository Manager" username="user" passwd="reallygreatpassword"/>
+ <credentials host="maven-repo.xxx" realm="Sonatype Nexus Repository Manager"
+ username="user" passwd="reallygreatpassword"/>
</ivysettings>
-
-There are many things you can configure see: http://ant.apache.org/ivy/history/2.1.0/settings.html
+Example 3, reuse local maven repository and repository manager:
+
+bc. <!-- .ivy2/ivysettings.xml -->
+<ivy-settings>
+ <!-- path to local maven repo and default maven layout -->
+ <property name="local-maven2-pattern"
+ value="${user.home}/.m2/repository/[organisation]/[module]/[revision]/[module]-[revision]"
+ override="false" />
+
+ <!-- set resolver chain as default -->
+ <settings defaultResolver="main" />
+
+ <!-- configure caches -->
+ <caches repositoryCacheDir="${user.home}/.ivy2/cache">
+ <!-- do not cache from local .m2-->
+ <cache name="nocache" useOrigin="true" />
+ <cache name="default" />
+ </caches>
+
+ <resolvers>
+ <chain name="main">
+ <!-- as this is not cached, even changing SNAPSHOT dependencies
+ are resolved correctly -->
+ <filesystem name="local-maven-2" m2compatible="true" local="true"
+ cache="nocache">
+ <ivy pattern="${local-maven2-pattern}.pom" />
+ <artifact pattern="${local-maven2-pattern}(-[classifier]).[ext]" />
+ </filesystem>
+ <!-- use repository manager as proxy to maven-central
+ (and all other repositories)-->
+ <ibiblio name="repomanager" m2compatible="true"
+ root="http://your.repomanager.intra/path/to/repo" cache="default"/>
+ </chain>
+ </resolvers>
+</ivy-settings>
+
+There are many things you can configure: see the "Ivy settings documentation":http://ant.apache.org/ivy/history/2.1.0/settings.html.
h3. Clearing the Ivy cache
Please sign in to comment.
Something went wrong with that request. Please try again.