Skip to content

GWT compilation fails: missing validation-api-1.0.0.GA-sources.jar when resolving from mavenLocal #826

@gallardo

Description

@gallardo

Our build failed during the :compileGwtJava task due to an unresolved dependency:

Execution failed for task ':compileGwtJava'.
> Could not resolve all files for configuration ':gwtCompileClasspath'.
   > Could not find validation-api-1.0.0.GA-sources.jar (javax.validation:validation-api:1.0.0.GA).
     Searched in the following locations:
         file:/var/lib/jenkins/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA-sources.jar

(The dependency was correctly resolved and downloaded)

Root Cause

Gradle was configured to use mavenLocal() as the first repository. When resolving dependencies, Gradle found the binary JAR for javax.validation:validation-api:1.0.0.GA in the local Maven repository (~/.m2), but that repository did not contain the corresponding *-sources.jar.
Because mavenLocal() had higher priority than remote repositories, Gradle did not continue searching elsewhere, resulting in a missing artifact during the GWT compilation phase.

> # The jar artifact is in maven local repository but not *-sources isn't:
> find /var/lib/jenkins/.m2/repository/javax/validation/validation-api/1.0.0.GA/ -name "*.jar"
/var/lib/jenkins/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA.jar
>
> # The both artifacts are available for gradle:
> find /var/lib/jenkins/.gradle/caches/modules-2/files-2.1/javax.validation/validation-api/1.0.0.GA/ -name "*.jar"
/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/javax.validation/validation-api/1.0.0.GA/b6bd7f9d78f6fdaa3c37dae18a4bd298915f328e/validation-api-1.0.0.GA.jar
/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/javax.validation/validation-api/1.0.0.GA/7a561191db2203550fbfa40d534d4997624cd369/validation-api-1.0.0.GA-sources.jar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions