Skip to content

Commit

Permalink
jakarta faces to quarkus rules (#1056)
Browse files Browse the repository at this point in the history
Co-authored-by: Phil Cattanach <[email protected]>
(cherry picked from commit e24bef0)
  • Loading branch information
m-brophy committed Jan 17, 2024
1 parent 93b9a70 commit 340898f
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0"?>
<!DOCTYPE ruleset [
<!ENTITY build-tool-maven-link-title "Quarkus - Guide">
<!ENTITY build-tool-maven-link-href "https://quarkus.io/guides/maven-tooling#build-tool-maven">
]>
<ruleset xmlns="http://windup.jboss.org/schema/jboss-ruleset" id="jakarta-faces-to-quarkus"
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 gives hints to migrate JAX-RS applications to Quarkus extension
</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>
<sourceTechnology id="java-ee" />
<targetTechnology id="quarkus" />
</metadata>
<rules>
<rule id="jakarta-faces-to-quarkus-00000">
<when>
<xmlfile in="pom.xml" matches="/m:project/m:dependencies/m:dependency[m:groupId/text() = 'jakarta.faces']">
<namespace prefix="m" uri="http://maven.apache.org/POM/4.0.0" />
</xmlfile>
</when>
<perform>
<hint title="Replace Jakarta Faces Dependency with MyFaces" effort="1" category-id="mandatory">
<message>
<![CDATA[
Faces Dependencies with groupId `jakarta.faces` should be replaced with
```
<!-- Quarkus MyFaces dependencies -->
<dependency>
<groupId>org.apache.myfaces.core.extensions.quarkus</groupId>
<artifactId>myfaces-quarkus</artifactId>
<version>4.0.1</version>
</dependency>
<!-- Quarkus Faces utilities and components extensions -->
<dependency>
<groupId>io.quarkiverse.primefaces</groupId>
<artifactId>quarkus-primefaces</artifactId>
<version>3.13.1</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.omnifaces</groupId>
<artifactId>quarkus-omnifaces</artifactId>
<version>4.2.0</version>
</dependency>
```
]]>
</message>
<link title="Apache MyFaces: Getting Started on Quarkus" href="https://myfaces.apache.org/#/coregettingstarted?id=quarkus" />
</hint>
</perform>
</rule>
<rule id="jakarta-faces-to-quarkus-00010">
<when>
<filecontent filename="pom.xml" pattern="artifactId&gt;jakarta.faces&lt;" />
</when>
<perform>
<hint title="Replace Jakarta Faces Dependency with MyFaces" effort="1" category-id="mandatory">
<message>
<![CDATA[
Faces Dependencies with artifactId `jakarta.faces` should be replaced with
```
<!-- Quarkus MyFaces dependencies -->
<dependency>
<groupId>org.apache.myfaces.core.extensions.quarkus</groupId>
<artifactId>myfaces-quarkus</artifactId>
<version>4.0.1</version>
</dependency>
<!-- Quarkus Faces utilities and components extensions -->
<dependency>
<groupId>io.quarkiverse.primefaces</groupId>
<artifactId>quarkus-primefaces</artifactId>
<version>3.13.1</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.omnifaces</groupId>
<artifactId>quarkus-omnifaces</artifactId>
<version>4.2.0</version>
</dependency>
```
]]>
</message>
<link title="Apache MyFaces: Getting Started on Quarkus" href="https://myfaces.apache.org/#/coregettingstarted?id=quarkus" />
</hint>
</perform>
</rule>
</rules>
</ruleset>
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,17 @@
<version>9.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.faces</groupId>
<artifactId>jakarta.faces-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.faces</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<ruletest id="jakarta-faces-to-quarkus-tests"
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/application-jakarta-api</testDataPath>
<rulePath>../jakarta-faces-to-quarkus.windup.xml</rulePath>
<ruleset>
<rules>
<rule id="jakarta-faces-to-quarkus-00000-test">
<when>
<not>
<iterable-filter size="1">
<hint-exists message="Faces Dependencies with groupId `jakarta.faces` should be replaced with"/>
</iterable-filter>
</not>
</when>
<perform>
<fail message="[jakarta-faces-to-quarkus-00000] MyFaces hint was not found!" />
</perform>
</rule>
<rule id="jakarta-faces-to-quarkus-00010-test">
<when>
<not>
<iterable-filter size="1">
<hint-exists message="Faces Dependencies with artifactId `jakarta.faces` should be replaced with"/>
</iterable-filter>
</not>
</when>
<perform>
<fail message="[jakarta-faces-to-quarkus-00010] MyFaces hint was not found!" />
</perform>
</rule>
</rules>
</ruleset>
</ruletest>

0 comments on commit 340898f

Please sign in to comment.