Skip to content

Commit 9fb9a35

Browse files
committed
MXTS-74974: modernize microdocs-crawler-gradle publishing via com.maxxton.convention
1 parent a21ccc8 commit 9fb9a35

3 files changed

Lines changed: 35 additions & 49 deletions

File tree

microdocs-crawler-gradle/build.gradle

Lines changed: 9 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,13 @@ plugins {
33
id "groovy"
44
id "java"
55
id "java-library"
6-
id "signing"
76
id "maven-publish"
8-
id "com.google.cloud.artifactregistry.gradle-plugin" version "2.2.0"
7+
id "com.maxxton.convention" version "3.3.2"
98
}
109

11-
publishing {
12-
publications {
13-
mavenJava(MavenPublication) {
14-
from components.java
15-
pom {
16-
name = 'MicroDocs Gradle Crawler'
17-
description = 'MicroDocs crawler for gradle projects'
18-
url = 'https://github.com/MaxxtonGroup/microdocs'
19-
licenses {
20-
license {
21-
name = 'The Apache Software License, Version 2.0'
22-
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
23-
distribution = 'repo'
24-
}
25-
}
26-
developers {
27-
developer {
28-
id = 's.hermans'
29-
name = 'Steven Hermans'
30-
}
31-
}
32-
scm {
33-
url = 'scm:git@github.com:MaxxtonGroup/microdocs.git'
34-
connection = 'scm:git@github.com:MaxxtonGroup/microdocs.git'
35-
developerConnection = 'scm:git@github.com:MaxxtonGroup/microdocs.git'
36-
}
37-
}
38-
}
39-
}
40-
repositories {
41-
// mavenLocal()
42-
maven {
43-
url "artifactregistry://europe-maven.pkg.dev/dynamic-concept-192711/maxxton-maven-registry"
44-
}
45-
}
46-
}
10+
// Publishing (mavenJava publication + maxxton-maven-registry repository) is
11+
// auto-configured by the com.maxxton.convention plugin once maven-publish
12+
// and java are detected - see PublishingConfiguration in maxxton-conventions.
4713

4814
repositories {
4915
mavenCentral()
@@ -60,8 +26,8 @@ dependencies {
6026
api("com.maxxton:microdocs-core-java:3.0.0")
6127
}
6228

63-
group = 'com.maxxton'
64-
version = '4.0.1'
29+
// group and version now come from gradle.properties, set before
30+
// the com.maxxton.convention plugin's PublishingConfiguration reads them.
6531

6632

6733
task fatJar(type: Jar, dependsOn: 'jar') {
@@ -88,10 +54,9 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
8854
from 'build/docs/javadoc'
8955
}
9056

91-
task sourcesJar(type: Jar) {
92-
from sourceSets.main.allSource
93-
archiveClassifier = 'sources'
94-
}
57+
// sourcesJar is created automatically by withSourcesJar() below (via the
58+
// com.maxxton.convention plugin's PublishingConfiguration, which calls it
59+
// as soon as maven-publish is applied).
9560

9661
artifacts {
9762
archives fatJar
@@ -104,8 +69,3 @@ java {
10469
withJavadocJar()
10570
withSourcesJar()
10671
}
107-
108-
signing {
109-
sign configurations.archives
110-
sign publishing.publications
111-
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
group=com.maxxton
2+
version=4.0.1
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
1+
pluginManagement {
2+
repositories {
3+
mavenLocal()
4+
maven {
5+
url = uri("artifactregistry://europe-maven.pkg.dev/dynamic-concept-192711/maxxton-maven-virtual")
6+
}
7+
gradlePluginPortal()
8+
}
9+
plugins {
10+
id("com.google.cloud.artifactregistry.gradle.plugin") version "2.2.0"
11+
}
12+
}
13+
14+
buildscript {
15+
repositories {
16+
gradlePluginPortal()
17+
}
18+
dependencies {
19+
classpath("com.google.cloud.artifactregistry.gradle-plugin:com.google.cloud.artifactregistry.gradle-plugin.gradle.plugin:2.2.0")
20+
}
21+
}
22+
23+
apply plugin: com.google.cloud.artifactregistry.gradle.plugin.ArtifactRegistryGradlePlugin
24+
125
rootProject.name = 'microdocs-crawler-gradle'

0 commit comments

Comments
 (0)