Skip to content

Commit aea7c90

Browse files
committed
Added Publish Script
1 parent 20234af commit aea7c90

4 files changed

Lines changed: 43 additions & 24 deletions

File tree

auth0-api-java/build.gradle

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,37 @@ plugins {
22
id 'java-library'
33
}
44

5-
group = 'com.auth0'
6-
version = '1.0.0-SNAPSHOT'
7-
8-
java {
9-
sourceCompatibility = JavaVersion.VERSION_1_8
10-
targetCompatibility = JavaVersion.VERSION_1_8
5+
ext {
6+
POM_ARTIFACT_ID = 'auth0-api-java'
7+
POM_NAME = 'auth0-api-java'
8+
POM_DESCRIPTION = 'Auth0 Java Authentication and Authorization Library'
9+
POM_PACKAGING = 'jar'
1110
}
1211

12+
// Disable javadoc for this module (Java 8 target, internal API)
1313
tasks.withType(Javadoc) {
1414
enabled = false
1515
}
1616

17+
apply from: rootProject.file('gradle/versioning.gradle')
18+
19+
group = GROUP
20+
version = getVersionFromFile()
21+
22+
java {
23+
sourceCompatibility = JavaVersion.VERSION_1_8
24+
targetCompatibility = JavaVersion.VERSION_1_8
25+
}
26+
1727
dependencies {
1828
// Core dependencies
1929
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
2030
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
21-
31+
2232
// JWT validation dependencies
2333
implementation 'com.auth0:java-jwt:4.5.1'
2434
implementation 'com.auth0:jwks-rsa:0.23.0'
25-
35+
2636
// Test dependencies
2737
testImplementation 'junit:junit:4.13.2'
2838
testImplementation 'org.hamcrest:hamcrest:2.2'
@@ -41,5 +51,6 @@ test {
4151
}
4252
}
4353

44-
// This module is internal - no publishing configuration needed
45-
// It will be bundled into auth0-springboot-api as a transitive dependency
54+
logger.lifecycle("Using version ${version} for ${name} group ${group}")
55+
56+
apply from: rootProject.file('gradle/maven-publish.gradle')

auth0-springboot-api/build.gradle

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ plugins {
55
id "com.diffplug.spotless" version "6.25.0"
66
}
77

8+
ext {
9+
POM_ARTIFACT_ID = 'auth0-springboot-api'
10+
POM_NAME = 'auth0-springboot-api'
11+
POM_DESCRIPTION = 'Auth0 Springboot Authentication Library with DPoP Support'
12+
POM_PACKAGING = 'jar'
13+
}
14+
815
apply from: rootProject.file('gradle/versioning.gradle')
9-
apply from: rootProject.file('gradle/maven-publish.gradle')
1016

1117
group = GROUP
1218
version = getVersionFromFile()
@@ -60,3 +66,5 @@ spotless {
6066

6167

6268
logger.lifecycle("Using version ${version} for ${name} group ${group}")
69+
apply from: rootProject.file('gradle/maven-publish.gradle')
70+

gradle.properties

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
GROUP=com.auth0
2-
POM_ARTIFACT_ID=auth0-springboot-api
32
VERSION_NAME=1.0.0-beta.1
43

5-
POM_NAME=auth0-springboot-api
6-
POM_DESCRIPTION=Auth0 Springboot Authentication Library with DPoP Support
7-
POM_PACKAGING=jar
8-
4+
# Shared POM metadata (module-specific properties are in each module's build.gradle)
95
POM_URL=https://github.com/auth0/auth0-auth-java
106
POM_SCM_URL=https://github.com/auth0/auth0-auth-java
117

gradle/maven-publish.gradle

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,20 @@ task('javadocJar', type: Jar, dependsOn: javadoc) {
1111
from javadoc.getDestinationDir()
1212
}
1313

14-
tasks.withType(Javadoc).configureEach {
15-
javadocTool = javaToolchains.javadocToolFor {
16-
// Use latest JDK for javadoc generation
17-
languageVersion = JavaLanguageVersion.of(17)
14+
// Configure javadoc toolchain only for modules where javadoc is enabled
15+
if (tasks.findByName('javadoc')?.enabled != false) {
16+
tasks.withType(Javadoc).configureEach {
17+
javadocTool = javaToolchains.javadocToolFor {
18+
languageVersion = JavaLanguageVersion.of(17)
19+
}
1820
}
19-
}
2021

21-
javadoc {
22-
// Specify the Java version that the project will use
23-
options.addStringOption('-release', "17")
22+
javadoc {
23+
options.addStringOption('-release', "17")
24+
if(JavaVersion.current().isJava9Compatible()) {
25+
options.addBooleanOption('html5', true)
26+
}
27+
}
2428
}
2529

2630
artifacts {

0 commit comments

Comments
 (0)