Could not find guava-3.1.1.jar

91 views
Skip to first unread message

wouldsmina

unread,
Jan 3, 2024, 4:18:58 AM1/3/24
to cas-...@apereo.org
Hello,

I'm trying to install CAS 6.6 but I get this error : 
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 guava-3.1.1.jar (com.github.ben-manes.caffeine:guava:3.1.1).
     Searched in the following locations:

Indeed, there is no guava-3.1.1.jar file in https://jitpack.io/com/github/ben-manes/caffeine/guava/3.1.1/

How to bypass the absence of this package on the JitPack repository?

Thanks.

Petr Bodnár

unread,
Jan 13, 2024, 6:29:26 AM1/13/24
to CAS Community, wouldsmina
Hello,

indeed, there is no guava-3.1.1.jar file at https://jitpack.io/com/github/ben-manes/caffeine/guava/3.1.1/. Instead, it is available as https://jitpack.io/com/github/ben-manes/caffeine/guava/v3.1.1/guava-v3.1.1.jar. From my quick research, this is caused by the fact that JitPack relies on project's Git tags which it uses as artifact's versions, for some reason 1:1 ("v3.1.1" in this case).

Anyway, from your build log, it looks like you don't use the Maven Central repository for your build, which is generally not a good idea. At https://mvnrepository.com/artifact/com.github.ben-manes.caffeine/guava/3.1.1, you can see the artifact is available right there - in the Central.

So make sure you've got something like this in your build.gradle:

dependencyResolutionManagement {
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}

AFAIK, if you clone a CAS project to build it, it should already have things like using mavenCentral() (or even jitpack.io) included in its Gradle configuration files.

Regards
Petr

wouldsmina

unread,
Jan 13, 2024, 9:37:55 AM1/13/24
to CAS Community, Petr Bodnár

Hello Petr,

Thank you for your assistance. To build the CAS project, I'm using My own Ansible playbook. I clone the 6.6 branch from the repository https://github.com/apereo/cas-overlay-template.git. Then, I simply make modifications as follows:

    /**
     * CAS dependencies and modules may be listed here.
     *
     * There is no need to specify the version number for each dependency
     * since versions are all resolved and controlled by the dependency management
     * plugin via the CAS bom.
     **/

    implementation "org.apereo.cas:cas-server-core-api-configuration-model"
    implementation "org.apereo.cas:cas-server-webapp-init"
    /** BEGIN ANSIBLE MANAGED BLOCK **/
    implementation "org.apereo.cas:cas-server-support-x509-webflow"
    implementation "org.apereo.cas:cas-server-support-token-tickets"
    implementation "org.apereo.cas:cas-server-support-discovery-profile"
    implementation "org.apereo.cas:cas-server-support-ldap"
    implementation "org.apereo.cas:cas-server-support-json-service-registry"
    implementation "org.apereo.cas:cas-server-support-oidc"
    implementation "org.apereo.cas:cas-server-support-saml-sp-integrations"
    implementation "org.apereo.cas:cas-server-support-oauth-webflow"
    implementation "org.apereo.cas:cas-server-support-throttle"
    implementation "org.apereo.cas:cas-server-support-saml-idp"
    /** END ANSIBLE MANAGED BLOCK **/

In the same file, I Modify:

repositories {
     maven { url 'https://jitpack.io' }
    if (project.privateRepoUrl) {
      maven {
        url project.privateRepoUrl
        credentials {
          username = project.privateRepoUsername
          password = System.env.PRIVATE_REPO_TOKEN
        }
      }
    }
    mavenLocal()
    mavenCentral()
    maven { url 'https://oss.sonatype.org/content/repositories/releases' }
    maven {
        url 'https://oss.sonatype.org/content/repositories/snapshots'
        mavenContent { snapshotsOnly() }
    }
    maven { url 'https://build.shibboleth.net/nexus/content/repositories/releases/' }
    maven {
        url "https://repo.spring.io/milestone"
        mavenContent { releasesOnly() }
    }
}

When I configure my Ansible playbook to install version 6.5, everything works perfectly. I initially thought it was a global issue, but it seems the problem is specific to my installation. I Will try without adding "maven { url 'https://jitpack.io' }".

Regards.



Reply all
Reply to author
Forward
0 new messages