2013-04-23 13 views
7

Şu an için "örnek" settings.xml dosyalarını kopyaladım ve hemen hemen hepsi http://central URL'sine sahip bir depo içerecek gibi görünüyor. Bu beni rahatsız ediyor, çünkü elbette yerel alanda "merkezi" olarak adlandırılan bir makine olabilir, bu yüzden bu geçerli bir URN'dir, ancak aynı zamanda Maven'e özel bir anlam ifade etmelidir.Maven settings.xml sayfamda "http: // central" ne anlama geliyor?

Sadece sık kullanılan, ancak gerçek URL göz ardı ediliyor mu? Başka bir şeyle değiştirebilir miyim yoksa tamamen kaldırabilir miyim? Herhangi bir yerde belgelenmiş mi?

Önemliyse, içimizdeki bir "iBiblio" aynasına sahip olan ve bizim için "merkezi" olarak işlev gören bir şirket ağında gelişiyorum.

cevap

14

AFAIK, aşağıdaki örnekte olduğu gibi Configure Maven to Download from Nexus de söz a bogus URL olup: -

<settings> 
    <mirrors> 
    <mirror> 
     <!--This sends everything else to /public --> 
     <id>nexus</id> 
     <mirrorOf>*</mirrorOf> 
     <url>http://localhost:8081/nexus/content/groups/public</url> 
    </mirror> 
    </mirrors> 
    <profiles> 
    <profile> 
     <id>nexus</id> 
     <!--Enable snapshots for the built in central repo to direct --> 
     <!--all requests to nexus via the mirror --> 
     <repositories> 
     <repository> 
      <id>central</id> 
      <url>http://central</url> 
      <releases><enabled>true</enabled></releases> 
      <snapshots><enabled>true</enabled></snapshots> 
     </repository> 
     </repositories> 
    <pluginRepositories> 
     <pluginRepository> 
      <id>central</id> 
      <url>http://central</url> 
      <releases><enabled>true</enabled></releases> 
      <snapshots><enabled>true</enabled></snapshots> 
     </pluginRepository> 
     </pluginRepositories> 
    </profile> 
    </profiles> 
    <activeProfiles> 
    <!--make the profile active all the time --> 
    <activeProfile>nexus</activeProfile> 
    </activeProfiles> 
</settings> 

nexus profile

http://central arasında a bogus URL ile central repository indirmek üzere konfigüre edilir.

Bu URL senin single Nexus group URL'sini işaret edecek aynı settings.xml dosyada ayarlayarak ayna tarafından geçersiz kılınır. Nexus grubu daha sonra activeProfiles öğesinde aktif profil olarak listelenir.

Umarım bu yardımcı olabilir.