kordamp / pomchecker

🦉 Maven POM syntax checker
Apache License 2.0
65 stars 11 forks source link

Maven Central Rules: Pomchecker does not handle CI friendly versions correctly #17

Closed helpermethod closed 1 year ago

helpermethod commented 1 year ago

Not sure if this is really a bug, but:

In my pom.xml file I'm using a (CI friendly) version placeholder which I set at build time.

<groupId>io.github.helpermethod</groupId>
 <artifactId>zip-forge</artifactId>
<version>${revision}</version>

In order for the build to work locally, I've defined a fallback/dummy value for revision.

<properties>
    <revision>1.0.0-SNAPSHOT</revision>
</properties>

pomchecker complains that in order to upload to Maven Central, the versionproperty can't be a -SNAPSHOT version, which is technically correct, but wrong in this case

cannot be uploaded to Maven Central due to the following reasons:
 * <version> can not be -SNAPSHOT.

Maybe I should clarify that this happens in the context of a JReleaser Maven Central release. Here's the build log

https://github.com/helpermethod/zip-forge/actions/runs/5787413210/job/15684279597#step:4:152

helpermethod commented 1 year ago

Turns out Pomchecker was right, it seems that Maven 3.9.4 does not replace project.version correctly (yet) when using CI-friendly versions.