Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Nexus has several type of repositories: <em>hosted repositories</em> (those that really store maven artifacts), <em>proxy repositories</em> (that redirect traffic to other remote repositories when an artifact is requested), <em>virtual repositories</em> (a mere adapter of maven1 repositories [out of the scope of this question]). you can also create <em>repository groups</em> that can serve artifacts from any of its aggregates (the <code>public</code> repository is one of these). </p> <p>In addition, nexus divides their repositories according to its publishing policy into <strong>snapshots</strong> and <strong>releases</strong>. The former stores only snapshot artifacts; while the latter, in theory, can store both snapshots and releases, but it actually behaves buggy when the repo is very big and contains snapshots.</p> <p>In order to host your artifacts you need to:</p> <p><strong>First:</strong> Divide your local repository into two: one containing the snapshots, and another containing the releases. Nexus repository convertion tool will help you if your repo is very big:</p> <pre><code> &lt;dependency&gt; &lt;groupId&gt;org.sonatype.nexus.tools&lt;/groupId&gt; &lt;artifactId&gt;nexus-repository-conversion-tool&lt;/artifactId&gt; &lt;version&gt;1.8.0.1&lt;/version&gt; &lt;classifier&gt;cli&lt;/classifier&gt; &lt;/dependency&gt; </code></pre> <p>Once downlaoded you can just execute <code>java -jar nexus-repository-conversion-tool-1.8.0.1-cli.jar -rSource -oTarget</code> where <code>Source</code> is the directory that contains the local repository to move to nexus, and <code>Target</code> is an existing, empty and writable directory where the convertion tool will leave the splitted repositories. Provided that source directory is <code>repository</code> and Target is <code>temp</code>, it will create <code>temp/repository-snapshots</code> and <code>temp/repository-releases</code> directories.</p> <p><strong>Second:</strong> move your splitted repos to nexus. And leave them in <code>${NEXUS_HOME}/sonatype-work/nexus/storage</code>, or wherever your nexus installation is configured to store the repositories.</p> <p><strong>Third:</strong> create two <strong>hosted repositories</strong> with the same id as the repos you moved in the second step. (in the example <code>repository-snapshots</code> and <code>repository-releases</code>)</p> <p>If your repo would only contained releases, your solution could have worked, but you will have commited another mistake. Although nexus stores artifacts for every repository, the storage of those that aren't hosted repos is just for caching purposes (as in the case of the <code>public</code> repository), you would have to copied your contents to a hosted one in order to work.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload