Use of Jmix in Intellij 2024.1 - war file build problem

Hi
When I upgraded the Jmix studio by first installing the IntelliJ 2024.1.2, I faced errors building the war file for deployment of my composite project, though I could run the application in the studio environment using Command + Enter in terminal in my mac.


mak@Mortozas-iMac myapp % ls
build                   frontend                gradlew                 myapp.iml             node_modules            settings.gradle         vite.config.ts          webpack.config.js
build.gradle            gradle                  gradlew.bat             jmix-studio.xml         package.json            src                     vite.generated.ts
mak@Mortozas-iMac myapp % ./gradlew -Pvaadin.productionMode=true bootWar
> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find com.myapp:myapphr-starter:0.0.1-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/myapp/myapphr-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/myapp/myapphr-starter/0.0.1-SNAPSHOT/myapphr-starter-0.0.1-SNAPSHOT.pom
       - https://nexus.jmix.io/repository/public/com/myapp/myapphr-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://nexus.jmix.io/repository/public/com/myapp/myapphr-starter/0.0.1-SNAPSHOT/myapphr-starter-0.0.1-SNAPSHOT.pom
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myapphr-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myapphr-starter/0.0.1-SNAPSHOT/myapphr-starter-0.0.1-SNAPSHOT.pom
     Required by:
         project :
   > Could not find com.myapp:myapphrmd-starter:0.0.1-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/myapp/myapphrmd-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/myapp/myapphrmd-starter/0.0.1-SNAPSHOT/myapphrmd-starter-0.0.1-SNAPSHOT.pom
       - https://nexus.jmix.io/repository/public/com/myapp/myapphrmd-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://nexus.jmix.io/repository/public/com/myapp/myapphrmd-starter/0.0.1-SNAPSHOT/myapphrmd-starter-0.0.1-SNAPSHOT.pom
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myapphrmd-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myapphrmd-starter/0.0.1-SNAPSHOT/myapphrmd-starter-0.0.1-SNAPSHOT.pom
     Required by:
         project :
   > Could not find com.myapp:myappmdg-starter:0.0.1-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/myapp/myappmdg-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/myapp/myappmdg-starter/0.0.1-SNAPSHOT/myappmdg-starter-0.0.1-SNAPSHOT.pom
       - https://nexus.jmix.io/repository/public/com/myapp/myappmdg-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://nexus.jmix.io/repository/public/com/myapp/myappmdg-starter/0.0.1-SNAPSHOT/myappmdg-starter-0.0.1-SNAPSHOT.pom
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myappmdg-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myappmdg-starter/0.0.1-SNAPSHOT/myappmdg-starter-0.0.1-SNAPSHOT.pom
     Required by:
         project :
   > Could not find com.myapp:myappbditax-starter:0.0.1-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/myapp/myappbditax-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/myapp/myappbditax-starter/0.0.1-SNAPSHOT/myappbditax-starter-0.0.1-SNAPSHOT.pom
       - https://nexus.jmix.io/repository/public/com/myapp/myappbditax-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://nexus.jmix.io/repository/public/com/myapp/myappbditax-starter/0.0.1-SNAPSHOT/myappbditax-starter-0.0.1-SNAPSHOT.pom
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myappbditax-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myappbditax-starter/0.0.1-SNAPSHOT/myappbditax-starter-0.0.1-SNAPSHOT.pom
     Required by:
         project :
   > Could not find com.myapp:myapploan-starter:0.0.1-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/myapp/myapploan-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/myapp/myapploan-starter/0.0.1-SNAPSHOT/myapploan-starter-0.0.1-SNAPSHOT.pom
       - https://nexus.jmix.io/repository/public/com/myapp/myapploan-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://nexus.jmix.io/repository/public/com/myapp/myapploan-starter/0.0.1-SNAPSHOT/myapploan-starter-0.0.1-SNAPSHOT.pom
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myapploan-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myapploan-starter/0.0.1-SNAPSHOT/myapploan-starter-0.0.1-SNAPSHOT.pom
     Required by:
         project :
   > Could not find com.myapp:myappfund-starter:0.0.1-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/myapp/myappfund-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/myapp/myappfund-starter/0.0.1-SNAPSHOT/myappfund-starter-0.0.1-SNAPSHOT.pom
       - https://nexus.jmix.io/repository/public/com/myapp/myappfund-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://nexus.jmix.io/repository/public/com/myapp/myappfund-starter/0.0.1-SNAPSHOT/myappfund-starter-0.0.1-SNAPSHOT.pom
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myappfund-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myappfund-starter/0.0.1-SNAPSHOT/myappfund-starter-0.0.1-SNAPSHOT.pom
     Required by:
         project :
   > Could not find com.myapp:myappcmp-starter:0.0.1-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/myapp/myappcmp-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/myapp/myappcmp-starter/0.0.1-SNAPSHOT/myappcmp-starter-0.0.1-SNAPSHOT.pom
       - https://nexus.jmix.io/repository/public/com/myapp/myappcmp-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://nexus.jmix.io/repository/public/com/myapp/myappcmp-starter/0.0.1-SNAPSHOT/myappcmp-starter-0.0.1-SNAPSHOT.pom
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myappcmp-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myappcmp-starter/0.0.1-SNAPSHOT/myappcmp-starter-0.0.1-SNAPSHOT.pom
     Required by:
         project :
   > Could not find com.myapp:myappgen-starter:0.0.1-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/myapp/myappgen-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/myapp/myappgen-starter/0.0.1-SNAPSHOT/myappgen-starter-0.0.1-SNAPSHOT.pom
       - https://nexus.jmix.io/repository/public/com/myapp/myappgen-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://nexus.jmix.io/repository/public/com/myapp/myappgen-starter/0.0.1-SNAPSHOT/myappgen-starter-0.0.1-SNAPSHOT.pom
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myappgen-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myappgen-starter/0.0.1-SNAPSHOT/myappgen-starter-0.0.1-SNAPSHOT.pom
     Required by:
         project :
   > Could not find com.myapp:myapprr-starter:0.0.1-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/myapp/myapprr-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/myapp/myapprr-starter/0.0.1-SNAPSHOT/myapprr-starter-0.0.1-SNAPSHOT.pom
       - https://nexus.jmix.io/repository/public/com/myapp/myapprr-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://nexus.jmix.io/repository/public/com/myapp/myapprr-starter/0.0.1-SNAPSHOT/myapprr-starter-0.0.1-SNAPSHOT.pom
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myapprr-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myapprr-starter/0.0.1-SNAPSHOT/myapprr-starter-0.0.1-SNAPSHOT.pom
     Required by:
         project :
   > Could not find com.myapp:myapptd-starter:0.0.1-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/myapp/myapptd-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/myapp/myapptd-starter/0.0.1-SNAPSHOT/myapptd-starter-0.0.1-SNAPSHOT.pom
       - https://nexus.jmix.io/repository/public/com/myapp/myapptd-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://nexus.jmix.io/repository/public/com/myapp/myapptd-starter/0.0.1-SNAPSHOT/myapptd-starter-0.0.1-SNAPSHOT.pom
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myapptd-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myapptd-starter/0.0.1-SNAPSHOT/myapptd-starter-0.0.1-SNAPSHOT.pom
     Required by:
         project :
   > Could not find com.myapp:myapppmp-starter:0.0.1-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/myapp/myapppmp-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/myapp/myapppmp-starter/0.0.1-SNAPSHOT/myapppmp-starter-0.0.1-SNAPSHOT.pom
       - https://nexus.jmix.io/repository/public/com/myapp/myapppmp-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://nexus.jmix.io/repository/public/com/myapp/myapppmp-starter/0.0.1-SNAPSHOT/myapppmp-starter-0.0.1-SNAPSHOT.pom
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myapppmp-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myapppmp-starter/0.0.1-SNAPSHOT/myapppmp-starter-0.0.1-SNAPSHOT.pom
     Required by:
         project :
   > Could not find com.myapp:myappmsg-starter:0.0.1-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/myapp/myappmsg-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/myapp/myappmsg-starter/0.0.1-SNAPSHOT/myappmsg-starter-0.0.1-SNAPSHOT.pom
       - https://nexus.jmix.io/repository/public/com/myapp/myappmsg-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://nexus.jmix.io/repository/public/com/myapp/myappmsg-starter/0.0.1-SNAPSHOT/myappmsg-starter-0.0.1-SNAPSHOT.pom
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myappmsg-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myappmsg-starter/0.0.1-SNAPSHOT/myappmsg-starter-0.0.1-SNAPSHOT.pom
     Required by:
         project :
   > Could not find com.myapp:myappld-starter:0.0.1-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/myapp/myappld-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/myapp/myappld-starter/0.0.1-SNAPSHOT/myappld-starter-0.0.1-SNAPSHOT.pom
       - https://nexus.jmix.io/repository/public/com/myapp/myappld-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://nexus.jmix.io/repository/public/com/myapp/myappld-starter/0.0.1-SNAPSHOT/myappld-starter-0.0.1-SNAPSHOT.pom
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myappld-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myappld-starter/0.0.1-SNAPSHOT/myappld-starter-0.0.1-SNAPSHOT.pom
     Required by:
         project :
   > Could not find com.myapp:myappdps-starter:0.0.1-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/myapp/myappdps-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/myapp/myappdps-starter/0.0.1-SNAPSHOT/myappdps-starter-0.0.1-SNAPSHOT.pom
       - https://nexus.jmix.io/repository/public/com/myapp/myappdps-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://nexus.jmix.io/repository/public/com/myapp/myappdps-starter/0.0.1-SNAPSHOT/myappdps-starter-0.0.1-SNAPSHOT.pom
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myappdps-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myappdps-starter/0.0.1-SNAPSHOT/myappdps-starter-0.0.1-SNAPSHOT.pom
     Required by:
         project :

