Hello,
Thank you all for your answers.
I looked into the scheduled task in Nexus and I think I found what I was
looking for :
1) into Nexus (admin user) : Administration -> Scheduled Tasks -> Add :
* Task type : Rebuild Maven Metadata Files
* Repository/Group : Releases (Repo) [where my artifact is published]
==> other configurations doesn't matter.
2) Into Jenkins, I found a plugin which allow to trigger a Nexus'
scheduled task :
Nexus Task Runner Plugin ->
https://wiki.jenkins-ci.org/display/JENKINS/Nexus+Task+Runner+Plugin
I configured my job on Ant+Ivy project with a post-build action given by
the plugin :
Run Nexus's task :
* nexus url
* the name of the task created into Nexus
I got in the log :
BUILD SUCCESSFUL
Total time: 7 seconds
*Start to submit Nexus scheduled tasks.
*
*Submitting... [id: 1, name: updatethemetadata, type: Rebuild Maven Metadata
Files]
End to submit Nexus scheduled tasks successfully.
*Finished: SUCCESS
I created a job which calls first my ant+ivy job and second the job of
my maven's project :
- Top level job trigger :
* ant+ivy project publish artifact into Nexus
+Nexus update maven meta data in post-build action
* Maven project is build with the latest release.
Unfortunately, I don't see a way to do this without Jenkins, like in my
shell on my PC.
Gil
Le 12/02/2014 22:07, Mark Thornton a écrit :
Nexus can be configured to rebuild the maven metadata using a scheduled
task. The disadvantage is that the metadata is then out of date until the
next run.
Mark Thornton
On Wednesday, 12 February 2014, Maarten Coene <maarten_co...@yahoo.com>
wrote:
When we make an Ivy release, we also publish Ivy to the Apache Nexus
Repository. We use <ivy:publish> for this.
As far a I know we don't update the maven-metadata.xml, it seems to happen
automatically by Nexus?
Here is the build file we use:
http://svn.apache.org/repos/asf/ant/ivy/core/trunk/build-release.xml
The target for uploading to nexus is 'upload-nexus'.
Maarten
________________________________
Van: David Weintraub <qazw...@gmail.com <javascript:;>>
Aan: ivy-user@ant.apache.org <javascript:;>
Verzonden: woensdag 12 februari 16:55 2014
Onderwerp: Re: Publishing into Nexus repository - metadata not updated
We don't use `<ivy:publish>` because it's not entirely Maven compatible.
We use `<ivy:makepom>` to build the pom, then use Jenkins' Promote Build
Plugin to use `mvn deploy` to push the artifact into the repository.
We actually build two poms: A pom-snapshot.xml and a pom.xml. After a good
build, Jenkins automatically uses pom-snapshot.xml to publish our jar into
the Maven snapshot repository. Later on, developers can "promote" a build
manually to publish the jar using pom.xml to our standard repository.
--
David Weintraub
qazw...@gmail.com <javascript:;>
perl -e 'print "Just another second rate Perl Hacker\n";'
On Feb 12, 2014, at 9:08 AM, gillo...@free.fr <javascript:;> wrote:
Hi,
I have a Maven project which has a dependency on an ANT project
(different svn repositories).
I usually package my Ant project, upload it manually into my Nexus
repository and update my pom with the new version number.
This ANT project can have a lot (like 10) releases a day and doing this
process manually is a mess.
I try to use Ivy for publishing this artifact into Nexus automatically
and it works :)
The only problem is that maven-metadata.xml file in Nexus is not updated
by Ivy when publishing my jar, so my Maven project does not take the
lastest release version.
Is there a way for Ivy to trigger an update of the maven-metadata.xml
file into Nexus ? Or is my publish process wrong ?
my publish target :
<ivy:publish resolver="nexus-deploy" revision="${artifact.version}"
overwrite="false"
artifactspattern="${dist.dir}/[artifact](-[classifier]).[ext]"
publishivy="true">
</ivy:publish>
my resolver :
<url name="nexus-deploy" m2compatible="true" >
<artifact pattern="${url.nexus.releases}/${ivy.pattern}"/>
</url>
Thanks,
Gil
(Sorry if make some english mistake, it's not my native language :[ )