vaadin / quarkus

An extension to Quarkus to support Vaadin Flow
Apache License 2.0
28 stars 3 forks source link

feat: added codestart (#119) (CP: 1.1) #122

Closed mcollovati closed 1 year ago

mcollovati commented 1 year ago

Added a codestart that provides a Flow application with an example view

Closes #112

mcollovati commented 1 year ago

To build the extension locally: mvn clean install -Dvaadin.flow.version=23.3-SNAPSHOT

To test the codestart

create the project

mvn io.quarkus.platform:quarkus-maven-plugin:2.16.7.Final:create \
    -DprojectGroupId=org.acme -DprojectArtifactId=getting-started \
    -Dextensions='com.vaadin:vaadin-quarkus:1.1-SNAPSHOT' -DwithCodestart \
    -DplatformVersion=2.16.7.Final -Ddata="vaadin-flow-codestart.vaadinVersion=23.3.12"

cd getting-started

test dev mode: mvn quarkus:dev

test prod mode:

mvn -Pproduction package
java -jar target/quarkus-app/quarkus-run.jar
sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

czp13 commented 1 year ago

Not long ago I was able to fix the JNA problem locally by adding dependencyManagement and using the proper version which contains the method used for integration tests (it could be test scoped probably and only jna could be enough)

integration-tests/pom.xml

            <dependency>
                <groupId>net.java.dev.jna</groupId>
                <artifactId>jna-platform</artifactId>
<!--                Caused by: java.lang.NoSuchMethodError: -->
<!--                com/sun/jna/Memory.close()V (loaded from file:/Users/pczuczor/.m2/repository/net/java/dev/jna/jna/5.8.0/jna-5.8.0.jar -->
<!--                by jdk.internal.loader.ClassLoaders$AppClassLoader@cd6d029f) called from class oshi.util.Util -->
<!--                (loaded from file:/Users/pczuczor/.m2/repository/com/github/oshi/oshi-core/6.4.0/oshi-core-6.4.0.jar -->
<!--                by jdk.internal.loader.ClassLoaders$AppClassLoader@cd6d029f).-->
<!--                https://github.com/java-native-access/jna/blob/5.12.0/src/com/sun/jna/Memory.java-->
                <version>5.12.0</version>
            </dependency>
            <dependency>
                <groupId>net.java.dev.jna</groupId>
                <artifactId>jna</artifactId>
                <version>5.12.0</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

But now chrome local version and driver version is missmatching:

2023-05-10 19:31:28,599 WARN  [com.vaa.flo.tes.ChromeBrowserTest] (main) Unable to create chromedriver on attempt 2: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: This version of ChromeDriver only supports Chrome version 108
Current browser version is 113.0.5672.63 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Host info: host: 'Peters-Air', ip: 'fe80:0:0:0:1073:7b40:a6e:a1ce%en0'
Build info: version: '4.8.3', revision: 'e5e76298c3'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '12.0.1', java.version: '17.0.4-ea'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--remote-allow-origins=*, --headless, --disable-gpu], extensions: []}}], desiredCapabilities=Capabilities {browserName: chrome, goog:chromeOptions: {args: [--remote-allow-origins=*, --headless, --disable-gpu], extensions: []}}}]
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:148)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:106)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:67)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:165)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:183)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:158)

I could solve this probably by downgrading my chrome or updating Chromedriver.

p.s: other message was under creation, logging what I do, that is why no delay between the two messages.

mcollovati commented 1 year ago

Can't see JNA errors locally nor in the validation job

czp13 commented 1 year ago

Thanks. Then this is my environment somehow:

But some of the steps are failing me with various errors, the main branch was working at least.

I will probably delete and git clone the repo once more, clean mvn, etc...

czp13 commented 1 year ago

Retested again this morning: mvn clean install -Dvaadin.flow.version=23.3-SNAPSHOT generates oshi error first, -DskipTests create the quarkus jar`

Then:

mvn io.quarkus.platform:quarkus-maven-plugin:2.16.7.Final:create \  
    -DprojectGroupId=org.acme -DprojectArtifactId=getting-started \
    -Dextensions='com.vaadin:vaadin-quarkus:1.1-SNAPSHOT' -DwithCodestart \
    -DplatformVersion=2.16.7.Final -Ddata="vaadin-flow-codestart.vaadinVersion=23.3.12"

Generates a plugin related error:

  Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:2.16.7.Final:create (default-cli) on project standalone-pom: Execution default-cli of goal io.quarkus.platform:quarkus-maven-plugin:2.16.7.Final:create failed: A required class was missing while executing io.quarkus.platform:quarkus-maven-plugin:2.16.7.Final:create: org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory

I can fix first with dependencyManagement (then chromeDriver will have problems), and second with Quarkus maven plugin update, but then later will have problems I assume (like last time I did).

I am confused why it works on Teamcity and another dev environment. Let's do a short session (as we planned) and if we cannot solve it, we can ask a third person to test it maybe to make sure this is good! 🙇

Sorry for still having the same news/errors, and thanks for your patience, Marco.