I don't follow what you're actually trying to do. Are you trying to
switch between two artifactories/mirrors or change where you deploy to?
(or both?) 

-----Original Message-----
From: Erik Drolshammer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 18, 2008 3:54 AM
To: Maven Developers List
Subject: Advanced authentication with settings.xml

Hi!
I work on two projects which utilize Artifactory as build artifact 
manager. Both are used as proxies, so we want to make them both replace 
central, but not at the same time. I also deploy/release company 
internal artifacts to libs-releases/libs-snapshots to companyA's repo 
and to companyB's repo.
How can I implement this use case?

It seems to me that support for the servers element in a profile solves 
all my problems. Has such an idea been considered?

As a workaround I have tried creating two profiles in settings.xml and 
put properties i these. However, properties doesn't seem to be resolved 
neither within the properties element in the profile, nor in a server 
element.

E.g. in the following configuration none of the variables are resolved. 
(according to mvn help:effective-settings)

<settings>
   <servers>
     <server>
       <id>central</id>
       <username>${central.username}</username>
       <password>${central.password}</password>
     </server>
     <server>
       <id>libs-releases</id>
       <username>${libs-releases.username}</username>
       <password>${libs-releases.password}</password>
     </server>
     <server>
       <id>libs-snapshots</id>
       <username>${libs-snapshots.username}</username>
       <password>${libs-snapshots.password}</password>
     </server>
   </servers>
   <profiles>
     <profile>
       <id>A</id>
       <activation>
         <activeByDefault>true</activeByDefault>
       </activation>
       <properties>
         <a.username>user</a.username>
         <a.password>pwd</a.password>

         <central.username>${a.username}</central.username>
         <central.password>${a.password}</central.password>

         <libs-releases.username>${a.username}</libs-releases.username>
         <libs-releases.password>${a.password}</libs-releases.password> 


 
<libs-snapshots.username>${a.username}</libs-snapshots.username>
 
<libs-snapshots.password>${a.password}</libs-snapshots.password>
       </properties>
   </profile>
   </profiles>
</settings>


Currently I manually change the settings.xml file, but this is very 
cumbersome. I could of course use multiple settings.xml files, but this 
is not an enticing solution either.

-- 
Regards
Erik Drolshammer

---------------------------------------------------------------------
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