Reputation: 636
I'm new to Gradle, and have inherited a project. We have a project that takes a .proto file and builds a .java
file out of it, it then publishes the generated .jar it to a remote maven repo. The .proto generation is all working fine, but there are issues with the .jar
versioning.
The publishing code in build.gradle
is basically the same as this example from the docs.
When I run ./gradlew clean build
it generates the .jar
file under build/libs
. the file name is myname-1.1
. But when I pulled the file that was published to the maven repo it has the name myname-1.1-20210xxx.065xxx-xx
. (x's for redaction). I can't find any details in the docs on this, but I assume when it publishes the .jar
it appends the filename with a timestamp and possibly more.
I've been told they want the .jar file in the gradle project to have the same name as the one in the maven repo. Is this an unusual scenario? Is there a way to make these versions line up?
Upvotes: 0
Views: 154
Reputation: 16843
Quite sure you are deploying a SNAPSHOT
version to your repository.
This is the expected behavior. When you publish a SNAPSHOT
version, a timestamp is appended at the end of file.
Upvotes: 1