Skip to content

Commit 3c5aa3c

Browse files
committed
Migrate to gradle-maven-publish-plugin
Followed https://vanniktech.github.io/gradle-maven-publish-plugin/central/ changing the plugin version from 0.36.0 to 0.34.0 to we don't need to upgrade gradle. Tested by running: ```shell $ ./gradlew clean publishToMavenLocal $ ls /Users/kevincooney/.m2/repository/com/team2813/ lib limelight testing vision ```
1 parent b57dcbb commit 3c5aa3c

6 files changed

Lines changed: 77 additions & 94 deletions

File tree

buildSrc/src/main/groovy/java-common-conventions.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ spotless {
114114
javadoc {
115115
options {
116116
// CTRE (Phoenix 5 & 6)
117-
links += "https://api.ctr-electronics.com/phoenix6/release/java/"
117+
links += "https://api.ctr-electronics.com/phoenix6/stable/java/"
118118
// WPILib
119119
links += "https://github.wpilib.org/allwpilib/docs/release/java/"
120120
// REVLib
Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
1-
plugins {
2-
id 'maven-publish'
3-
}
4-
51
version = '2.0.0-rc-1'
62

7-
publishing {
8-
publications {
9-
lib2813(MavenPublication) {
10-
groupId = 'com.team2813.lib2813'
11-
from components.java
12-
artifact sourceJar
13-
pom {
14-
licenses {
15-
license {
16-
name = 'The Apache License, Version 2.0'
17-
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
18-
}
19-
}
20-
scm {
21-
connection = 'scm:git:git://github.com/Prospect-Robotics/lib2813.git'
22-
developerConnection = 'scm:git:git://github.com/Prospect-Robotics/lib2813.git'
23-
url = 'https://github.com/Prospect-Robotics/lib2813'
24-
}
25-
organization {
26-
name = 'FRC 2813 Gear Heads'
27-
url = 'https://team2813.com'
28-
}
3+
mavenPublishing {
4+
publishToMavenCentral()
5+
if (gradle.startParameter.taskNames.any { it.contains('MavenCentral') || it.contains('publishToMavenCentral') }) {
6+
signAllPublications()
7+
}
8+
9+
coordinates('com.team2813', project.name, project.version)
10+
11+
pom {
12+
inceptionYear = '2023'
13+
url = 'https://github.com/Prospect-Robotics/lib2813'
14+
licenses {
15+
license {
16+
name = 'The Apache License, Version 2.0'
17+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
18+
distribution = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
2919
}
3020
}
21+
scm {
22+
url = 'https://github.com/Prospect-Robotics/lib2813'
23+
connection = 'scm:git:git://github.com/Prospect-Robotics/lib2813.git'
24+
developerConnection = 'scm:git:git://github.com/Prospect-Robotics/lib2813.git'
25+
}
3126
}
3227
}

lib/build.gradle

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id 'java-common-conventions'
3+
id 'com.vanniktech.maven.publish' version '0.34.0'
34
id 'publishing-conventions'
45
id 'edu.wpi.first.GradleRIO' version '2026.1.1'
56
}
@@ -37,19 +38,15 @@ tasks.named('test') {
3738
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
3839
}
3940

40-
publishing {
41-
publications {
42-
lib2813(MavenPublication) {
43-
pom {
44-
name = '2813 Library'
45-
description = 'Frequently reused code written by team 2813'
46-
developers {
47-
developer {
48-
id = 'cuttestkittensrule'
49-
name = 'Kyle'
50-
email = 'mangoiscute95@gmail.com'
51-
}
52-
}
41+
mavenPublishing {
42+
pom {
43+
name = '2813 Library'
44+
description = 'Frequently reused code written by team 2813'
45+
developers {
46+
developer {
47+
id = 'cuttestkittensrule'
48+
name = 'Kyle'
49+
email = 'mangoiscute95@gmail.com'
5350
}
5451
}
5552
}

limelight/build.gradle

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id 'java-common-conventions'
3+
id 'com.vanniktech.maven.publish' version '0.34.0'
34
id 'publishing-conventions'
45
id 'edu.wpi.first.GradleRIO' version '2026.1.1'
56
}
@@ -31,24 +32,20 @@ test {
3132
useJUnit()
3233
}
3334

34-
publishing {
35-
publications {
36-
lib2813(MavenPublication) {
37-
pom {
38-
name = '2813 Limelight Library'
39-
description = 'Limelight utilities for FRC robots'
40-
developers {
41-
developer {
42-
id = 'cuttestkittensrule'
43-
name = 'Kyle'
44-
email = 'mangoiscute95@gmail.com'
45-
}
46-
developer {
47-
id = 'kcooney'
48-
name = 'Kevin'
49-
email = 'kcooney@gmail.com'
50-
}
51-
}
35+
mavenPublishing {
36+
pom {
37+
name = '2813 Limelight Library'
38+
description = 'Limelight utilities for FRC robots'
39+
developers {
40+
developer {
41+
id = 'cuttestkittensrule'
42+
name = 'Kyle'
43+
email = 'mangoiscute95@gmail.com'
44+
}
45+
developer {
46+
id = 'kcooney'
47+
name = 'Kevin'
48+
email = 'kcooney@gmail.com'
5249
}
5350
}
5451
}

testing/build.gradle

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id 'java-common-conventions'
3+
id 'com.vanniktech.maven.publish' version '0.34.0'
34
id 'publishing-conventions'
45
id 'edu.wpi.first.GradleRIO' version '2026.1.1'
56
}
@@ -34,24 +35,20 @@ tasks.named('test') {
3435
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
3536
}
3637

37-
publishing {
38-
publications {
39-
lib2813(MavenPublication) {
40-
pom {
41-
name = '2813 Testing Library'
42-
description = 'Utilities for testing FRC robots'
43-
developers {
44-
developer {
45-
id = 'cuttestkittensrule'
46-
name = 'Kyle'
47-
email = 'mangoiscute95@gmail.com'
48-
}
49-
developer {
50-
id = 'kcooney'
51-
name = 'Kevin'
52-
email = 'kcooney@gmail.com'
53-
}
54-
}
38+
mavenPublishing {
39+
pom {
40+
name = '2813 Testing Library'
41+
description = 'Utilities for testing FRC robots'
42+
developers {
43+
developer {
44+
id = 'cuttestkittensrule'
45+
name = 'Kyle'
46+
email = 'mangoiscute95@gmail.com'
47+
}
48+
developer {
49+
id = 'kcooney'
50+
name = 'Kevin'
51+
email = 'kcooney@gmail.com'
5552
}
5653
}
5754
}

vision/build.gradle

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id 'java-common-conventions'
3+
id 'com.vanniktech.maven.publish' version '0.34.0'
34
id 'publishing-conventions'
45
id 'edu.wpi.first.GradleRIO' version '2026.1.1'
56
}
@@ -32,24 +33,20 @@ test {
3233
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
3334
}
3435

35-
publishing {
36-
publications {
37-
lib2813(MavenPublication) {
38-
pom {
39-
name = '2813 Vision Library'
40-
description = 'Utilities for location and vision for FRC robots'
41-
developers {
42-
developer {
43-
id = 'cuttestkittensrule'
44-
name = 'Kyle'
45-
email = 'mangoiscute95@gmail.com'
46-
}
47-
developer {
48-
id = 'kcooney'
49-
name = 'Kevin'
50-
email = 'kcooney@gmail.com'
51-
}
52-
}
36+
mavenPublishing {
37+
pom {
38+
name = '2813 Vision Library'
39+
description = 'Utilities for location and vision for FRC robots'
40+
developers {
41+
developer {
42+
id = 'cuttestkittensrule'
43+
name = 'Kyle'
44+
email = 'mangoiscute95@gmail.com'
45+
}
46+
developer {
47+
id = 'kcooney'
48+
name = 'Kevin'
49+
email = 'kcooney@gmail.com'
5350
}
5451
}
5552
}

0 commit comments

Comments
 (0)