blob: a1ef62c2e7765a20c569b87f97321643488a860c [file] [log] [blame]
<!DOCTYPE html>
<!--
| Generated by Apache Maven Doxia Site Renderer 1.8.1
| Rendered using Apache Maven Fluido Skin 1.6
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Language" content="en" />
<title>Archiva Documentation &#x2013; Virtual Repositories</title>
<link rel="stylesheet" href="../css/apache-maven-fluido-1.6.min.css" />
<link rel="stylesheet" href="../css/site.css" />
<link rel="stylesheet" href="../css/print.css" media="print" />
<script type="text/javascript" src="../js/apache-maven-fluido-1.6.min.js"></script>
<!-- Google Analytics -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-140879-5']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="topBarDisabled">
<div class="container-fluid">
<div id="banner">
<div class="pull-left"><a href="../../../" id="bannerLeft"><img src="../../../images/archiva.png" alt="Apache Archiva"/></a></div>
<div class="pull-right"><a href="http://www.apache.org/" id="bannerRight"><img src="https://www.apache.org/images/asf_logo_wide_2016.png" alt="Apache Software Foundation"/></a></div>
<div class="clear"><hr/></div>
</div>
<div id="breadcrumbs">
<ul class="breadcrumb">
<li class=""><a href="http://www.apache.org/" class="externalLink" title="Apache">Apache</a><span class="divider">/</span></li>
<li class=""><a href="../index.html" title="Apache Archiva">Apache Archiva</a><span class="divider">/</span></li>
<li class=""><a href="../../../index.html" title="Apache Archiva">Apache Archiva</a><span class="divider">/</span></li>
<li class="active ">Virtual Repositories</li>
<li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2018-11-04</li>
<li id="projectVersion" class="pull-right">Version: 3.0.0-SNAPSHOT</li>
</ul>
</div>
<div class="row-fluid">
<div id="leftColumn" class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">Introduction</li>
<li><a href="../quick-start.html" title="Quick Start"><span class="none"></span>Quick Start</a> </li>
<li><a href="../tour/index.html" title="Feature Tour"><span class="none"></span>Feature Tour</a> </li>
<li><a href="../release-notes.html" title="Release Notes"><span class="none"></span>Release Notes</a> </li>
<li><a href="../../../download.html" title="Downloads"><span class="none"></span>Downloads</a> </li>
<li class="nav-header">Users Guide</li>
<li><a href="../userguide/browsing.html" title="Browsing"><span class="none"></span>Browsing</a> </li>
<li><a href="../userguide/searching.html" title="Searching"><span class="none"></span>Searching</a> </li>
<li><a href="../userguide/delete-artifact.html" title="Deleting an Artifact"><span class="none"></span>Deleting an Artifact</a> </li>
<li><a href="../userguide/using-repository.html" title="Using as a repository"><span class="none"></span>Using as a repository</a> </li>
<li><a href="../userguide/deploy.html" title="Deploying to repository"><span class="none"></span>Deploying to repository</a> </li>
<li class="active"><a href="#"><span class="none"></span>Configuring Virtual Repositories</a>
</li>
<li><a href="../userguide/rss.html" title="Rss Feeds in Archiva"><span class="none"></span>Rss Feeds in Archiva</a> </li>
<li><a href="../userguide/querying-artifacts.html" title="Querying Artifacts"><span class="none"></span>Querying Artifacts</a> </li>
<li class="nav-header">Administrators Guide</li>
<li><a href="../adminguide/installing.html" title="Installing Archiva"><span class="icon-chevron-right"></span>Installing Archiva</a> </li>
<li><a href="../adminguide/databases.html" title="Databases"><span class="none"></span>Databases</a> </li>
<li><a href="../adminguide/repositories-content-storage.html" title="Repositories Content Storage"><span class="none"></span>Repositories Content Storage</a> </li>
<li><a href="../adminguide/security.html" title="Security"><span class="icon-chevron-right"></span>Security</a> </li>
<li><a href="../adminguide/configuration.html" title="Archiva Configuration"><span class="icon-chevron-right"></span>Archiva Configuration</a> </li>
<li><a href="../adminguide/webservices/rest.html" title="REST Apis"><span class="none"></span>REST Apis</a> </li>
<li><a href="../adminguide/configuration-files.html" title="Configuration Files"><span class="none"></span>Configuration Files</a> </li>
<li><a href="../adminguide/system-status.html" title="System Status"><span class="none"></span>System Status</a> </li>
<li><a href="../adminguide/logging.html" title="Log Files"><span class="icon-chevron-right"></span>Log Files</a> </li>
<li><a href="../adminguide/reports.html" title="Reports"><span class="none"></span>Reports</a> </li>
<li class="nav-header">Customising Archiva</li>
<li><a href="../customising/writing-consumer.html" title="Writing a Consumer Plugin"><span class="none"></span>Writing a Consumer Plugin</a> </li>
<li class="nav-header">More Information</li>
<li><a href="http://cwiki.apache.org/confluence/display/ARCHIVA/Index" class="externalLink" title="Archiva Wiki"><span class="none"></span>Archiva Wiki</a> </li>
<li class="nav-header">ASF</li>
<li><a href="http://www.apache.org/foundation/how-it-works.html" class="externalLink" title="How Apache Works"><span class="none"></span>How Apache Works</a> </li>
<li><a href="http://www.apache.org/foundation/" class="externalLink" title="Foundation"><span class="none"></span>Foundation</a> </li>
<li><a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink" title="Sponsoring Apache"><span class="none"></span>Sponsoring Apache</a> </li>
<li><a href="http://www.apache.org/foundation/thanks.html" class="externalLink" title="Thanks"><span class="none"></span>Thanks</a> </li>
<li class="nav-header">Project Documentation</li>
<li><a href="../project-info.html" title="Project Information"><span class="icon-chevron-right"></span>Project Information</a> </li>
</ul>
<form id="search-form" action="https://www.google.com/search" method="get" >
<input value="http://archiva.apache.org/docs/3.0.0-SNAPSHOT/" name="sitesearch" type="hidden"/>
<input class="search-query" name="q" id="query" type="text" />
</form>
<script type="text/javascript">asyncJs( 'https://cse.google.com/brand?form=search-form' )</script>
<hr />
<div id="poweredBy">
<div class="clear"></div>
<div class="clear"></div>
<div id="twitter">
<a href="https://twitter.com/archiva" class="twitter-follow-button" data-show-count="false" data-align="left" data-size="medium" data-show-screen-name="true" data-lang="en">Follow archiva</a>
<script type="text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
<div class="clear"></div>
<div class="clear"></div>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="../images/logos/maven-feather.png" /></a>
</div>
</div>
</div>
<div id="bodyColumn" class="span10" >
<div class="section">
<h2><a name="Virtual_Repositories"></a>Virtual Repositories</h2>
<p>This is a new feature for Archiva 1.1. The main advantage of virtual repositories (or repository groups) is that you only need to specify one URL instead of multiple repository URLs if you are using more than 1 proxy repository.</p>
<p>For example, you have the following configuration in your <tt>settings.xml</tt>:</p>
<div class="source"><pre class="prettyprint">&lt;settings&gt;
&lt;!-- omitted xml --&gt;
&lt;profiles&gt;
&lt;profile&gt;
&lt;id&gt;Repository Proxy&lt;/id&gt;
&lt;activation&gt;
&lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
&lt;/activation&gt;
&lt;repositories&gt;
&lt;repository&gt;
&lt;id&gt;internal.releases&lt;/id&gt;
&lt;url&gt;http://localhost:8080/repository/internal.releases/&lt;/url&gt;
&lt;releases&gt;
&lt;enabled&gt;true&lt;/enabled&gt;
&lt;/releases&gt;
&lt;snapshots&gt;
&lt;enabled&gt;false&lt;/enabled&gt;
&lt;/snapshots&gt;
&lt;/repository&gt;
&lt;repository&gt;
&lt;id&gt;third.party.repo&lt;/id&gt;
&lt;url&gt;http://localhost:8080/repository/third.party.repo/&lt;/url&gt;
&lt;releases&gt;
&lt;enabled&gt;true&lt;/enabled&gt;
&lt;/releases&gt;
&lt;snapshots&gt;
&lt;enabled&gt;false&lt;/enabled&gt;
&lt;/snapshots&gt;
&lt;/repository&gt;
&lt;repository&gt;
&lt;id&gt;snapshots&lt;/id&gt;
&lt;url&gt;http://localhost:8080/repository/snapshots/&lt;/url&gt;
&lt;releases&gt;
&lt;enabled&gt;false&lt;/enabled&gt;
&lt;/releases&gt;
&lt;snapshots&gt;
&lt;enabled&gt;true&lt;/enabled&gt;
&lt;/snapshots&gt;
&lt;/repository&gt;
&lt;/repositories&gt;
&lt;/profile&gt;
&lt;!-- omitted xml --&gt;
&lt;/profiles&gt;
&lt;!-- omitted xml --&gt;
&lt;/settings&gt;</pre></div>
<p>If you have a virtual repository configured in Archiva, you only need to configure this in your <tt>settings.xml</tt>:</p>
<div class="source"><pre class="prettyprint">&lt;settings&gt;
&lt;!-- omitted xml --&gt;
&lt;profiles&gt;
&lt;profile&gt;
&lt;id&gt;Repository Proxy&lt;/id&gt;
&lt;activation&gt;
&lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
&lt;/activation&gt;
&lt;repositories&gt;
&lt;repository&gt;
&lt;id&gt;internal.releases&lt;/id&gt;
&lt;url&gt;http://localhost:8080/repository/[repository_group_id]/&lt;/url&gt;
&lt;/repository&gt;
&lt;/repositories&gt;
&lt;/profile&gt;
&lt;!-- omitted xml --&gt;
&lt;/profiles&gt;
&lt;!-- omitted xml --&gt;
&lt;/settings&gt;</pre></div>
<p>And you'll still be able to get all the artifacts that you need. See Configuring Virtual Repositories section for the steps on how to setup a virtual repo in Archiva.</p>
<div class="section">
<h3><a name="How_It_Works"></a>How It Works</h3>
<p>When Archiva receives a request with a virtual repo (or repo group) URL, Archiva would look for the requested artifact from the repositories under that group. It would only check the repositories the user has permission to access (meaning only those repositories which the user has an Obeserver role for). The first resource found for the requested artifact would be returned.</p>
<p>Prior to version 1.4-M2, Virtual repositories can return a Maven index in the path .indexer path</p></div>
<div class="section">
<h3><a name="Configuring_Virtual_Repositories"></a>Configuring Virtual Repositories</h3>
<p>Below are the steps for setting up the virtual repositories:</p>
<ol style="list-style-type: decimal">
<li>In the webapp, go to the <tt>Repository Groups</tt> page. To create a virtual repository or repository group, go to add tab</li>
<li>To add a repository drag and drop available repositories.<img src="../images/repository-groups.png" alt="" /></li>
<li>Now add the virtual repository URL <tt>http://[host]:[port]/repository/[repository_group_id]/</tt> into your settings.xml the same way you configure regular repositories -- as a <i>mirror</i> or as an additional <i>repository</i>.</li>
<li>If the repositories under the group are secured, you must set your Archiva login credentials in your settings.xml as well. Please take note that the <i>server</i> id should match the repository group identifier.</li></ol></div>
<div class="section">
<h3><a name="Webdav_Browse"></a>Webdav Browse</h3>
<p>Webdav Browse for a virtual repository is a read-only view. It displays the merged contents of all the repositories under that repository group. Just type the url of the virtual repository in your browser in order to view its contents. User will be asked to authenticate if the 'guest' account is not enabled for the repositories. Only those repositories which the user has permission to access will be shown.</p></div>
<div class="section">
<h3><a name="Merged_index"></a>Merged index</h3>
<p>With version 1.4-M2, you can download a merged index for a virtual repository. This merged index is generated &quot;on the fly&quot; with merging repositories index for which the current user has karma. This merged index is available in the path .indexer .</p>
<p>To not generate this merged index on each request, there is a ttl (time to live) value for build merged index. It can be configured in the repository group configuration. This ttl has a default value of 30 minutes.</p></div></div>
</div>
</div>
</div>
<hr/>
<footer>
<div class="container-fluid">
<div class="row-fluid">
<div class="row span12">Apache Archiva :: Documentation, Archiva :: Documentation, Apache, the Apache feather logo, and the Apache Archiva :: Documentation project logos are trademarks of The Apache Software Foundation.</div>
<div class="row span12">
<a href="http://archiva.apache.org/docs/3.0.0-SNAPSHOT/privacy-policy.html">Privacy Policy</a>
</div>
</div>
<div id="ohloh" class="pull-right">
<script type="text/javascript" src="https://www.ohloh.net/p/6670/widgets/project_basic_stats.js"></script>
</div>
</div>
</footer>
</body>
</html>