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-945 JavaEE to Quarkus: helloworld-rs migration #1

Draft
wants to merge 1 commit into
base: 7.2.0.GA
Choose a base branch
from
Draft
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
110 changes: 100 additions & 10 deletions helloworld-rs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>helloworld-rs</artifactId>
<packaging>war</packaging>
Copy link
Member Author

@mrizzi mrizzi May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expected project artifact's extension is jar
https://quarkus.io/guides/maven-tooling#build-tool-maven

<name>Quickstart: helloworld-rs</name>
<description>A simple Hello World project that uses JAX-RS</description>

Expand All @@ -41,13 +40,34 @@
</license>
</licenses>

<!-- based upon https://quarkus.io/guides/maven-tooling#build-tool-maven -->
<properties>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>2.16.6.Final</quarkus.platform.version>
Comment on lines +45 to +47
Copy link
Member Author

@mrizzi mrizzi May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<skipITs>true</skipITs>
<surefire-plugin.version>3.0.0</surefire-plugin.version>
Copy link
Member Author

@mrizzi mrizzi May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<compiler-plugin.version>3.10.1</compiler-plugin.version>
<maven.compiler.release>11</maven.compiler.release>
Comment on lines +50 to +51
Copy link
Member Author

@mrizzi mrizzi May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>${quarkus.platform.artifact-id}</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Comment on lines +54 to +64
Copy link
Member Author

@mrizzi mrizzi May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


<dependencies>

<!-- Import the CDI API, we use provided scope as the API is included in JBoss EAP -->
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<scope>provided</scope>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc</artifactId>
Comment on lines -48 to +70
Copy link
Member Author

@mrizzi mrizzi May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace javax.enterprise:cdi-api dependency
https://quarkus.io/guides/cdi-reference

</dependency>

<!-- Import the Common Annotations API (JSR-250), we use provided scope
Expand All @@ -58,14 +78,84 @@
<scope>provided</scope>
</dependency>

<!-- Import the JAX-RS API, we use provided scope as the API is included in JBoss EAP -->
<dependency>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.1_spec</artifactId>
<scope>provided</scope>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy</artifactId>
Comment on lines -63 to +83
Copy link
Member Author

@mrizzi mrizzi May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace JAX-RS dependency
https://quarkus.io/guides/resteasy

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use quarkus-resteasy-reactive if possible.

might be edge cases of things in resteasy/jaxrs we don't support but quarkus-resteas-reactive would be recommended if intent is to move forward vs staying more compatible.

</dependency>

</dependencies>


<build>
<plugins>
<plugin>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.platform.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
</goals>
</execution>
</executions>
</plugin>
Comment on lines +90 to +104
Copy link
Member Author

@mrizzi mrizzi May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</plugin>
Comment on lines +105 to +114
Copy link
Member Author

@mrizzi mrizzi May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
Comment on lines +115 to +133
Copy link
Member Author

@mrizzi mrizzi May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler-plugin.version}</version>
<configuration>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
Comment on lines +134 to +142
Copy link
Member Author

@mrizzi mrizzi May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

</plugins>
</build>

<profiles>
<profile>
<id>native</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<properties>
<skipITs>false</skipITs>
<quarkus.package.type>native</quarkus.package.type>
</properties>
</profile>
</profiles>
Comment on lines +146 to +159
Copy link
Member Author

@mrizzi mrizzi May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add Maven profile to run the Quarkus native build
https://quarkus.io/guides/maven-tooling#build-tool-maven


</project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@
*/
package org.jboss.as.quickstarts.rshelloworld;

import javax.enterprise.context.Dependent;
Copy link
Member Author

@mrizzi mrizzi May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


/**
* A simple CDI service which is able to say hello to someone
*
* @author Pete Muir
*
*/
@Dependent
Copy link
Member Author

@mrizzi mrizzi May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public class HelloService {

String createHelloMessage(String name) {
Expand Down
Copy link
Member Author

@mrizzi mrizzi May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File renamed without changes.
24 changes: 0 additions & 24 deletions helloworld-rs/src/main/webapp/WEB-INF/beans.xml
Copy link
Member Author

@mrizzi mrizzi May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beans.xml descriptor content is ignored
https://quarkus.io/guides/cdi-reference#limitations

This file was deleted.