Skip to content

Commit

Permalink
WINDUPRULE-982 Versions of Spring compatible with Jakarta EE 9 (#936)
Browse files Browse the repository at this point in the history
* WINDUPRULE-982 Versions of Spring compatible with Jakarta EE 9

* Update rules/rules-reviewed/jakarta-ee9/java-ee/spring-components.windup.xml

Co-authored-by: Marco Rizzi <mrizzi@users.noreply.github.com>

* Update rules/rules-reviewed/jakarta-ee9/java-ee/spring-components.windup.xml

Co-authored-by: Marco Rizzi <mrizzi@users.noreply.github.com>

* WINDUPRULE-982 added jws6 technology transformer and fine tuned version ranges

* WINDUPRULE-982 Spring components for JWS6

* WNDUPRULE-982 adding trailing backslash to link URLs

* WINDUPRULE-982 fix basic errors discovered by PR review

---------

Co-authored-by: Marco Rizzi <mrizzi@users.noreply.github.com>
  • Loading branch information
PhilipCattanach and mrizzi committed May 19, 2023
1 parent 6f3b93c commit 91897b5
Show file tree
Hide file tree
Showing 9 changed files with 140 additions and 0 deletions.
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,)" />
</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.99.999" />
<project>
<artifact groupId="org.springframework.boot" artifactId="{*}" toVersion="2.99.999"/>
</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" />
</hint>
</perform>
</rule>
<rule id="spring-components-00002">
<!-- Spring version 6.0.0 is Jakarta compliant -->
<when>
<or>
<dependency groupId="org.springframework" artifactId="{*}" toVersion="5.99.999" />
<project>
<artifact groupId="org.springframework" artifactId="{*}" toVersion="5.99.999"/>
</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" />
</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,35 @@
<?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 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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<technology-reference-transfomers xmlns="http://windup.jboss.org/schema/jboss-ruleset">
<transform>
<sourceTechnology id="jws6"/>
<targetTechnology id="jws" versionRange="[6,)"/>
</transform>
<transform>
<sourceTechnology id="jws6"/>
<targetTechnology id="jakarta-ee"/>
</transform>
<transform>
<sourceTechnology id="jws6"/>
<targetTechnology id="hibernate" versionRange="[6,)" />
</transform>
</technology-reference-transfomers>

0 comments on commit 91897b5

Please sign in to comment.