Skip to content

Conversation

igordmn
Copy link
Collaborator

@igordmn igordmn commented Jul 15, 2025

Fixes https://youtrack.jetbrains.com/issue/CMP-8577/Maven-project-doesnt-work-with-1.9.0-alpha03

Apply a workaround by manually excluding the dependency in all modules that depend on org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-savedstate.

It is written in the pom itself:

    <dependency>
      <groupId>androidx.lifecycle</groupId>
      <artifactId>lifecycle-viewmodel-savedstate-desktop</artifactId>
      <version>2.9.1</version>
      <scope>runtime</scope>
      <exclusions>
        <exclusion>
          <groupId>androidx.lifecycle</groupId>
          <artifactId>lifecycle-viewmodel</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

And when we test the maven project it shows these dependencies:

[DEBUG]       org.jetbrains.compose.ui:ui-desktop:jar:9999.0.0-SNAPSHOT:compile
...
[DEBUG]          androidx.lifecycle:lifecycle-viewmodel-desktop:jar:2.9.1:runtime
[DEBUG]          androidx.lifecycle:lifecycle-viewmodel-savedstate-desktop:jar:2.9.1:runtime
[DEBUG]             androidx.savedstate:savedstate-desktop:jar:1.3.0:compile
[DEBUG]             org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:jar:1.7.3:compile

instead of:

[DEBUG]       org.jetbrains.compose.ui:ui-desktop:jar:1.9.0-alpha03:compile
...
[DEBUG]          androidx.lifecycle:lifecycle-viewmodel-desktop:jar:2.9.1:runtime
[DEBUG]          androidx.lifecycle:lifecycle-viewmodel-savedstate-desktop:jar:2.9.1:runtime
[DEBUG]             androidx.lifecycle:lifecycle-viewmodel:jar:2.9.1:runtime
[DEBUG]                androidx.lifecycle:lifecycle-viewmodel-android:aar:2.9.1:runtime
[DEBUG]                   org.jetbrains.kotlinx:kotlinx-coroutines-android:jar:1.7.3:runtime
[DEBUG]                   androidx.core:core-viewtree:jar:1.0.0:runtime
[DEBUG]             androidx.savedstate:savedstate-desktop:jar:1.3.0:compile
[DEBUG]             org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:jar:1.7.3:compile

Testing

cd .../compose-multiplatform-core
./gradlew publishComposeJbToMavenLocal

cd .../compose-multiplatform/ci/templates/maven-test-project
./check.sh -Dcompose.version=9999.0.0-SNAPSHOT -Dcompose.material3.version=9999.0.0-SNAPSHOT

Release Notes

Fixes - Desktop

  • (prerelease fix) Fix Maven project doesn't work with 1.9.0-alpha03

Fixes https://youtrack.jetbrains.com/issue/CMP-8577/Maven-project-doesnt-work-with-1.9.0-alpha03

Apply a workaround by manually excluding the dependency in all modules that depend on `org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-savedstate`

## Testing
```
cd .../compose-multiplatform-core
./gradlew publishComposeJbToMavenLocal

cd .../compose-multiplatform/ci/templates/maven-test-project
./check.sh -Dcompose.version=9999.0.0-SNAPSHOT -Dcompose.material3.version=9999.0.0-SNAPSHOT
```

## Release Notes
N/A
@igordmn igordmn requested a review from MatkovIvan July 15, 2025 11:02
Copy link
Member

@MatkovIvan MatkovIvan left a comment

Choose a reason for hiding this comment

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

Should work as workaround, but I doubt that we should directly refer *-desktop as long term

@igordmn igordmn merged commit 4ebc72c into jb-main Jul 15, 2025
14 checks passed
@igordmn igordmn deleted the igor.demin/fix-maven-project-2 branch July 15, 2025 11:30
igordmn added a commit that referenced this pull request Jul 23, 2025
igordmn added a commit that referenced this pull request Jul 23, 2025
igordmn added a commit that referenced this pull request Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants