0

I'm currently working on a Maven project and I want to create a fat jar. when I'm doing a remote build, the name of the jar automatically gets transformed to some numbers, which I don't want since I would have to update my other project to use the latest JAR.

Currently my pom.xml has this:

<artifactId>myProject</artifactId>
<groupId>a.b.c.d</groupId>
<version>1.0-SNAPSHOT</version>

When I do remote build, 1.0-SNAPSHOT gets transformed into 000-feature-7654321 (this number gets changed every time I make a new commit)

Due to this, the generated jar file looks like myProject-000-feature-7654321.jar but I want it to be something like myProject-1.0-SNAPSHOT.jar which will always contain the latest changes.

1 Answers1

0

This means that your remote build changes the version before or during the build.

Look at the gitlab build script to figure out what happens there.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
  • during the build. in the logs it says 1.0-SNAPSHOT is transformed to 000-features-7654321 – Abhicruiser May 14 '21 at 14:47
  • This is probably done by your gitlab-ci build script. But we cannot tell if you do not know it. – J Fabian Meier May 14 '21 at 14:57
  • thanks, that was really useful. so, In the gtilab-ci.yml, I used something like version = {SEVER_VERSION}, I changed it to version = {VERSION} .now, it's working as I want. – Abhicruiser May 14 '21 at 15:26