Difference between revisions of "Aggiungere Repository Personalizzati per Soddisfare Dipendenze"

From Servizi RSI
Jump to: navigation, search
Line 14: Line 14:
 
Per fare questo, eseguire i seguenti comandi:
 
Per fare questo, eseguire i seguenti comandi:
  
<nowiki>svn co http://svn.apache.org/repos/asf/incubator/shindig/trunk shindig</nowiki>
+
    svn co http://svn.apache.org/repos/asf/incubator/shindig/trunk shindig
... Subversion will checkout the trunk of Apache Shindig ...
+
    ... Subversion will checkout the trunk of Apache Shindig ...
  
cd shindig
+
    cd shindig
  
mvn install
+
    mvn install
... Maven will build Shindig ...
+
    ... Maven will build Shindig ...
Downloading: http://localhost:8081/nexus/content/groups/\
+
    Downloading: http://localhost:8081/nexus/content/groups/\
public/caja/caja/r2178/caja-r2178.jar
+
    public/caja/caja/r2178/caja-r2178.jar
...
+
    ...
[INFO] ------------------------------------------------------------------------
+
    [INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
+
    [ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
+
    [INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
+
    [INFO] Failed to resolve artifact.
  
Missing:
+
    Missing:
----------
+
    ----------
1) caja:caja:jar:r2178
+
    1) caja:caja:jar:r2178
 +
    Try downloading the file manually from the project website.
 +
    ...
  
  Try downloading the file manually from the project website.
+
    ----------
 +
    3 required artifacts are missing.
  
...
+
    for artifact:
----------
+
    org.apache.shindig:shindig-gadgets:jar:1-SNAPSHOT
3 required artifacts are missing.
 
  
for artifact:
+
    from the specified remote repositories:
  org.apache.shindig:shindig-gadgets:jar:1-SNAPSHOT
+
    nexus (http://localhost:8081/nexus/content/groups/public)
 
 
from the specified remote repositories:
 
  nexus (http://localhost:8081/nexus/content/groups/public)
 

Revision as of 11:59, 17 May 2010

Se, a questo punto hai configurato il settings.xml Maven onde sfruttare Nexus come un mirror per tutti i repository, puo' accadere che alcuni progetti non siano in grado di recuperare gli artefatti dall' installazione locale Nexus.

Questo di solito accade perché si sta cercando di costruire un progetto che ha definito un insieme personalizzato di release e snapshot nel pom.xml.

Questo è sicuramente succederà se si aggiungono repository personalizzati di terze parti Maven per la configurazione.

Come esempio, proponiamo di compilare Apache Shindig dai sorgenti di cui abbiamo fatto il ChekOut da Apache Incubator.

Che cosa è Shindig Apache? Diciamo che Shindig mira a fornire un contenitore che permetterà alle persone di eseguire gadget OpenSocial. Essa ci offre un esempio di progetto interessante, perché dipende da alcuni repository Maven personalizzati per i componenti che devono ancora essere aggiunti al repository centrale Maven. Usando Shindig come esempio si puo' vedere cosa succede quando Nexus non ha ancora gli artefatti e quali passi si possono adottare per aggiungere i repository di Nexus.

Il seguente esempio presuppone che si è installato Subversion e che si possa eseguire Subversion da riga di comando. Facciamo il CheckOut di Apache Shindig dalla Apache Incubator con Subversion e compiliamo.

Per fare questo, eseguire i seguenti comandi:

   svn co http://svn.apache.org/repos/asf/incubator/shindig/trunk shindig
   ... Subversion will checkout the trunk of Apache Shindig ...
   cd shindig
   mvn install
   ... Maven will build Shindig ...
   Downloading: http://localhost:8081/nexus/content/groups/\
   public/caja/caja/r2178/caja-r2178.jar
   ...
   [INFO] ------------------------------------------------------------------------
   [ERROR] BUILD ERROR
   [INFO] ------------------------------------------------------------------------
   [INFO] Failed to resolve artifact.
   Missing:
   ----------
   1) caja:caja:jar:r2178
   Try downloading the file manually from the project website.
   ...
   ----------
   3 required artifacts are missing.
   for artifact: 
   org.apache.shindig:shindig-gadgets:jar:1-SNAPSHOT
   from the specified remote repositories:
   nexus (http://localhost:8081/nexus/content/groups/public)