Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
53 changes: 8 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,19 @@
This is the Java plugin to publish data to your [microdocs server](https://github.com/MaxxtonGroup/microdocs). For more info, see the three READMEs's in the subfolders.


## Publishing to Maven Central
## Publishing

Before you can publish, you'll have to do some setup.
Artifacts publish to Maxxton's internal Maven registry, not Maven Central - no GPG signing or Sonatype account needed.

1. Create a [sonatype account](https://issues.sonatype.org/secure/Signup!default.jspa) and create an issue to request access to com.maxxton
2. Install [GnuPG](https://www.gnupg.org/download/) NOTE: at least version 2.1!
3. Generate key pair by running:
```
$ gpg --full-generate-key
```
Choose RSA 2048bit with no expiration. Fill in your name, email, and passphrase. Your key is saved in `~/.gnupg`.


4. Run this to update your secring.gpg:
```
$ gpg --keyring secring.gpg --export-secret-keys > ~/.gnupg/secring.gpg
```
`microdocs-crawler-gradle` and `microdocs-core-java` use the `com.maxxton.convention` plugin, which configures the publication and registry automatically. `microdocs-crawler-doclet` never publishes its own artifact - only its fat jar is bundled into `microdocs-crawler-gradle`'s published jar.

5. Create `~/.gradle/gradle.properties` (or `C:\\Users\\username\\.gradle\\gradle.properties`) with the following properties:
To publish a new version:
1. Bump `version` in `gradle.properties` for whichever module(s) changed.
2. Run:
```
signing.keyId=keyid
signing.password=yourpassword
signing.secretKeyRingFile=C:\\Users\\username\\.gnupg\\secring.gpg

sonatypeUsername=username
sonatypePassword=password
$ ./publish.sh
```

Use `gpg --list-secret-keys --keyid-format 0xshort` to get your keyId
```
% gpg --list-secret-keys --keyid-format 0xshort
[keyboxd]
---------
sec rsa2048/0x1337CAFE 1970-01-01 [SC]
^^^^^^^^^^
## this bit is what you're looking for.
1337133713371337133713371337133713371337
uid [ultimate] Your Name <y.name@maxxton.com>
ssb rsa2048/0xCAFE1337 1970-01-01 [E]
```

6. Publish
```
$ ./publish
```

And follow the [release and deployment manual](https://central.sonatype.org/pages/releasing-the-deployment.html)
Check this link for more info on [the signing plugin](https://docs.gradle.org/current/userguide/signing_plugin.html)


### Java 8
Checkout the java8 branch for a Java 8 compatible version. The master branch will be based on Java 11, the difference is substantial due to the revised Javadoc API in since Java 9.
Checkout the java8 branch for a Java 8 compatible version. The master branch is based on Java 21.

70 changes: 16 additions & 54 deletions microdocs-core-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,16 @@
plugins {
id "java"
id "java-library"
id "signing"
id "maven-publish"
id "com.google.cloud.artifactregistry.gradle-plugin" version "2.2.0"
id "com.maxxton.convention" version "3.3.2"
}

group = 'com.maxxton'
version = '4.0.0'
// group and version come from gradle.properties, set before the
// com.maxxton.convention plugin's PublishingConfiguration reads them.

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'MicroDocs Core Java'
description = 'MicroDocs core functionalities to share accross various projects'
url = 'https://github.com/MaxxtonGroup/microdocs'
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
developers {
developer {
id = 's.hermans'
name = 'Steven Hermans'
}
}
scm {
url = 'scm:git@github.com:MaxxtonGroup/microdocs.git'
connection = 'scm:git@github.com:MaxxtonGroup/microdocs.git'
developerConnection = 'scm:git@github.com:MaxxtonGroup/microdocs.git'
}
}
}
}
repositories {
// mavenLocal()
maven {
url "artifactregistry://europe-maven.pkg.dev/dynamic-concept-192711/maxxton-maven-registry"
}
}
}
// Publishing (mavenJava publication + maxxton-maven-registry repository) is
// auto-configured by the com.maxxton.convention plugin once maven-publish
// and java are detected - see PublishingConfiguration in maxxton-conventions.

repositories {
mavenCentral()
Expand All @@ -57,17 +23,23 @@ repositories {
dependencies {
api("com.fasterxml.jackson.core:jackson-databind:2.10.1")
api("com.mashape.unirest:unirest-java:1.4.9")
testImplementation("junit:junit:4.12")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.10.2")
}

task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from 'build/docs/javadoc'
}

task sourcesJar(type: Jar) {
from sourceSets.main.allSource
archiveClassifier = "sources"
// Registers the sourcesJar task (withJavadocJar() just attaches the
// existing javadocJar task above). Declared before the artifacts{} block
// below so both tasks are guaranteed to exist by the time it references
// them, rather than relying on the com.maxxton.convention plugin having
// already created sourcesJar earlier via PublishingConfiguration.
java {
withJavadocJar()
withSourcesJar()
}

artifacts {
Expand All @@ -77,16 +49,6 @@ artifacts {
archives sourcesJar
}

signing {
sign configurations.archives
sign publishing.publications
}

java {
withJavadocJar()
withSourcesJar()
}

javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
Expand Down
26 changes: 26 additions & 0 deletions microdocs-core-java/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.fasterxml.jackson.core:jackson-annotations:2.10.1=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.fasterxml.jackson.core:jackson-core:2.10.1=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.fasterxml.jackson.core:jackson-databind:2.10.1=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.mashape.unirest:unirest-java:1.4.9=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
commons-codec:commons-codec:1.9=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
commons-logging:commons-logging:1.2=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.httpcomponents:httpasyncclient:4.1.1=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.httpcomponents:httpclient:4.5.2=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.httpcomponents:httpcore-nio:4.4.4=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.httpcomponents:httpcore:4.4.4=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.httpcomponents:httpmime:4.5.2=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apiguardian:apiguardian-api:1.1.2=integrationTestCompileClasspath,testCompileClasspath
org.json:json:20160212=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.jupiter:junit-jupiter-api:5.10.2=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.jupiter:junit-jupiter-engine:5.10.2=integrationTestRuntimeClasspath,testRuntimeClasspath
org.junit.jupiter:junit-jupiter-params:5.10.2=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.jupiter:junit-jupiter:5.10.2=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.platform:junit-platform-commons:1.10.2=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.platform:junit-platform-engine:1.10.2=integrationTestRuntimeClasspath,testRuntimeClasspath
org.junit.platform:junit-platform-launcher:1.10.2=integrationTestRuntimeClasspath,testRuntimeClasspath
org.junit:junit-bom:5.10.2=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
org.opentest4j:opentest4j:1.3.0=integrationTestCompileClasspath,integrationTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
empty=annotationProcessor,integrationTestAnnotationProcessor,testAnnotationProcessor
2 changes: 2 additions & 0 deletions microdocs-core-java/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
group=com.maxxton
version=4.0.1
22 changes: 21 additions & 1 deletion microdocs-core-java/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
rootProject.name = 'microdocs-core-java'
pluginManagement {
repositories {
mavenLocal()
maven {
url = uri("artifactregistry://europe-maven.pkg.dev/dynamic-concept-192711/maxxton-maven-virtual")
}
gradlePluginPortal()
}
}

buildscript {
repositories {
gradlePluginPortal()
}
dependencies {
classpath("com.google.cloud.artifactregistry.gradle-plugin:com.google.cloud.artifactregistry.gradle-plugin.gradle.plugin:2.2.5")
}
}

apply plugin: com.google.cloud.artifactregistry.gradle.plugin.ArtifactRegistryGradlePlugin

rootProject.name = 'microdocs-core-java'
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @author Steven Hermans
*/
public class SchemaPrimitive extends Schema {
public final class SchemaPrimitive extends Schema {

public SchemaPrimitive() { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* @author Steven Hermans
*/
public class ReflectDescriptionTag {
public final class ReflectDescriptionTag {

private String tagName;
private String keyword;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public String getClassName() {
}

@Override
public List<Parameter> parse(ReflectParameter reflectParameter, ReflectClass controller, ReflectMethod method, SchemaCollector schemaCollector) {
public List<Parameter> parse(ReflectParameter reflectParameter, ReflectClass<?> controller, ReflectMethod method, SchemaCollector schemaCollector) {
List<Parameter> parameters = new ArrayList<>();

ParameterVariable filterParameter = new ParameterVariable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
import java.util.ArrayList;
import java.util.List;

import static org.junit.Assert.assertTrue;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* @author Steven Hermans
*/
public class ReflectClassTest {

@org.junit.Test
@Test
public void testHasParent() {
ReflectClass<ArrayList<?>> arrayListClass = new ReflectClass<>();
arrayListClass.setSimpleName(ArrayList.class.getSimpleName());
Expand All @@ -31,7 +33,7 @@ public void testHasParent() {

}

@org.junit.Test
@Test
public void testHasParentNotLoaded() {
ReflectClass<ArrayList<?>> arrayListClass = new ReflectClass<>();
arrayListClass.setSimpleName(ArrayList.class.getSimpleName());
Expand Down
67 changes: 14 additions & 53 deletions microdocs-crawler-gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,13 @@ plugins {
id "groovy"
id "java"
id "java-library"
id "signing"
id "maven-publish"
id "com.google.cloud.artifactregistry.gradle-plugin" version "2.2.0"
id "com.maxxton.convention" version "3.3.2"
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'MicroDocs Gradle Crawler'
description = 'MicroDocs crawler for gradle projects'
url = 'https://github.com/MaxxtonGroup/microdocs'
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
developers {
developer {
id = 's.hermans'
name = 'Steven Hermans'
}
}
scm {
url = 'scm:git@github.com:MaxxtonGroup/microdocs.git'
connection = 'scm:git@github.com:MaxxtonGroup/microdocs.git'
developerConnection = 'scm:git@github.com:MaxxtonGroup/microdocs.git'
}
}
}
}
repositories {
// mavenLocal()
maven {
url "artifactregistry://europe-maven.pkg.dev/dynamic-concept-192711/maxxton-maven-registry"
}
}
}
// Publishing (mavenJava publication + maxxton-maven-registry repository) is
// auto-configured by the com.maxxton.convention plugin once maven-publish
// and java are detected - see PublishingConfiguration in maxxton-conventions.

repositories {
mavenCentral()
Expand All @@ -60,8 +26,8 @@ dependencies {
api("com.maxxton:microdocs-core-java:3.0.0")
}

group = 'com.maxxton'
version = '4.0.1'
// group and version now come from gradle.properties, set before
// the com.maxxton.convention plugin's PublishingConfiguration reads them.


task fatJar(type: Jar, dependsOn: 'jar') {
Expand All @@ -88,9 +54,14 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
from 'build/docs/javadoc'
}

task sourcesJar(type: Jar) {
from sourceSets.main.allSource
archiveClassifier = 'sources'
// Registers the sourcesJar task (withJavadocJar() just attaches the
// existing javadocJar task above). Declared before the artifacts{} block
// below so both tasks are guaranteed to exist by the time it references
// them, rather than relying on the com.maxxton.convention plugin having
// already created sourcesJar earlier via PublishingConfiguration.
java {
withJavadocJar()
withSourcesJar()
}

artifacts {
Expand All @@ -99,13 +70,3 @@ artifacts {
archives javadocJar
archives sourcesJar
}

java {
withJavadocJar()
withSourcesJar()
}

signing {
sign configurations.archives
sign publishing.publications
}
17 changes: 17 additions & 0 deletions microdocs-crawler-gradle/gradle.lockfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.fasterxml.jackson.core:jackson-annotations:2.10.1=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.fasterxml.jackson.core:jackson-core:2.10.1=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.fasterxml.jackson.core:jackson-databind:2.10.1=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.mashape.unirest:unirest-java:1.4.9=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.maxxton:microdocs-core-java:3.0.0=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
commons-codec:commons-codec:1.9=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
commons-logging:commons-logging:1.2=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.httpcomponents:httpasyncclient:4.1.1=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.httpcomponents:httpclient:4.5.2=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.httpcomponents:httpcore-nio:4.4.4=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.httpcomponents:httpcore:4.4.4=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.httpcomponents:httpmime:4.5.2=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.json:json:20160212=compileClasspath,integrationTestCompileClasspath,integrationTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
empty=annotationProcessor,integrationTestAnnotationProcessor,testAnnotationProcessor
2 changes: 2 additions & 0 deletions microdocs-crawler-gradle/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
group=com.maxxton
version=4.0.1
Loading