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

WINDUPRULE-982 Versions of Spring compatible with Jakarta EE 9 #936

Merged
merged 12 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0"?>
<ruleset id="spring-components" xmlns="http://windup.jboss.org/schema/jboss-ruleset"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
<metadata>
<description>
This ruleset ensures the versions of Spring and Spring Boot are Jakarta EE 9 compliant
</description>
<dependencies>
<addon id="org.jboss.windup.rules,windup-rules-javaee,3.0.0.Final" />
<addon id="org.jboss.windup.rules,windup-rules-java,3.0.0.Final" />
<addon id="org.jboss.windup.rules,windup-rules-xml,3.0.0.Final" />
</dependencies>
<targetTechnology id="jakarta-ee" versionRange="[9,)" />
<targetTechnology id="jws" versionRange="[6,)" />
PhilipCattanach marked this conversation as resolved.
Show resolved Hide resolved
</metadata>
<rules>
<rule id="spring-components-00001">
<!-- Spring Boot version 3.0.0 is Jakarta compliant -->
<when>
<or>
<dependency groupId="org.springframework.boot" artifactId="{*}" toVersion="2.9.9" />
PhilipCattanach marked this conversation as resolved.
Show resolved Hide resolved
<project>
<artifact groupId="org.springframework.boot" artifactId="{*}" toVersion="2.9.9"/>
</project>
</or>
</when>
<perform>
<hint title="Version of Spring Boot not compatible with Jakarta EE 9+" effort="3" category-id="mandatory">
<message>Version 3.0.0 is the minimum version of Spring Boot that is Jakarta EE 9+ compatible</message>
<link href="https://spring.io/blog/2021/09/02/a-java-17-and-jakarta-ee-9-baseline-for-spring-framework-6" title="A Java 17 and Jakarta EE 9 baseline for Spring Framework 6" />
PhilipCattanach marked this conversation as resolved.
Show resolved Hide resolved
</hint>
</perform>
</rule>
<rule id="spring-components-00001">
<!-- Spring version 6.0.0 is Jakarta compliant -->
<when>
<or>
<dependency groupId="org.springframework" artifactId="{*}" toVersion="5.9.9" />
PhilipCattanach marked this conversation as resolved.
Show resolved Hide resolved
<project>
<artifact groupId="org.springframework" artifactId="{*}" toVersion="5.9.9"/>
</project>
</or>
</when>
<perform>
<hint title="Version of Spring not compatible with Jakarta EE 9+" effort="3" category-id="mandatory">
<message>Version 6.0.0 is the minimum version of Spring that is Jakarta EE 9+ compatible</message>
<link href="https://spring.io/blog/2021/09/02/a-java-17-and-jakarta-ee-9-baseline-for-spring-framework-6" title="A Java 17 and Jakarta EE 9 baseline for Spring Framework 6" />
PhilipCattanach marked this conversation as resolved.
Show resolved Hide resolved
</hint>
</perform>
</rule>
</rules>
</ruleset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ff70077310934e186aacdfac60eca566b782bbce org.springframework.boot:spring-boot-starter-web:3.0.0
cf4d0e0fe9ec2eafaf46df5db12bc13276ad656d org.springframework:spring-core:6.0.0
fd312ad5ffe737310a245bcdadbcd29670321c8f org.springframework.boot:spring-boot-starter-web:2.5.12
a2fd8bd9eced290bba8e15922fe0946f71acfeac org.springframework:spring-core:5.3.9
33 changes: 33 additions & 0 deletions rules/rules-reviewed/jakarta-ee9/java-ee/tests/data/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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>
<groupId>org.sample</groupId>
<artifactId>sample-project</artifactId>
<version>0.0.1</version>
<name>Sample Project</name>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.5.12</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.3.9</version>
</dependency>
<!-- control data -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>6.0.0</version>
</dependency>
</dependencies>

</project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0"?>
<ruletest id="spring-components-test"
xmlns="http://windup.jboss.org/schema/jboss-ruleset"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
<testDataPath>data</testDataPath>
<rulePath>../spring-components.windup.xml</rulePath>
<ruleset>
<rules>
<rule id="spring-components-00001-test">
<when>
<not>
<iterable-filter size="2">
<hint-exists message="Version 3.0.0 is the minimum version of Spring Boot"/>
</iterable-filter>
</not>
</when>
<perform>
<fail message="[spring-components-00001] hint was not found!" />
</perform>
</rule>
<rule id="spring-components-00002-test">
<when>
<not>
<iterable-filter size="2">
<hint-exists message="Version 3.0.0 is the minimum version of Spring Boot"/>
</iterable-filter>
</not>
</when>
<perform>
<fail message="[spring-components-00001] hint was not found!" />
</perform>
</rule>
<rule id="spring-components-00002-test">
<when>
<not>
<iterable-filter size="2">
<hint-exists message="Version 6.0.0 is the minimum version of Spring"/>
</iterable-filter>
</not>
</when>
<perform>
<fail message="[spring-components-00002] hint was not found!" />
</perform>
</rule>
</rules>
</ruleset>
</ruletest>