Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jlink #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
18 changes: 1 addition & 17 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.1/apache-maven-3.9.1-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
53 changes: 34 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<mapstruct.version>1.5.2.Final</mapstruct.version>
<lombok.version>1.18.26</lombok.version>
<mapstruct.version>1.5.5.Final</mapstruct.version>
<lombok.version>1.18.30</lombok.version>
<spock.version>2.4-M1-groovy-4.0</spock.version>

<!-- test properties -->
Expand All @@ -31,37 +31,38 @@

<!-- plugins -->
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
<maven-surefire-plugin.version>3.0.0-M8</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>3.0.0-M8</maven-failsafe-plugin.version>
<maven-surefire-plugin.version>3.2.2</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>3.2.2</maven-failsafe-plugin.version>
<git-commit-id-plugin.version>4.9.10</git-commit-id-plugin.version>


<!-- code quality -->
<archunit-junit5.version>1.0.1</archunit-junit5.version>
<sonar-maven-plugin.version>3.9.1.2184</sonar-maven-plugin.version>
<archunit-junit5.version>1.2.1</archunit-junit5.version>
<sonar-maven-plugin.version>3.10.0.2594</sonar-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.9</jacoco-maven-plugin.version>
<checkstyle.plugin.version>3.2.2</checkstyle.plugin.version>
<puppycrawl.checkstyle.version>10.9.3</puppycrawl.checkstyle.version>
<puppycrawl.checkstyle.version>10.12.6</puppycrawl.checkstyle.version>
<google.error-prone.compiler.version>2.18.0</google.error-prone.compiler.version>
<groovy.maven.plugin.version>2.1.0</groovy.maven.plugin.version>
<modernizer-maven-plugin.version>2.6.0</modernizer-maven-plugin.version>
<spotbugs.plugin.version>4.7.3.4</spotbugs.plugin.version>
<groovy.maven.plugin.version>3.0.2</groovy.maven.plugin.version>
<modernizer-maven-plugin.version>2.7.0</modernizer-maven-plugin.version>
<spotbugs.plugin.version>4.8.2.0</spotbugs.plugin.version>
<findsecbugs-plugin.version>1.12.0</findsecbugs-plugin.version>
<sb-contrib-plugin.version>7.6.0</sb-contrib-plugin.version>
<owasp-dependency-check-plugin.version>8.2.1</owasp-dependency-check-plugin.version>
<owasp-dependency-check-plugin.version>9.0.3</owasp-dependency-check-plugin.version>
</properties>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.7</version>
</dependency>
<!-- doesn't work with jlink
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down Expand Up @@ -102,7 +103,7 @@
<!-- feeling too lazy to define my own versions.. let's use spring boot's dependency management .. -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.6</version>
<version>3.2.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -112,7 +113,18 @@
<build>
<finalName>${project.version}-app</finalName>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jlink-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<noManPages>true</noManPages>
<noHeaderFiles>true</noHeaderFiles>
<stripDebug>true</stripDebug>
<compress>2</compress>
<verbose>true</verbose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -124,8 +136,9 @@
<arg>-Xlint:all,-options</arg>
<arg>-Xdoclint:all/protected</arg>
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne -Xep:NullAway:ERROR -XepOpt:NullAway:AnnotatedPackages=gt.app</arg>

<!-- doesn't work with jlink
<arg>-Xplugin:ErrorProne -Xep:NullAway:ERROR -XepOpt:NullAway:AnnotatedPackages=gt.app</arg>
-->
<!-- this will fix mapstruct -->
<arg>-Amapstruct.defaultComponentModel=default</arg>
<arg>-Amapstruct.defaultInjectionStrategy=constructor</arg>
Expand All @@ -136,16 +149,18 @@
<artifactId>error_prone_core</artifactId>
<version>${google.error-prone.compiler.version}</version>
</path>
<path>
<annotationProcessorPath>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
</annotationProcessorPath>
<!-- doesn't work with jlink
<path>
<groupId>com.uber.nullaway</groupId>
<artifactId>nullaway</artifactId>
<version>0.10.10</version>
<version>0.10.18</version>
</path>
-->
</annotationProcessorPaths>
</configuration>
</plugin>
Expand Down
8 changes: 1 addition & 7 deletions src/main/java/gt/app/PojoA.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,15 @@

import lombok.Data;

import javax.annotation.Nullable;

@Data
public class PojoA {
@Nullable
String firstName;
@Nullable
String lastName;
int age;
@Nullable
String country;
@Nullable
String language;

public PojoA(@Nullable String firstName, int age) {
public PojoA(String firstName, int age) {
this.firstName = firstName;
this.age = age;
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module appDeps {
requires java.base;
requires static lombok;
requires org.slf4j;
}
Loading