Karm / mandrel-integration-tests

Integration tests for GraalVM and its Mandrel distribution. Runs Quarkus, Helidon and Micronaut applications and small targeted reproducers. The focus is solely on native-image utility and compilation of Java applications into native executables.
Apache License 2.0
5 stars 3 forks source link

Maven problems on a clean room environment #183

Closed Karm closed 9 months ago

Karm commented 10 months ago
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Resolving expression: '${final.name}': Detected the following recursive expression cycle in 'final.name': [final.name] @ 
[ERROR] Resolving expression: '${final.name}': Detected the following recursive expression cycle in 'final.name': [final.name] @ 
[ERROR] 'dependencies.dependency.version' for io.quarkus:quarkus-vertx-web:jar is missing. @ line 49, column 21
 @ 
[ERROR] The build could not read 2 projects -> [Help 1]
[ERROR]   
[ERROR]   The project org.graalvm.tests.integration:quarkus-json:1.0.0-SNAPSHOT (/home/tester/karm/mandrel-integration-tests/apps/quarkus-json/pom.xml) has 2 errors
[ERROR]     Resolving expression: '${final.name}': Detected the following recursive expression cycle in 'final.name': [final.name] -> [Help 2]
[ERROR]     Resolving expression: '${final.name}': Detected the following recursive expression cycle in 'final.name': [final.name] -> [Help 2]
[ERROR]   
[ERROR]   The project org.acme:quarkus-vertx:1.0.0-SNAPSHOT (/home/tester/karm/mandrel-integration-tests/apps/quarkus-vertx/pom.xml) has 1 error
[ERROR]     'dependencies.dependency.version' for io.quarkus:quarkus-vertx-web:jar is missing. @ line 49, column 21
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /opt/apache-maven-3.6.3
Java version: 17.0.8.1, vendor: Eclipse Adoptium, runtime: /opt/jdk-17.0.8.1+1
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.14.0-319.el9.aarch64", arch: "aarch64", family: "unix"
Karm commented 10 months ago

Fixed with maven update for newer quarkus.

jerboaa commented 10 months ago

@Karm where is the fix?

I needed these:

commit 304fd64a03d4c64920ef3729de745b3304cfd194
Author: Severin Gehwolf <sgehwolf@redhat.com>
Date:   Wed Sep 6 19:35:56 2023 +0200

    Fix final name

diff --git a/apps/quarkus-json/pom.xml b/apps/quarkus-json/pom.xml
index 57254d0..cfb1aa3 100644
--- a/apps/quarkus-json/pom.xml
+++ b/apps/quarkus-json/pom.xml
@@ -15,7 +15,7 @@

     <properties>
         <quarkus.version>${global.quarkus.version}</quarkus.version>
-        <final.name>${final.name}</final.name>
+        <final.name>quarkus-json-test</final.name>
     </properties>

     <dependencyManagement>

and

commit 52608c50db7ae8b43e77da331e0f37249fe7a47c (HEAD -> master)
Author: Severin Gehwolf <sgehwolf@redhat.com>
Date:   Wed Sep 6 19:46:58 2023 +0200

    Fix vertex-web (now reactive-routes)

diff --git a/apps/quarkus-vertx/pom.xml b/apps/quarkus-vertx/pom.xml
index 4bbe1d3..7d47c9b 100644
--- a/apps/quarkus-vertx/pom.xml
+++ b/apps/quarkus-vertx/pom.xml
@@ -48,7 +48,7 @@
         </dependency>
         <dependency>
             <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-vertx-web</artifactId>
+            <artifactId>quarkus-reactive-routes</artifactId>
         </dependency>
         <dependency>
             <groupId>io.quarkus</groupId>
Karm commented 10 months ago

@jerboaa The thing is that:

jerboaa commented 10 months ago

@Karm Responses in-line below.

new Quarkus requires Maven 3.8.8, so Mandrel Integration Test suite too, that is what I meant by fixed. Maven update in test infra.

Not sure why a maven upgrade would fix this. It seems more likely that a not-clean ~/.m2 fixes it.

${final.name} is because of places like https://github.com/Karm/mandrel-integration-tests/blob/master/testsuite/src/it/java/org/graalvm/tests/integration/utils/BuildAndRunCmds.java#L97 I guess there could be some default though. If you execute it without anything, it's invalid circular reference.

OK. This sounds like we need something like default.final.name in a profile which activates if default.final.name is not provided and the tests in BuildAndRunCmds.java updated accordingly. I don't see how quarkus-json can build with only mvn clean package otherwise.

quarkus-vertx-web

It's quarkus-reactive-routes since 2.13.7.Final?:

$ cat ~/.m2/repository/io/quarkus/quarkus-vertx-web/2.13.7.Final/quarkus-vertx-web-2.13.7.Final.pom
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>quarkus-relocations-parent</artifactId>
        <groupId>io.quarkus</groupId>
        <version>2.13.7.Final</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>quarkus-vertx-web</artifactId>

    <distributionManagement>
        <relocation>
            <artifactId>quarkus-reactive-routes</artifactId>
            <message>The artifact ${project.artifactId} is now named quarkus-reactive-routes. Please update your dependency.</message>
        </relocation>
    </distributionManagement>
Karm commented 10 months ago

Not sure why a maven upgrade would fix this. It seems more likely that a not-clean ~/.m2 fixes it.

Updating from Maven 3.6.3 is needed for the latest Quarkus. The text of this issue is misleading. I jotted it down incompletely. Maven version has nothing to do with the final.name issue.

OK. This sounds like we need something like default.final.name in a profile which activates if default.final.name is not provided...

That would work :+1:

I don't see how quarkus-json can build with only mvn clean package otherwise.

It does not in the current form.

It's quarkus-reactive-routes since 2.13.7.Final?

Great, let's update it then :pray:

Sorry for the inconvenience. Apparently some housekeeping is in order.

jerboaa commented 9 months ago

PR is updated to allow for the final name customization. Please review! Thanks.