Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload a "dev" version to Maven Central #49

Open
kelson42 opened this issue Jul 21, 2023 · 5 comments · May be fixed by #52
Open

Upload a "dev" version to Maven Central #49

kelson42 opened this issue Jul 21, 2023 · 5 comments · May be fixed by #52
Assignees
Labels
enhancement New feature or request question Further information is requested
Milestone

Comments

@kelson42
Copy link
Contributor

Developers using java-libkiwix can only use the official releases of the library... or compile it themselves... which is a bitcumbersome.

This is is in particular true for kiwix-android devs.
.

Would really ease the integration work around java-libkiwix to publish for each commit, a "dev" version on Maven Central.

@kelson42 kelson42 added enhancement New feature or request question Further information is requested labels Jul 21, 2023
@kelson42 kelson42 added this to the 1.1.0 milestone Jul 21, 2023
@MohitMaliFtechiz
Copy link
Collaborator

We can publish the java-libkiwix for each commit on maven central, but the artifact will not be available for downloading and testing until it is officially released . Users can download the .aar or .pom file from Maven for the released versions, but there is no option to download the staging artifact.(which have not been officially released yet).

@kelson42
Copy link
Contributor Author

@MohitMaliFtechiz
Copy link
Collaborator

@kelson42, SNAPSHOTS are different they are mainly use for development environment and they will upload to the other directory https://s01.oss.sonatype.org/content/repositories/snapshots/. But yes SNAPSHOTS will do the job since they are immediately available for testing after uploading so developer do not need to wait for a while like release artifact, but there is some things to be notice.

If we wish to publish a snapshot on every commit, it is crucial to increment the version number appropriately. For example, if we initially published version 1.0.0-SNAPSHOT, any subsequent updated snapshot with new code changes should have an incremented version number, such as 1.0.1-SNAPSHOT. Attempting to publish the updated code with the same version 1.0.0-SNAPSHOT would lead to an error, as Maven recognizes that the version already exists in the repository.

In my opinion, uploading a snapshot for every single commit may not be ideal. In some cases, commits may contain small and necessary changes that may not warrant a new snapshot version. Instead, a more practical approach could be to upload the snapshot while merging the pull request.

So to implement this, we need to refactor our CI and code as snapshot will publish to the other URL.

@kelson42
Copy link
Contributor Author

kelson42 commented Jul 22, 2023

If we wish to publish a snapshot on every commit, it is crucial to increment the version number appropriately. For example, if we initially published version 1.0.0-SNAPSHOT, any subsequent updated snapshot with new code changes should have an incremented version number, such as 1.0.1-SNAPSHOT. Attempting to publish the updated code with the same version 1.0.0-SNAPSHOT would lead to an error, as Maven recognizes that the version already exists in the repository.

I think you misunderstand how it works or your explanation is confusing. Read https://www.baeldung.com/maven-snapshot-release-repository

There is no additional work of difficulty to publish automatically each new time we merge on main to the SNAPSHOT repo.

@MohitMaliFtechiz
Copy link
Collaborator

@kelson42, Thanks now I have understood correctly, we can use the snapshots for the development code.

@kelson42 kelson42 modified the milestones: 2.1.0, 2.2.0 Apr 20, 2024
@kelson42 kelson42 modified the milestones: 2.1.1, 2.2.0 May 3, 2024
@kelson42 kelson42 modified the milestones: 2.2.0, 2.3.0 Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants