1

I have a Spring project that I wanted to use as a JAR in another project, for this purpose I decided to use GitHub packages. Using GitHub action, whenever any new release is getting created, a new JAR will get publish to GitHub package, but here are my confusions.

So I used <version> in my pom.xml as 0.0.1-SNAPSHOT and made a release with tag v1.0.0 and released. New package got published and while consuming the JAR I needed to use 0.0.1-SNAPSHOT, but I wanted to use the version which is used while releasing the package to maintain versioning.

I am not getting what am I missing here. How to use GitHub release to publish new version of JAR?

Vy Do
  • 46,709
  • 59
  • 215
  • 313
Manoj ahirwar
  • 1,062
  • 1
  • 10
  • 24
  • Below lines need to be more clear: New package got published and while consuming the JAR I needed to use 0.0.1-SNAPSHOT, but I wanted to use the version which is used while releasing the package to maintain versioning. – Devender Goyal Feb 08 '23 at 07:38

1 Answers1

0

How to use GitHub release to publish new version of JAR?

Use GitHub workflow https://docs.github.com/en/packages/quickstart .

Declare configuration/options in release-package.yml for generate package when release.

Use Maven SCM plug-in https://maven.apache.org/scm/maven-scm-plugin/tag-mojo.html . See https://stackoverflow.com/a/8901942/3728901

Vy Do
  • 46,709
  • 59
  • 215
  • 313
  • Thanks for your answer. yes I am releasing like this using github actions. and its getting released too. but the version of the dependency is not the one i am creating while creating a release but its coming from the pom.xml of the jar. – Manoj ahirwar Nov 26 '21 at 11:07
  • I updated. Use Maven SCM for connection between GitHub source code management with `pom.xml` – Vy Do Nov 26 '21 at 12:00