Issue with release upload to Artifactory and maven-metadata.xml not properly updated

1,028 views
Skip to first unread message

Pratik Mehta

unread,
Jul 26, 2016, 10:21:55 PM7/26/16
to bndtools-users
Hi,

When uploading to artifactory, I noticed that bndtools release using

.gradle clean build release

uploads the snapshot version with a the same buildnumber.

This is how the maven deployed artifacts looks like in artifactory:

comcast-1.0.0-20150914.070543-1.pom 14-Sep-2015 09:05 1.16 KB
comcast-1.0.0-20150914.070543-1.pom.md5 14-Sep-2015 09:05 32 bytes
comcast-1.0.0-20150914.070543-1.pom.sha1 14-Sep-2015 09:05 40 bytes
comcast-1.0.0-20150929.071412-2.pom 29-Sep-2015 09:14 1.16 KB
comcast-1.0.0-20150929.071412-2.pom.md5 29-Sep-2015 09:14 32 bytes
comcast-1.0.0-20150929.071412-2.pom.sha1 29-Sep-2015 09:14 40 bytes
comcast-1.0.0-20160211.065600-3.pom 11-Feb-2016 07:56 1.16 KB
comcast-1.0.0-20160211.065600-3.pom.md5 11-Feb-2016 07:56 32 bytes
comcast-1.0.0-20160211.065600-3.pom.sha1 11-Feb-2016 07:56 40 bytes
maven-metadata.xml 11-Feb-2016 07:56 588 bytes
maven-metadata.xml.md5 11-Feb-2016 07:56 32 bytes
maven-metadata.xml.sha1 11-Feb-2016 07:56 40 bytes

Whereas bndtools deployed artifacts looks like:

cpi.camunda-0.0.0-20160711.152904-1-javadoc.jar 11-Jul-2016 17:29 69.24 KB
cpi.camunda-0.0.0-20160711.152904-1-javadoc.jar.md5 11-Jul-2016 17:29 32 bytes
cpi.camunda-0.0.0-20160711.152904-1-javadoc.jar.sha1 11-Jul-2016 17:29 40 bytes
cpi.camunda-0.0.0-20160711.152904-1-sources.jar 11-Jul-2016 17:29 12.79 KB
cpi.camunda-0.0.0-20160711.152904-1-sources.jar.md5 11-Jul-2016 17:29 32 bytes
cpi.camunda-0.0.0-20160711.152904-1-sources.jar.sha1 11-Jul-2016 17:29 40 bytes
cpi.camunda-0.0.0-20160711.152904-1.jar 11-Jul-2016 17:29 33.05 KB
cpi.camunda-0.0.0-20160711.152904-1.jar.md5 11-Jul-2016 17:29 32 bytes
cpi.camunda-0.0.0-20160711.152904-1.jar.sha1 11-Jul-2016 17:29 40 bytes
cpi.camunda-0.0.0-20160711.152904-1.pom 11-Jul-2016 17:29 525 bytes
cpi.camunda-0.0.0-20160711.152904-1.pom.md5 11-Jul-2016 17:29 32 bytes
cpi.camunda-0.0.0-20160711.152904-1.pom.sha1 11-Jul-2016 17:29 40 bytes
cpi.camunda-0.0.0-20160719.130151-1-javadoc.jar 19-Jul-2016 15:01 65.04 KB
cpi.camunda-0.0.0-20160719.130151-1-javadoc.jar.md5 19-Jul-2016 15:01 32 bytes
cpi.camunda-0.0.0-20160719.130151-1-javadoc.jar.sha1 19-Jul-2016 15:01 40 bytes
cpi.camunda-0.0.0-20160719.130151-1-sources.jar 19-Jul-2016 15:02 12.46 KB
cpi.camunda-0.0.0-20160719.130151-1-sources.jar.md5 19-Jul-2016 15:02 32 bytes
cpi.camunda-0.0.0-20160719.130151-1-sources.jar.sha1 19-Jul-2016 15:02 40 bytes
cpi.camunda-0.0.0-20160719.130151-1.jar 19-Jul-2016 15:01 32.32 KB
cpi.camunda-0.0.0-20160719.130151-1.jar.md5 19-Jul-2016 15:01 32 bytes
cpi.camunda-0.0.0-20160719.130151-1.jar.sha1 19-Jul-2016 15:01 40 bytes
cpi.camunda-0.0.0-20160719.130151-1.pom 19-Jul-2016 15:01 525 bytes
cpi.camunda-0.0.0-20160719.130151-1.pom.md5 19-Jul-2016 15:01 32 bytes
cpi.camunda-0.0.0-20160719.130151-1.pom.sha1 19-Jul-2016 15:01 40 bytes
cpi.camunda-0.0.0-20160719.131427-1-javadoc.jar 19-Jul-2016 15:14 65.02 KB
cpi.camunda-0.0.0-20160719.131427-1-javadoc.jar.md5 19-Jul-2016 15:14 32 bytes
cpi.camunda-0.0.0-20160719.131427-1-javadoc.jar.sha1 19-Jul-2016 15:14 40 bytes
cpi.camunda-0.0.0-20160719.131427-1-sources.jar 19-Jul-2016 15:14 12.46 KB
cpi.camunda-0.0.0-20160719.131427-1-sources.jar.md5 19-Jul-2016 15:14 32 bytes
cpi.camunda-0.0.0-20160719.131427-1-sources.jar.sha1 19-Jul-2016 15:14 40 bytes
cpi.camunda-0.0.0-20160719.131427-1.jar 19-Jul-2016 15:14 32.32 KB
cpi.camunda-0.0.0-20160719.131427-1.jar.md5 19-Jul-2016 15:14 32 bytes
cpi.camunda-0.0.0-20160719.131427-1.jar.sha1 19-Jul-2016 15:14 40 bytes
cpi.camunda-0.0.0-20160719.131427-1.pom 19-Jul-2016 15:14 525 bytes
cpi.camunda-0.0.0-20160719.131427-1.pom.md5 19-Jul-2016 15:14 32 bytes
cpi.camunda-0.0.0-20160719.131427-1.pom.sha1 19-Jul-2016 15:14 40 bytes
...
maven-metadata.xml 23-Jul-2016 20:45 1.18 KB
maven-metadata.xml.md5 23-Jul-2016 20:45 32 bytes
maven-metadata.xml.sha1 23-Jul-2016 20:45 40 bytes

