Skip to content

Commit

Permalink
👷 Rework project structure for proper javadoc generation
Browse files Browse the repository at this point in the history
  • Loading branch information
lengors committed Sep 2, 2024
1 parent 8053b08 commit 8fdf4d5
Show file tree
Hide file tree
Showing 10 changed files with 610 additions and 340 deletions.
2 changes: 1 addition & 1 deletion .releaserc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins:
- - "@semantic-release/changelog"
- changelogFile: CHANGELOG.md
- - "@semantic-release/exec"
- prepareCmd: "./mvnw versions:set -DnewVersion=${nextRelease.version}"
- prepareCmd: "./mvnw versions:set-property -Dproperty=revision -DnewVersion=${nextRelease.version}"
publishCmd: "./mvnw deploy -s ./settings.xml"
- "@semantic-release/github"
- - "@semantic-release/git"
Expand Down
File renamed without changes.
337 changes: 337 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,337 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.github.lengors</groupId>
<artifactId>js2pets-parent</artifactId>
<version>${revision}</version>
</parent>

<groupId>io.github.lengors</groupId>
<artifactId>js2pets</artifactId>
<version>${revision}</version>
<name>js2pets</name>
<url>https://github.com/lengors/js2pets</url>
<description>Set of extensions and extra functionality for jsonschema2pojos library and plugins.</description>

<developers>
<developer>
<name>lengors</name>
<email>[email protected]</email>
</developer>
</developers>

<scm>
<url>https://github.com/lengors/js2pets</url>
</scm>

<licenses>
<license>
<name>The Unlicense</name>
<url>https://unlicense.org/UNLICENSE</url>
</license>
</licenses>

<properties>
<!-- Configure maven plugins -->
<maven.install.skip>false</maven.install.skip>
<maven.deploy.skip>false</maven.deploy.skip>

<!-- Dependency and plugins versions -->
<maven.central-publishing.version>0.5.0</maven.central-publishing.version>
<maven.build-helper.version>3.6.0</maven.build-helper.version>
<maven.checkstyle.version>3.4.0</maven.checkstyle.version>
<maven.compiler.version>3.13.0</maven.compiler.version>
<maven.jacoco.version>0.8.12</maven.jacoco.version>
<maven.source.version>3.3.1</maven.source.version>
<maven.gpg.version>3.2.4</maven.gpg.version>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-core</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>

<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>

<!-- Default checkstyle configuration is fine -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven.checkstyle.version}</version>
<configuration>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<configLocation>checkstyle.xml</configLocation>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven.source.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${maven.build-helper.version}</version>
<dependencies>
<dependency>
<groupId>io.github.lengors</groupId>
<artifactId>js2pets-javadoc</artifactId>
<version>${revision}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>attach-javadoc</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${project.basedir}/../javadoc/target/js2pets-${revision}-javadoc.jar</file>
<type>jar</type>
<classifier>javadoc</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven.gpg.version}</version>
<configuration>
<keyname>${MAVEN_GPG_KEYNAME}</keyname>
</configuration>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${maven.central-publishing.version}</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<waitUntil>published</waitUntil>
</configuration>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${maven.jacoco.version}</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report</goal>
</goals>
<configuration>
<formats>
<format>XML</format>
</formats>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>checkerframework</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<fork>true</fork>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${maven.lombok.version}</version>
</path>
<path>
<groupId>org.checkerframework</groupId>
<artifactId>checker</artifactId>
<version>${maven.checkerframework.version}</version>
</path>
</annotationProcessorPaths>
<annotationProcessors>
<annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker</annotationProcessor>
<annotationProcessor>org.checkerframework.checker.resourceleak.ResourceLeakChecker</annotationProcessor>
<annotationProcessor>lombok.launch.AnnotationProcessorHider$AnnotationProcessor</annotationProcessor>
<annotationProcessor>lombok.launch.AnnotationProcessorHider$ClaimingProcessor</annotationProcessor>
</annotationProcessors>
<compilerArgs>
<arg>-Xmaxerrs</arg>
<arg>10000</arg>
<arg>-Xmaxwarns</arg>
<arg>10000</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>checkerframework-jdk8</id>
<activation>
<jdk>1.8</jdk>
</activation>
<!-- using github.com/google/error-prone-javac is required when running on JDK 8 -->
<properties>
<javac.version>9+181-r4173-1</javac.version>
</properties>
<build>
<plugins>
<plugin>
<!-- This plugin execution will copy the com.google.errorprone:javac jar file to your
project’s output directory without adding that jar as an explicit dependency. -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>copy</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<artifact>com.google.errorprone:javac:${javac.version}:jar</artifact>
<outputDirectory>${project.build.directory}/javac</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs combine.children="append">
<arg>-J-Xbootclasspath/p:${project.build.directory}/javac/javac-${javac.version}.jar</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>checkerframework-jdk9orlater</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs combine.children="append">
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package io.github.lengors.js2pets.annotators;

import com.sun.codemodel.JMethod;

/**
* Extension for jsonschema2pojo's annotator that allows to listen to
* constructor generation and annotate it.
*
* @author lengors
*/
public interface Js2petsAnnotator extends org.jsonschema2pojo.Annotator {

/**
* Listener to constructor generation for annotations.
*
* @param constructor The generated constructor.
*/
void constructor(JMethod constructor);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Set of annotators for jsonschema2pojo with added functionality.
*
* @author lengors
*/
package io.github.lengors.js2pets.annotators;
1 change: 1 addition & 0 deletions core/src/main/java/lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lombok.addLombokGeneratedAnnotation = true
Loading

0 comments on commit 8fdf4d5

Please sign in to comment.