Skip to content

Support JDK 17 #9

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

Open
wants to merge 3 commits into
base: master
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
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ This project provides a [Java 6 Annotation processor](http://docs.oracle.com/jav
<dependencies>
<dependency>
<groupId>com.github.pellaton.config-validation-processor</groupId>
<artifactId>config-validation-processor-java11</artifactId>
<artifactId>config-validation-processor-java17</artifactId>
<!-- For Java 11: <artifactId>config-validation-processor-java11</artifactId> -->
<!-- For Java 8: <artifactId>config-validation-processor-java8</artifactId> -->
<!-- For Java 7: <artifactId>config-validation-processor-java7</artifactId> -->
<!-- For Java 6: <artifactId>config-validation-processor-java6</artifactId> -->
<version>3.0.7</version>
</dependency>
</dependencies>
Expand All @@ -37,16 +37,14 @@ This project provides a [Java 6 Annotation processor](http://docs.oracle.com/jav
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>3.11.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<release>17</release>
<annotationProcessors>
<annotationProcessor>com.github.pellaton.springconfigvalidation.SpringConfigurationValidationProcessorJava11</annotationProcessor>
<annotationProcessor>com.github.pellaton.springconfigvalidation.SpringConfigurationValidationProcessorJava17</annotationProcessor>
<!-- For Java 11: <annotationProcessor>com.github.pellaton.springconfigvalidation.SpringConfigurationValidationProcessorJava11</annotationProcessor> -->
<!-- For Java 8: <annotationProcessor>com.github.pellaton.springconfigvalidation.SpringConfigurationValidationProcessorJava8</annotationProcessor> -->
<!-- For Java 7: <annotationProcessor>com.github.pellaton.springconfigvalidation.SpringConfigurationValidationProcessorJava7</annotationProcessor> -->
<!-- For Java 6: <annotationProcessor>com.github.pellaton.springconfigvalidation.SpringConfigurationValidationProcessorJava6</annotationProcessor> -->
</annotationProcessors>
</configuration>
</plugin>
Expand Down
39 changes: 39 additions & 0 deletions config-validation-processor-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,43 @@
<name>Spring Configuration Validation Processor Core</name>
<description>A Java 6 annotation processor to validate Spring @Configuration classes</description>

<dependencies>
<!-- COMPILE scoped dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>

<!-- TEST scoped dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Test variant of {@link SpringConfigurationValidationProcessor}.
*/
@SupportedAnnotationTypes({"org.springframework.context.annotation.Configuration", "org.springframework.context.annotation.Bean"})
@SupportedSourceVersion(SourceVersion.RELEASE_11)
@SupportedSourceVersion(SourceVersion.RELEASE_17)
public class TestSpringConfigurationValidationProcessor extends SpringConfigurationValidationProcessor {

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import org.springframework.core.io.ClassPathResource;

/**
* Utility class that compiles a Java class using the {@link Compiler} and an annotation {@link Processor}. This class
* Utility class that compiles a Java class using the {@link JavaCompiler} and an annotation {@link Processor}. This class
* is intended to be used for tests of annotation processors.
*
* @author Michael Pellaton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
import java.util.Locale;

import javax.tools.Diagnostic;
import javax.tools.JavaCompiler;
import javax.tools.JavaFileObject;

import junit.framework.AssertionFailedError;

import com.github.pellaton.springconfigvalidation.SpringConfigurationMessage;

/**
* Set of assert methods used on the {@link Diagnostic}s emitted by the Java {@link Compiler}.
* Set of assert methods used on the {@link Diagnostic}s emitted by the {@link JavaCompiler}.
*
* @author Michael Pellaton
*/
Expand Down Expand Up @@ -65,7 +66,7 @@ public static void assertContainsSingleMessage(SpringConfigurationMessage expect
List<Diagnostic<? extends JavaFileObject>> diagnostics) {

if (diagnostics.size() != 1) {
throw new AssertionFailedError("Number of diagnostic messages expected <1> but was <" + diagnostics.size() + ">");
throw new AssertionFailedError("Number of diagnostic messages expected <1> but was <" + diagnostics.size() + ">, diagnostic messages: " + diagnostics);
}

Diagnostic<? extends JavaFileObject> diagnostic = diagnostics.get(0);
Expand Down
2 changes: 0 additions & 2 deletions config-validation-processor-java11/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<executions>
<execution>
<id>unpack-dependencies</id>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.6
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<version>3.0.9-SNAPSHOT</version>
</parent>

<artifactId>config-validation-processor-java6</artifactId>
<artifactId>config-validation-processor-java17</artifactId>

<name>Spring Configuration Validation Processor for Java 6 Runtimes</name>
<description>A Java 6 annotation processor to validate Spring @Configuration classes</description>
<name>Spring Configuration Validation Processor for Java 17 Runtimes</name>
<description>A Java 17 annotation processor to validate Spring @Configuration classes</description>

<dependencies>
<dependency>
Expand All @@ -24,9 +24,7 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>unpack-dependencies</id>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* *****************************************************************************************************************
* Copyright 2012 Michael Pellaton
* Copyright 2014 Michael Pellaton
*
* Licensed 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
Expand All @@ -21,17 +21,15 @@
import javax.annotation.processing.SupportedSourceVersion;
import javax.lang.model.SourceVersion;


/**
* {@link SpringConfigurationValidationProcessor} for Java 6 runtimes.
* {@link SpringConfigurationValidationProcessor} for Java 17 runtimes.
*
* @author Michael Pellaton
*
* @see SpringConfigurationValidationProcessor
*/
@SupportedAnnotationTypes({
"org.springframework.context.annotation.Configuration", "org.springframework.context.annotation.Bean"})
@SupportedSourceVersion(SourceVersion.RELEASE_6)
public class SpringConfigurationValidationProcessorJava6 extends SpringConfigurationValidationProcessor {
@SupportedAnnotationTypes({"org.springframework.context.annotation.Configuration", "org.springframework.context.annotation.Bean"})
@SupportedSourceVersion(SourceVersion.RELEASE_17)
public class SpringConfigurationValidationProcessorJava17 extends SpringConfigurationValidationProcessor {

}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
com.github.pellaton.springconfigvalidation.SpringConfigurationValidationProcessorJava6
com.github.pellaton.springconfigvalidation.SpringConfigurationValidationProcessorJava17
167 changes: 0 additions & 167 deletions config-validation-processor-java6/.checkstyle.xml

This file was deleted.

31 changes: 0 additions & 31 deletions config-validation-processor-java6/.classpath

This file was deleted.

Loading