title: Apt / Debian Repository from maven with dpkg-scanpackages
body: <p><strong>Short Description</strong></p>
  
  <p>I want to create a <em>apt repository</em> from a <em>maven repository folder</em>. Following <a href="https://askubuntu.com/questions/170348/how-to-make-my-own-local-repository">Tutorials</a> &amp; <a href="http://michael.stapelberg.de/Artikel/Debian_Repository" rel="nofollow noreferrer">Tutorials</a> this works fine.</p>
  
  <pre><code>cd /path/to/maven/repo
  dpkg-scanpackages . /dev/null | gzip -9c &gt; Packages.gz
  echo deb file:///path/to/maven/repo ./ &gt;&gt; /etc/apt/sources.list
  apt-get update
  apt-ftparchive release . &gt; Release 
  gpg --output Release.gpg -ba Release
  </code></pre>
  
  <p>However, when I try to access this repository via apache like this</p>
  
  <pre><code>deb http://repository.mukis.de/apt/ ./
  </code></pre>
  
  <blockquote>
    <p>E: Encountered a section with no Package: header
    E: Problem with MergeList /var/lib/apt/lists/repository.mukis.de_apt_._de
    E: The package list or status file could not be opened</p>
  </blockquote>
  
  <p>Removing the nested maven repository folder structure solves the problem with remote. How can I solve this so a I can keep the maven structure?</p>
  
  <p><strong>Long Description</strong></p>
  
  <p>I have a Nexus OSS Server running and the <a href="https://github.com/sannies/nexus-apt-plugin" rel="nofollow noreferrer">Nexus APT Plugin</a>, which doesn't work.
  After that I tried to build the repos myself with <a href="https://wiki.debian.org/HowToSetupADebianRepository#dpkg-scanpackages_and_dpkg-scansources" rel="nofollow noreferrer">dpkg-scanpackages</a> or <a href="https://wiki.debian.org/HowToSetupADebianRepository#apt-ftparchive" rel="nofollow noreferrer">apt-ftparchive</a> with no success. <a href="https://wiki.debian.org/HowToSetupADebianRepository#reprepro_for_new_packages" rel="nofollow noreferrer">reprepro</a> copies the files why this is not an option, because I have the files twice for no reason.</p>
  
  <p>In the end what I only want is:</p>
  
  <pre><code>mvn deploy
  apt-get install deployed-package
  </code></pre>
  
  <p>The repository needs no architecture information as only java packages will be installed.</p>
  
  <p>thanks in advance,
  Muki</p>