Hi Francois,

in my experience you will need to deploy from a single
machine in a single call to deploy:deploy-file, attaching
all the artifacts you need to deploy with qualifiers, e.g.:

Use a single free form jenkins job to
- synchronously trigger a multiconfiguration job in
  jenkins to build the native libraries (mvn install there,
  not mvn deploy!),
- and then collect the artifacts generated from the
  multiconfiguration job and deploy them to your
  repository:
  mvn deploy:deploy-file \
    -Durl=http://centos-dev:8090/repository/internal/  \
    -DrepositoryId=archiva.internal  \
    -DgroupId=com.myCompany -DartifactId=myLib \
    -Dversion=1.0.0 \
    -Dtypes=zip,zip \
    -Dclassifiers=x64-natives-linux,x64-natives-win \
    -Dfiles=myLib-x64-natives-linux.zip,jre-x64-natives-win.zip \
    -Dfile=some_file

You will need to make up a main artifact (some_file) to
deploy (cant' remember whether you could use the
pom file) - I usually use a file created by combining all
the machine dependent stuff into one big archive which
also allows me to use a single artifact as dependency
in further builds.

Doing it this way avoids at least two pitfalls:
- "mvn deploy" is not atomic (have a look at the output
  of mvn deploy to see what it does) and deploying the
  same artifact from two machines to the same repo is
  asking for trouble (like: losing one or the other from
  time to time)
- Even if the repository manager you are using does not
  enforce a "deploy once" strategy (e.g. for -SNAPSHOT
  releases) you will end up with *multiple* versions instead
  of one, which can lead to really obscure behaviour when
  the repository manager cleans up stuff it consideres
  no longer necessary.

Hth & Cheers,
Wolf

On 29.06.2015 09:53, Francois MAROT wrote:
> Hello all,
>
> I'm in the process of converting an existing build to Maven.
> I have 2 Jenkins jobs building the same native library on 2 different
> systems (win / lin). At the end of each one, I want to deploy them on my
> Archiva repo.
> So I execute the following commands :
>
> On a Linux computer:
> mvn deploy:deploy-file -Dfile=myLib-x64-natives-linux.zip
> -Dclassifier=natives-linux  -DgroupId=com.myCompany  -DartifactId=myLib
> -Dversion=1.0.0 -DrepositoryId=archiva.internal 
> -Durl=http://centos-dev:8090/repository/internal/
>
> On a Windows computer:
> mvn deploy:deploy-file -Dfile=jre-x64-natives-win.zip
> -Dclassifier=natives-win  -DgroupId=com.myCompany  -DartifactId=myLib
> -Dversion=1.0.0 -DrepositoryId=archiva.internal 
> -Durl=http://centos-dev:8090/repository/internal/
>
> Problem is the second command leads to a "build failed" because the pom of
> the project in version 1.0.0 is already deployed...
> BUT, I am lucky because the artifact with classifier "natives-win" has
> already been uploaded so both artifact end up on the server correctly. So
> builds depending on them can retreive them correctly and everything is
> fine...
> ... except that I don't want to base my build on luck and would like to know
> what is the correct way to deploy 2 artifacts with everything being the same
> except the qualifier.
>
> How do you pepole deploy a same artifact but built by different computers,
> architectures ?
>
> I'm using Maven 3.3.1 & Apache Archiva 2.1.1
>
>
>
> --
> View this message in context: 
> http://maven.40175.n5.nabble.com/mvn-deploy-deploy-file-with-same-groupId-artifactId-but-different-classifiers-tp5838931.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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