But when I try the same way in intelliJ 2023.2, it works as usual.

Can anyone help how this can be resolved?

Hi

Do you run this ./gradlew bootWar command from IDEA terminal? Did you try to run it using standard Mac Terminal application?
Did you have the same project with the same Jmix and Gradle wrapper versions when tried in IDEA 2024.1 and IDEA 2023.2?

I can create war file easly within the IDE terminal in version 2023.3 (command + enter works fine) but not in 2024.1 version. BTW, this is a composite project.
image

When I tried in mac terminal, i get very same outcome with error in version 2024.1 as follows:

Mortozas-iMac:myapp mak$ ./gradlew bootWar
> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not find com.myapp:myapphr-starter:0.0.1-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/myapp/myapphr-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/myapp/myapphr-starter/0.0.1-SNAPSHOT/myapphr-starter-0.0.1-SNAPSHOT.pom
       - https://nexus.jmix.io/repository/public/com/myapp/myapphr-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://nexus.jmix.io/repository/public/com/myapp/myapphr-starter/0.0.1-SNAPSHOT/myapphr-starter-0.0.1-SNAPSHOT.pom
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myapphr-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myapphr-starter/0.0.1-SNAPSHOT/myapphr-starter-0.0.1-SNAPSHOT.pom
     Required by:
         project :
   > Could not find com.myapp:myapphrmd-starter:0.0.1-SNAPSHOT.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/myapp/myapphrmd-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://repo.maven.apache.org/maven2/com/myapp/myapphrmd-starter/0.0.1-SNAPSHOT/myapphrmd-starter-0.0.1-SNAPSHOT.pom
       - https://nexus.jmix.io/repository/public/com/myapp/myapphrmd-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://nexus.jmix.io/repository/public/com/myapp/myapphrmd-starter/0.0.1-SNAPSHOT/myapphrmd-starter-0.0.1-SNAPSHOT.pom
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myapphrmd-starter/0.0.1-SNAPSHOT/maven-metadata.xml
       - https://maven.vaadin.com/vaadin-addons/com/myapp/myapphrmd-starter/0.0.1-SNAPSHOT/myapphrmd-starter-0.0.1-SNAPSHOT.pom
     Required by:
         project :
   > Could not find com.myapp:myappmdg-starter:0.0.1-SNAPSHOT.

