quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
14.53k stars 2.84k forks source link

org.mvnpm:lit:[3.1.3,3.2) range version dependency doesn't work #47347

Closed dbatyuk closed 1 month ago

dbatyuk commented 1 month ago

Describe the bug

Looks like there is issue with new https://repo.maven.apache.org/maven2/org/mvnpm/lit/maven-metadata.xml where it only lists 2.0.1 version while there are other versions https://repo.maven.apache.org/maven2/org/mvnpm/lit/. It breaks quarkus 3.15.4 because it uses range dependecy

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

quarkus-bot[bot] commented 1 month ago

/cc @phillip-kruger (mvnpm)

phillip-kruger commented 1 month ago

see https://github.com/mvnpm/mvnpm/issues/20500

We are in communication with Maven central w.r.t this.

As a workaround you can add the mvnpm server repo

To use it in your local Maven settings add the following to your settings.xml (typically /home/your-username/.m2/settings.xml)

<settings>
    <profiles>
        <profile>
            <id>mvnpm-repo</id>
            <repositories>
                <repository>
                    <id>central</id>
                    <name>central</name>
                    <url>https://repo.maven.apache.org/maven2</url>
                </repository>
                <repository>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                    <id>mvnpm.org</id> 
                    <name>mvnpm</name>
                    <url>https://repo.mvnpm.org/maven2</url>
                </repository>
            </repositories>
        </profile>
    </profiles>

    <activeProfiles>
        <activeProfile>mvnpm-repo</activeProfile>
    </activeProfiles>

</settings>
cristianovagos commented 1 month ago

Same here on 3.15.2, and bumping to 3.15.4 has the same behavior.

Applying other Maven repos as suggested here does not solve it either:

repositories {
    mavenCentral()
    gradlePluginPortal()
    mavenLocal()
    maven("https://repo.maven.apache.org/maven2")
    maven("https://repo.mvnpm.org/maven2")
}

Error on Gradle build:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':quarkusGenerateCode'.
> Could not resolve all files for configuration ':quarkusProdRuntimeClasspathConfigurationDeployment'.
   > Could not find any version that matches org.mvnpm:lit:[3.1.3,3.2).
     Versions that do not match:
       - 2.0.1
       - 3.3.0
       - 3.2.1
       - 3.2.0
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/org/mvnpm/lit/maven-metadata.xml
       - file:/home/runner/.m2/repository/org/mvnpm/lit/
       - https://repo.mvnpm.org/maven2/org/mvnpm/lit/maven-metadata.xml
       - https://repo.mvnpm.org/maven2/org/mvnpm/lit/3.1.4/lit-3.1.4.pom
     Required by:
         root project : > io.quarkus.platform:quarkus-bom:3.15.4 > org.mvnpm.at.mvnpm:codeblock:1.0.16
         root project : > io.quarkus.platform:quarkus-bom:3.15.4 > org.mvnpm.at.mvnpm:qomponent:1.0.0
arnauhortelano commented 1 month ago

Same @cristianovagos

phillip-kruger commented 1 month ago

@arnauhortelano @cristianovagos Please use the workaround until it's fixed in central.

dbatyuk commented 1 month ago

@phillip-kruger it looks like using https://repo.mvnpm.org/maven2 doesn't help as for example https://repo.mvnpm.org/maven2/org/mvnpm/lit/3.1.4/lit-3.1.4.pom states Package 'org.mvnpm:lit:3.1.4' is already synced on Maven Central.

quotidian-ennui commented 1 month ago

The suggestion that I put in for dependency-resolution is working for quarkus-3.15.4 (as of 12:00 BST) : https://github.com/mvnpm/mvnpm/issues/20500#issuecomment-2801006209 in so far that I don't have to gradle --offline

What I did to figure out the correct string was to do a gradle -Dorg.gradle.console=plain dependencies | grep "org\.mvnpm:lit" to figure out what it was trying to resolve and then for substitute that. Yours might vary depending on your quarkus version / quarkiverse versioning.

phillip-kruger commented 1 month ago

@phillip-kruger it looks like using https://repo.mvnpm.org/maven2 doesn't help as for example https://repo.mvnpm.org/maven2/org/mvnpm/lit/3.1.4/lit-3.1.4.pom states Package 'org.mvnpm:lit:3.1.4' is already synced on Maven Central.

O yes. This will fall back to central once we synced. Let me see if I can create a workaround in mvnpm. I'll let you know here.

phillip-kruger commented 1 month ago

This is now fixed by cenrtal.

ASURA-RD commented 1 month ago

@phillip-kruger still facing the issue using quarkus 3.15.1

Execution failed for task ':common-services:quarkusGenerateCode'.

Could not resolve all files for configuration ':common-services:quarkusProdRuntimeClasspathConfigurationDeployment'. Could not find any version that matches org.mvnpm:lit:[3.1.3,3.2). Versions that do not match: 2.2.3 Searched in the following locations:

sfgho commented 1 month ago

same for me on quarkus 3.15.2

ASURA-RD commented 1 month ago

i tried downgrading and its working fine with 3.11.3 and i was able to build

ToxSickFPV commented 1 month ago

Also still facing the same issue as @ASURA-RD on Quarkus 3.15.3.1

ASURA-RD commented 1 month ago

Resolved the issue after upgrading to 3.16.1

temofey1989 commented 1 month ago

Not working for 3.15.4...

umutsahin commented 1 month ago

Still not working for me as well - 3.15.2

Using mulesoft repo - "https://repository.mulesoft.org/nexus/content/repositories/public/"

As a workaround for those who are stuck as me

levimartines commented 1 month ago

for those who are still facing this issue and want a quick workaround, try manually download the artifact mvn dependency:get -Dartifact=org.mvnpm:lit:3.1.3 and add mavenLocal() to build.gradle repositories

1Wggb1 commented 1 month ago

Maybe enforced dependency can solve the problem.

Example in gradle:

#build.gradle
...
implementation enforcedPlatform('org.mvnpm:lit:3.xy')#update to version 3.20 works, but needs to know if exists the side-effects
...
phillip-kruger commented 1 month ago

It's fixed on central side, you can remove the workaround

uroshekic commented 1 month ago

Still not working for me on Quarkus 3.15.4.

phillip-kruger commented 1 month ago

@uroshekic What error do you get ? Also try adding -U in your maven command to force an update

uroshekic commented 1 month ago

Thank you, I've added --refresh-dependencies to gradle build and forcing refresh of dependencies solved the issue.

phillip-kruger commented 1 month ago

We paused mvnpm syncing to central for the time being, so at least we can not break it again