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

Maven Publishing #25

Merged
merged 4 commits into from
Oct 3, 2023
Merged

Maven Publishing #25

merged 4 commits into from
Oct 3, 2023

Conversation

LoiNguyenCS
Copy link
Collaborator

No description provided.

@LoiNguyenCS
Copy link
Collaborator Author

Professor, this is my attempt to publish Specimin to a local Maven repository. I must admit that I find Gradle's documentation a bit difficult to grasp, so I am not very confident about this PR. There are sections in the build file that are puzzling to me, and I've added comments to highlight those areas.

As for publishing Specimin to Maven Central, I couldn't find clear instructions in Gradle's documentation (or maybe I misunderstood it). I found upon this link , which suggests that we need to first publish our project to an approved repository like Sonatype OSS Nexus. I think this step might involve several authentication processes, so I believe it might be best if you handle it. However, if you prefer, I'd be happy to give it a shot.

Copy link
Collaborator

@kelloggm kelloggm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's focus this PR on just the changes necessary to get ./gradlew publishToMavenLocal working. You can test whether this works by running ./gradlew publishToMavenLocal and then checking if there is a jar file for specimin in your local Maven repository, which will be located at ~/.m2/repository.

As an example, this build file contains just what's needed for local publication.

With respect to publishing onto Maven Central: I'd like to do that, too, but it is much less urgent.

build.gradle Outdated
url = ''
licenses {
license {
name = 'The Apache License, Version 2.0'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This license is incorrect: Specimin is MIT licensed (see LICENSE at the top-level of the repository.

build.gradle Outdated
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'Specimin'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use all lower-case for artifactId.

build.gradle Outdated
@@ -78,3 +81,69 @@ spotless {

compileJava.dependsOn 'spotlessApply'
check.dependsOn requireJavadoc

// This groupId is just for temporal use
group = 'njit.edu'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be more specific than njit.edu. Also, group names should be "reversed urls": that is, they should be in the opposite order compared to what you'd type into a web browser. (So, e.g., com.example.* rather than example.com.*.)

Let's use edu.njit.jerse as the groupId for now.

build.gradle Outdated

// This groupId is just for temporal use
group = 'njit.edu'
version = '1.0'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a version like 0.1, since we don't intend for Specimin to be used by people outside of our research team yet.

build.gradle Outdated
// I am not sure which id and email you would like to use
id = ''
name = 'Martin Kellogg'
email = ''
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use [email protected] (this is the same email address that you can find on my website).

@LoiNguyenCS
Copy link
Collaborator Author

Professor, I have updated the build file to be able to do local maven publishing. I have tried publishing Specimin myself and there are jar files in my local maven repository. So I think we're good to go.

@LoiNguyenCS LoiNguyenCS requested a review from kelloggm October 2, 2023 23:55
@LoiNguyenCS
Copy link
Collaborator Author

Thank you for helping me remove those unused lines.

@LoiNguyenCS LoiNguyenCS merged commit a0f6175 into njit-jerse:main Oct 3, 2023
1 check passed
@LoiNguyenCS LoiNguyenCS deleted the publishing branch October 3, 2023 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants