Do we have AppComponent feature in JMIX

Hi Support,

Jmix version: 2.3.1
Jmix Studio plugin version: 2.3.1-241
IntelliJ version: IntelliJ IDEA 2024.1.4 (Community Edition)

In JMIX, What is the same component to use to have same function like CUBA Platform appComponent?

Regards,
CK

Hello!

Do you mean add-ons in CUBA: Creating Application Components - CUBA Platform. Developer’s Manual ?
If so, Jmix allows developers to create application add-on from project template. See Working with Project :: Jmix Documentation.

image

Hi Roman,

Yes.

Do you have an example how to create an add-ons project or add add-ons feature to an existing project.

Regards,
CK

The workflow with Jmix add-on is not sophisticated, you just need to create add-on, screens and entities in it. Then you should run ./gradlew publushToMavenLocal command to install add-on to your local repository.

In your “main” project add dependency to your build.gradle file:

repositories {
    mavenLocal() // it will enable searching artifacts in your local repo
    // ...
}

dependencies {
   // ...
   implementation 'com.company:my-awesome-addon-starter:0.0.1-SNAPSHOT'
}

See attached sample of add-on project: simple-add-on.zip (236.3 KB)
And application project that contains add-on: simple-application.zip (102.9 KB)

Also, there is a Composite project. It allows you to manage your applications and add-ons in one workspace and even configure dependencies between add-ons and application. You can create composite project from template, when you start new Jmix project.

1 Like

See also Creating Add-ons :: Jmix Documentation.

1 Like

@krivopustov @pinyazhin

OK.

I have a Project A developed as a full-stack application, which includes entities, screens, services, and other components.

Now, I want to make it reusable in a higher-level project, which I’ll refer to as Project B. Do I need to copy all the logic, screens, and services into an add-on project so that Project B can use them?

I’m concerned that this approach would result in duplicated code between the add-on and the full-stack application.

Hi @ckwan

Yes. And Project A should also use this add-on, that way you will avoid code duplication. The Project A can be just an executable wrapper without any logic.