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

[releases/6.3.z] jakarta faces to quarkus rules (#1056) #1057

Merged
merged 1 commit into from
Jan 17, 2024
Merged
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
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>