Hi,
For a new workspace I’ve created I’m trying to release some bundles to an AWS CodeArtifact repository but the maven-metadata.xml update is rejected as it’s using 1.0.0.SNAPSHOT as a version which CodeArtifact doesn’t seem to recognise as a snapshot version.
The error I get when running gradle release:
error : Release my.bundle.jar, into MavenBndRepository [localRepo=/Users/brampouwelse/.m2/repository, storage=Release, inited=true, redeploy=false], exception Could not store my-project/my.bundle/1.0.0.SNAPSHOT/maven-metadata.xml from /Users/brampouwelse/.m2/repository/my-project/my.bundle/1.0.0.SNAPSHOT/maven-metadata-707F2AA1.xml with TaggedData [tag=null, code=400, modified=Thu Jan 01 01:00:00 CET 1970, url=https://my-codeartifact-repo.d.codeartifact.eu-west-1.amazonaws.com/maven/snapshots/my-project/my.bundle/1.0.0.SNAPSHOT/maven-metadata.xml, state=OTHER, msg=maven-metadata.xml has 'version' field declared as '1.0.0.SNAPSHOT' which is not a SNAPSHOT version.This request is intended only for SNAPSHOT versions]
When consuming a snapshot version from maven bnd automatically changes the version from 1.2.3-SNAPSHOT to 1.2.3.SNAPSHOT, is there a way to get it to do the same but then the other way around when updating?
In an attempt to get it to work I’ve tried overriding the version with the -pom instruction, but results in even stranger behaviour
What I’ve added:
-pom: groupid=com.example, \
where=META-INF/maven/pom.xml, \
version=1.2.3-SNAPSHOT
The artifacts are uploaded to the maven repo using the version from the bundle version, that version is in the pom I can get from the repo as well, the group id is ignored as well.
Below a snippet of the pom as it’s uploaded to the maven repo (that seems to ignore te -pom instruction) and then the pom as it’s in the bundle jar (that does seem to use the -pom instruction).
maven repo pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>my-project</groupId>
<artifactId>my.bundle</artifactId>
<version>1.0.0.SNAPSHOT</version>
<description>my.bundle</description>
<name>my.bundle</name>
bundle pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my.bundle</artifactId>
<version>1.2.3-SNAPSHOT</version>
<description>my.bundle</description>
<name>my.bundle</name>
I’m still using bnd 5.3.0 and have not yet upgraded to the latest 6.0.0 release.
Hope there is someone here that will come-up with some configuration option I’ve missed
Cheers,
Bram