I try a solution with using profiles :

  <profiles>
    <profile>
      <id>m1-profile</id>
      <distributionManagement>
        <repository>
          <id>M1-REPO</id>
          <name>repository maven 1</name>
          <url>file:///local/maven/maven-repository/repository</url>
          <layout>legacy</layout>
        </repository>
        <snapshotRepository>
          <id>M1-REPO</id>
          <name>repository maven 1</name>
          <url>file:///local/maven/maven-repository/repository</url>
          <layout>legacy</layout>
        </snapshotRepository>         
      </distributionManagement>
    </profile>
    
    <profile>
      <id>m2-profile</id>
      <distributionManagement>
        <repository>
          <id>M2-REPO</id>
          <name>repository maven 2</name>
          <url>file:///local/maven/maven2-repository/repository</url>
        </repository>
        <snapshotRepository>
          <id>M2-REPO</id>
          <name>repository maven 2</name>
          <url>file:///local/maven/maven2-repository/repository</url>
        </snapshotRepository>         
      </distributionManagement>
    </profile>    
  </profiles>

I try with the cli : mvn -P m2-profile,m1-profile jar:jar deploy:deploy
The snapshot is deployed in M1-REPO but not in M2-REPO. But it's
deployed in localRepository defined in$HOME/.m2/settings.xml 

Is there any way to defined more than distributionManagement/repository
?

Thanks,
- Olivier


> -----Message d'origine-----
> De : Olivier Lamy [mailto:[EMAIL PROTECTED] 
> Envoyé : lundi 14 novembre 2005 10:47
> À : Maven Users List
> Objet : [m2] Deploying snapshot artifact to m1 repository like
> 
> 
> Hi,
> I am started to migrate to m2 with simple artifact type 
> (jar). But some others applications use m1 repository like. 
> Then I want to deploy a snapshot build with mvn to a m1 
> repository. I have defined the following in my pom.xml :
> 
> <repository>
> <id>M1-REPO</id>
> <name>repository maven 1</name> 
> <url>file:///local/maven/maven-repository/repository</url>
> <layout>legacy</layout>
> </repository>
> 
> I want to deploy a SNAPSHOT (<version>SNAPSHOT</version>).
> 
> But in the m1 repository, I don't have  : 
> /local/maven/maven-repository/repository/${groupId}/${artifact
> Id}-SNAPSH
> OT.jar
> As you know, this the way used by m1 to retrieve artifact's SNAPSHOT.
> 
> An other question is how to deploy to 2 repositories : m1 
> like and a m2 ? I can't defined more than one repository in 
> the distributionManagement element.
> 
> Thanks,
> - Olivier
> 
> 
> 
> This e-mail, any attachments and the information contained 
> therein ("this message") are confidential and intended solely 
> for the use of the addressee(s). If you have received this 
> message in error please send it back to the sender and delete 
> it. Unauthorized publication, use, dissemination or 
> disclosure of this message, either in whole or in part is 
> strictly prohibited.
> **************************************************************
> ******** 
> Ce message electronique et tous les fichiers joints ainsi que 
>  les informations contenues dans ce message ( ci apres "le 
> message" ), sont confidentiels et destines exclusivement a 
> l'usage de la  personne a laquelle ils sont adresses. Si vous 
> avez recu ce message par erreur, merci  de le renvoyer a son 
> emetteur et de le detruire. Toutes diffusion, publication, 
> totale ou partielle ou divulgation sous quelque forme que se 
> soit non expressement autorisees de ce message, sont interdites.
> **************************************************************
> ******** 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to