Yes, same project. But not sure if it is the same Gradle wrapper versions (I didn;t change anything, so it is how it is coming as default in those IDEA versions).

You need to open terminal in your <composite_project_name>-all project dir and run task as the following:

./gradlew :myapp:bootWar -Pvaadin.productionMode=true

When you run task for myapp, Gradle composite build is not resolved, so you need to publish all dependencies to some repo and use them for your build.
When running task for a root project, Gradle builds and resolves all dependencies from your project sources.

Or you can run Gradle tasks from IDEA Gradle tool window.

Yes!! It worked, Thank you.

A qucik question. I noticed the following log while building the war:

> Task :myapphr:myapphr:compileJava
/Users/mak/Projects/myappHCM24/myapphr/myapphr/src/main/java/com/myapp/hr/view/org/employeeprofile/EmployeeSalaryApprListView.java:129: warning: [removal] <E>detailView(Class<E>) in ViewNavigators has been deprecated and marked for removal
        viewNavigators.detailView(EmployeeProfile.class)
                      ^
  where E is a type-variable:
    E extends Object declared in method <E>detailView(Class<E>)
/Users/mak/Projects/myappHCM24/myapphr/myapphr/src/main/java/com/myapp/hr/view/salaryreviewcalibration/SalaryReviewCalibrationListView.java:70: warning: [removal] <E>detailView(Class<E>) in ViewNavigators has been deprecated and marked for removal
        viewNavigators.detailView(SalaryReviewCalibration.class)

Please check io.jmix.flowui.ViewNavigators#detailView(io.jmix.flowui.view.View<?>, java.lang.Class<E>) Javadoc

See What’s New :: Jmix Documentation

Thanks Konstantin
As per documentation i see we have to use like this:


View<?> parent = UiTestUtils.getCurrentView();
viewNavigators.view(parent, UserListView.class).navigate();

Will this work like this later?
viewNavigators.view(this, UserListView.class).navigate();

Usually you can use this as parent view when navigating, because you are navigating from some already opened view.

Let me quote the rest from the doc:

If the calling class is not a view, and you cannot pass this as an origin, use UiComponentUtils.getCurrentView(), for example:

viewNavigators.view(UiComponentUtils.getCurrentView(), viewId).navigate();

In UI tests, the current view can be obtained by UiTestUtils.getCurrentView(), for example:

View<?> parent = UiTestUtils.getCurrentView();
viewNavigators.view(parent, UserListView.class).navigate();
1 Like

Ok, thank you for the additional clarification.