[ 
https://jira.codehaus.org/browse/MNG-5797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=366035#comment-366035
 ] 

Jan Sievers commented on MNG-5797:
----------------------------------

this happened using an internal Nexus, version 2.11.1-01
I saw the concatenated User-Agent value in the nexus HTTP access logs.

The scenario is a little involved (more or less release automation including 
auto-versioning and staging/promoting) but basically it has two potentially 
different maven versions which are supposed to be deploying to the same staging 
repo before it is closed via REST API.
If the first mvn deploy uses version <= 3.1.1 and the second mvn deploy uses 
version >= 3.2.1 (or vice versa), the deployments end up in different stages 
and te close will only catch half of the deployed artifacts.

We can't make sure both 'mvn deploy' invocations use the same maven version in 
all cases and we rely on a custom value of User-Agent to be able to 
automatically identify stages when we close/promote them using the Nexus 
staging REST APIs. So basically yes this is preventing us from updating to 
maven 3.2/3.3 for this internal scenario.
Granted, it's a custom setup and others won't be affected by this as much as 
long as they don't use Nexus staging APIs and rely on User-Agent to be correct.

> 'mvn deploy' sends HTTP User-Agent twice
> ----------------------------------------
>
>                 Key: MNG-5797
>                 URL: https://jira.codehaus.org/browse/MNG-5797
>             Project: Maven
>          Issue Type: Bug
>          Components: Deployment
>    Affects Versions: 3.2.1, 3.3.1
>         Environment: maven 3.2.1 or later (up to 3.3.1), Java 7, Windows 7 64 
> bit
>            Reporter: Jan Sievers
>            Assignee: Jason van Zyl
>         Attachments: userAgent.zip
>
>
> This may be actually a wagon-http problem but I'm opening it here since maven 
> redistributes wagon-http.
> Steps to reproduce:
> Using maven 3.2.1 or later (i.e. wagon-http 2.6 or later):
> # unzip attached userAgent.zip
> # copy simplelogger.properties to $M2_HOME/conf/logging/ (as per 
> [instructions|https://support.sonatype.com/entries/23656571-Configuring-Maven-HTTP-Wagon-Detailed-Logging]
> # export MAVEN_OPTS="$MAVEN_OPTS 
> -Djava.util.logging.config.file=$M2_HOME/conf/logging/simplelogger.properties"
> # using pom.xml from attached userAgent.zip:
> {code}
> mvn -V clean deploy 
> -DaltDeploymentRepository=id::default::<HTTP_DEPLOYMENT_URL>
> {code}
> you can see in the build log that HTTP header "User-Agent" is sent twice:
> {code}
> FINE: http-outgoing-0 >> User-Agent: Apache-Maven/3.2.1 (Java 1.7.0_67; 
> Windows 7 6.1)
> Apr 02, 2015 1:34:52 PM 
> org.apache.maven.wagon.providers.http.httpclient.headers onRequestSubmitted
> FINE: http-outgoing-0 >> User-Agent: Apache-Maven/3.2.1 (Java 1.7.0_67; 
> Windows 7 6.1)
> Apr 02, 2015 1:34:52 PM 
> org.apache.maven.wagon.providers.http.httpclient.headers onRequestSubmitted
> {code}
> when using maven 3.1.1 or earlier, "User-Agent" is sent only once.
> You could argue that HTTP headers are map keys and sending them twice with 
> the same value should not hurt. However, this causes an issue when deploying 
> to Sonatype Nexus. 
> Background: Nexus uses the value of User-Agent to disambiguate deployments 
> from multiple clients into separate staging repos. Nexus concatenates the two 
> values instead, effectively using "<value>, <value>" as staging repo key. Not 
> sure if this is a Nexus bug as well.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to