Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Tycho/Target Platform/Authentication and Mirrors"

(how to access p2 repos with authentication; how to redirect to mirrors)
 
(2 intermediate revisions by one other user not shown)
Line 6: Line 6:
 
In order to specify user name and password for a p2 repository requiring basic authentication, add a <tt>&lt;server&gt;</tt> entry in the <tt>settings.xml</tt>.
 
In order to specify user name and password for a p2 repository requiring basic authentication, add a <tt>&lt;server&gt;</tt> entry in the <tt>settings.xml</tt>.
  
<pre>
+
<source lang="xml">
 
<servers>
 
<servers>
 
   <server>
 
   <server>
Line 14: Line 14:
 
   </server>
 
   </server>
 
</servers>
 
</servers>
</pre>
+
</source>
  
 
When accessing a p2 repository, Tycho will check if there is a <tt>&lt;server&gt;</tt> entry with matching ID and use these credentials. The ID of a p2 repository can be specified explicitly, e.g. when the repository is [[Tycho/Target Platform#Layout p2|added in the POM]]. If no ID is specified, e.g. in a target file, the repository URL (without trailing slash) is used as ID (since Tycho 0.16.0).
 
When accessing a p2 repository, Tycho will check if there is a <tt>&lt;server&gt;</tt> entry with matching ID and use these credentials. The ID of a p2 repository can be specified explicitly, e.g. when the repository is [[Tycho/Target Platform#Layout p2|added in the POM]]. If no ID is specified, e.g. in a target file, the repository URL (without trailing slash) is used as ID (since Tycho 0.16.0).
Line 24: Line 24:
 
In order to load a p2 repository from an alternative location, e.g. a local mirror of the repository, add a <tt>&lt;mirror&gt;</tt> configuration entry in the <tt>settings.xml</tt>. Example:
 
In order to load a p2 repository from an alternative location, e.g. a local mirror of the repository, add a <tt>&lt;mirror&gt;</tt> configuration entry in the <tt>settings.xml</tt>. Example:
  
<pre>
+
<source lang="xml">
 
<mirrors>
 
<mirrors>
 
   <mirror>
 
   <mirror>
 
       <id>mirror-id</id>
 
       <id>mirror-id</id>
 
       <mirrorOf>repository-id</mirrorOf>
 
       <mirrorOf>repository-id</mirrorOf>
 +
      <!-- or <mirrorOf&gt;http://url/of/source/repository/</url&gt; -->
 
       <url>http://mirror_url</url>
 
       <url>http://mirror_url</url>
 +
      <!-- or <url&gt;file:/path/on/filesystem</url&gt; -->
 
       <layout>p2</layout>
 
       <layout>p2</layout>
 
       <mirrorOfLayouts>p2</mirrorOfLayouts>
 
       <mirrorOfLayouts>p2</mirrorOfLayouts>
 
   </mirror>
 
   </mirror>
 
</mirrors>
 
</mirrors>
</pre>
+
</source>
  
 
Like for credentials, the repository ID is either the configured ID or the URL of the repository (without trailing slash).
 
Like for credentials, the repository ID is either the configured ID or the URL of the repository (without trailing slash).
Line 41: Line 43:
 
</div>
 
</div>
  
[[Category:Tycho|Target Platform/Authorization and Mirrors]]
+
[[Category:Tycho|Target Platform/Authentication and Mirrors]]

Revision as of 03:41, 10 September 2013

Similar to what is possible Maven, you can influence how Tycho accesses remote p2 repositories through configuration parameters in the Maven settings.xml.

Credentials for p2 Repositories

In order to specify user name and password for a p2 repository requiring basic authentication, add a <server> entry in the settings.xml.

<servers>
   <server>
      <id>repository-id</id>
      <username></username>
      <password></password>
   </server>
</servers>

When accessing a p2 repository, Tycho will check if there is a <server> entry with matching ID and use these credentials. The ID of a p2 repository can be specified explicitly, e.g. when the repository is added in the POM. If no ID is specified, e.g. in a target file, the repository URL (without trailing slash) is used as ID (since Tycho 0.16.0).

Loading p2 Repositories from Alternative Locations

In order to load a p2 repository from an alternative location, e.g. a local mirror of the repository, add a <mirror> configuration entry in the settings.xml. Example:

<mirrors>
   <mirror>
      <id>mirror-id</id>
      <mirrorOf>repository-id</mirrorOf>
      <!-- or <mirrorOf&gt;http://url/of/source/repository/</url&gt; -->
      <url>http://mirror_url</url>
      <!-- or <url&gt;file:/path/on/filesystem</url&gt; -->
      <layout>p2</layout>
      <mirrorOfLayouts>p2</mirrorOfLayouts>
   </mirror>
</mirrors>

Like for credentials, the repository ID is either the configured ID or the URL of the repository (without trailing slash).

Note: Mirrors for repositories specified in target files are only supported since Tycho 0.16.0 (see bug 356016).

Back to the top