Artifacts can be read like this : <artifactId>-<major version>.<minor version>.<incremental version>-<qualifier>-<buildNumber>

What I see is whenever I upload using bndtools/bnd the buildNumber is always 1 and due to this the value in maven-metadata.xml is not updating.

I also raised a issue for uploading to artifactory https://groups.google.com/forum/#!searchin/bndtools-users/artifactory/bndtools-users/sUpy-uxQ-50/aO3vwUOcBgAJ which fixed the issue for upload to artifactory, but I still have issues of maven-metadata.xml not being updated properly.

Thanks and Regards,
Pratik

Peter Kriens

unread,
Aug 1, 2016, 3:39:45 AM8/1/16
to bndtool...@googlegroups.com
In bndtools we do not have a build number so it is always set to 1 …

Is there a reason you miss it?

Kind regards,

Peter Kriens



--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pratik Mehta

unread,
Aug 1, 2016, 9:52:52 AM8/1/16
to bndtools-users
Hi Peter,

I am having problems with artifactory. The Artifactory calculates the maven-metadata.xml automatically after user uploading the pom file and artifactory is created with the "Maven Snapshot Version Behavior" as "unique" or "non-unique", so bnd/bndtools cannot update the maven-metadata and hence bnd/bndtools get HTTP Response 202 when trying to update maven-metadata.xml

The problem is that, when the pom and bundle bundle is uploaded maven-metadata still points to the first build that was uploaded. Artifactory expects a new build number whenever we upload a new snapshot version so that it automatically updates the maven-metadata.xml and refer to the new version.

Regards,
Pratik Mehta

 
  

Peter Kriens

unread,
Aug 5, 2016, 4:11:49 AM8/5/16
to bndtool...@googlegroups.com
Any idea how maven calculates the build number? We build on a completely clean system so we have no possibility to store a build number.

Kind regards,

Peter Kriens

Pratik Mehta

unread,
Aug 5, 2016, 9:49:50 AM8/5/16
to bndtool...@googlegroups.com
Hi Peter,

I think maven/gradle both look the the buildNumber in maven-metadata.xml and then increments the value of build number. Gradles "maven" plugin also upload the artifact to artifcatory by incrementing the build number.

This is how the maven-metadata.xml looks like:

<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>cpi</groupId>
  <artifactId>deploy.structure</artifactId>
  <version>0.0.0-SNAPSHOT</version>
  <versioning>
    <snapshot>
      <timestamp>20160803.031203</timestamp>
      <buildNumber>4</buildNumber>
    </snapshot>
    <lastUpdated>20160803031218</lastUpdated>
    <snapshotVersions>
      <snapshotVersion>
        <extension>jar</extension>
        <value>0.0.0-20160803.031203-4</value>
        <updated>20160803031203</updated>
      </snapshotVersion>
      <snapshotVersion>
        <extension>pom</extension>
        <value>0.0.0-20160803.031203-4</value>
        <updated>20160803031203</updated>
      </snapshotVersion>
      <snapshotVersion>
        <extension>zip</extension>
        <value>0.0.0-20160803.031203-4</value>
        <updated>20160803031203</updated>
      </snapshotVersion>
    </snapshotVersions>
  </versioning>
</metadata>

snapshot has a property called buildNumber.

Thanks and Regards,
Pratik Mehta

Regards,
Pratik


To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "bndtools-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bndtools-users/lzudg5sG86w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bndtools-users+unsubscribe@googlegroups.com.

Peter Kriens

unread,
Aug 5, 2016, 10:27:35 AM8/5/16
to bndtool...@googlegroups.com
Hmm, there is no way to do this atomically …

But I can take a look, can you file a bug on bnd?

Kind regards,

Peter Kriens

To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.

Pratik Mehta

unread,
Aug 5, 2016, 11:08:15 AM8/5/16
to bndtool...@googlegroups.com
Hi Peter,

I assume that when bnd tries to release it downloads the maven-metadata.xml, am I right?

So is it not possible to read maven-metadata.xml and use the buildNumber.

I have already created a bug in bnd https://github.com/bndtools/bnd/issues/1566

Thanks,
Pratik

Regards,
Pratik

Peter Kriens

unread,
Aug 5, 2016, 11:20:51 AM8/5/16
to bndtool...@googlegroups.com
I have the metadata.xml so I can increment the number. It is just that if you have 2 release close together then can get confused. 

But if maven does it, I can do it.

Kind regards,

Peter Kriens



To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages