diff --git a/error-prone-integration/pom.xml b/error-prone-integration/pom.xml new file mode 100644 index 0000000..3537928 --- /dev/null +++ b/error-prone-integration/pom.xml @@ -0,0 +1,142 @@ + + + 4.0.0 + + + maven-toolchains-exploration + com.nikolasgrottendieck + 0.0.1-SNAPSHOT + + + error-prone-integration + + + 21 + ${java.version} + + [${java.version},${parsedVersion.nextMajorVersion}) + + 2.30.0 + 3.0.2 + 0.11.2 + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + + parse-version + + + ${java.version} + + + + + + com.github.ekryd.echo-maven-plugin + echo-maven-plugin + + + + echo + + validate + + Version properties:${line.separator}java.version: + '${java.version}'${line.separator}parsedVersion.nextMajorVersion: + '${parsedVersion.nextMajorVersion}'${line.separator}toolchain.jdk.version: + '${toolchain.jdk.version}' + + + + + + + org.apache.maven.plugins + maven-toolchains-plugin + + + + select-jdk-toolchain + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + -Werror + -XDcompilePolicy=simple + + + -Xplugin:ErrorProne -Xep:DeduplicateConstants -Xep:DepAnn -Xep:InsecureCryptoUsage -Xep:IterablePathParameter -Xep:LongLiteralLowerCaseSuffix -Xep:PackageLocation:ERROR -Xep:StaticQualifiedUsingExpression -Xep:SystemExitOutsideMain -Xep:AvoidObjectArrays -Xep:CatchingUnchecked -Xep:CheckedExceptionNotThrown -Xep:DifferentNameButSame -Xep:EqualsBrokenForNull -Xep:InitializeInline -Xep:InterfaceWithOnlyStatics -Xep:MissingDefault -Xep:PreferJavaTimeOverload -Xep:PreferredInterfaceType -Xep:RedundantThrows -Xep:StatementSwitchToExpressionSwitch -Xep:SystemOut -Xep:TimeUnitMismatch -Xep:UnnecessarilyFullyQualified -Xep:UnnecessarilyUsedValue -Xep:UnnecessarilyVisible -Xep:UnnecessaryAnonymousClass -Xep:UnnecessaryDefaultInEnumSwitch -Xep:UnnecessaryOptionalGet -Xep:UnusedException -Xep:Varifier -Xep:YodaCondition -Xep:FieldCanBeFinal:WARN -Xep:FieldCanBeLocal:WARN -Xep:FieldCanBeStatic:WARN -Xep:FieldMissingNullable:WARN -Xep:ParameterMissingNullable:WARN -Xep:PrivateConstructorForUtilityClass:WARN -Xep:RemoveUnusedImports:WARN -Xep:ReturnMissingNullable:WARN -Xep:ReturnsNullCollection:WARN -Xep:UseEnumSwitch:WARN -XepExcludedPaths:.*/src/test/.* -XepOpt:NullAway:AnnotatedPackages=com.nikolasgrottendieck -XepOpt:NullAway:ExcludedFieldAnnotations=org.springframework.beans.factory.annotation.Value + + + -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED + + + + com.google.code.findbugs + jsr305 + ${findbugs-jsr305.version} + + + com.google.errorprone + error_prone_core + ${error-prone.version} + + + com.uber.nullaway + nullaway + ${nullaway.version} + + + true + + + + + diff --git a/error-prone-integration/src/main/java/com/nikolasgrottendieck/HelloWorldApp.java b/error-prone-integration/src/main/java/com/nikolasgrottendieck/HelloWorldApp.java new file mode 100644 index 0000000..f909b1b --- /dev/null +++ b/error-prone-integration/src/main/java/com/nikolasgrottendieck/HelloWorldApp.java @@ -0,0 +1,10 @@ +package com.nikolasgrottendieck; + +class HelloWorldApp { + private HelloWorldApp() {} + + @SuppressWarnings("SystemOut") + public static void main(String[] args) { + System.out.println("Hello World!"); + } +} diff --git a/error-prone-integration/src/test/java/com/nikolasgrottendieck/JavaVersionTest.java b/error-prone-integration/src/test/java/com/nikolasgrottendieck/JavaVersionTest.java new file mode 100644 index 0000000..74d9fc4 --- /dev/null +++ b/error-prone-integration/src/test/java/com/nikolasgrottendieck/JavaVersionTest.java @@ -0,0 +1,12 @@ +package com.nikolasgrottendieck; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class JavaVersionTest { + @Test + public void runningCorrectJavaVersion() { + assertEquals(21, Runtime.version().feature()); + } +} diff --git a/pom.xml b/pom.xml index 55abb50..47be22e 100644 --- a/pom.xml +++ b/pom.xml @@ -43,6 +43,7 @@ static-ranged-calculated static-ranged-manual static-ranged-semver + error-prone-integration