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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

plugins {
id 'application'
id 'java-library'
id 'maven-publish'
id 'signing'
id 'com.diffplug.spotless' version '6.18.0'
id 'org.checkerframework' version '0.6.27'
id("net.ltgt.errorprone") version "2.0.2"
Expand Down Expand Up @@ -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.

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.




java {
withJavadocJar()
withSourcesJar()
}

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.

from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'Specimin'
description = 'A specification minimizer for Java language'
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.

url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
// 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).

}
}
scm {
connection = 'scm:git:[email protected]:kelloggm/specimin.git'
developerConnection = 'scm:git:[email protected]:kelloggm/specimin.git'
url = ''
}
}
}
}
repositories {
maven {
// I think ultimately these urls should be the Maven repos, though I have no ideas how to create those repos
def releasesRepoUrl = layout.buildDirectory.dir('.')
def snapshotsRepoUrl = layout.buildDirectory.dir('.')
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}

javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}