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

Create Maven package deployable via Gradle #1

Open
neotheprogramist opened this issue Oct 16, 2023 · 0 comments
Open

Create Maven package deployable via Gradle #1

neotheprogramist opened this issue Oct 16, 2023 · 0 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@neotheprogramist
Copy link
Member

neotheprogramist commented Oct 16, 2023

Objective:

Create a Maven package configuration within our build.gradle that allows us to push our Java project to Maven Repository.

Requirements:

  1. The build.gradle should be set up to deploy on Maven using prebuilt dependencies. This typically involves adding an appropriate task in the gradle file.
  2. Reference: An example of a gradle file setup for Maven deployment is available at incubator-tuweni's build.gradle.
  3. Dependencies should be pruned to only what's necessary, ensuring clarity and avoiding any superfluous inclusions.
  4. Ensure that the project is compatible with Java 17.

Maven Deployment Guide

Prerequisites

  1. Ensure you have Java 17 installed. Verify using: java --version

  2. Ensure you have Gradle installed. Verify using: gradle -v

Setting up your Maven credentials

Before publishing, you'll need to setup your Maven credentials. These should not be hardcoded in the build.gradle file for security reasons. Instead, they can be set in your ~/.gradle/gradle.properties file:

mavenUsername=YOUR_USERNAME
mavenPassword=YOUR_PASSWORD

Publishing to Maven Repository

  1. Navigate to the root of the repository where the build.gradle file is located.
  2. Run the following command to publish the package: gradle publish
  3. Once successfully published, the package should be available on Maven Repository.

Note: Remember not to push your ~/.gradle/gradle.properties file or any file containing your Maven credentials to any public repositories.

@neotheprogramist neotheprogramist added the good first issue Good for newcomers label Oct 17, 2023
@neotheprogramist neotheprogramist changed the title Enhance build.gradle to Deploy on Maven with Prebuilt Dependencies Create Maven package deployable via Gradle Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants