Just checked my build. Those three spring packages are already included by cas.

Are you setting up a client application or the cas overlay (authentication 
server)?

The gradle file looks to be from cas overlay. The only time you need to add non 
cas imports is if you are planning to customize cas (which should be done only 
after much deliberation - and then should be done on the main project).

Ray

On Wed, 2023-05-24 at 14:39 -0700, fasr favk wrote:
Notice: This message was sent from outside the University of Victoria email 
system. Please be cautious with links and sensitive information.

I'm trying to configure my cas authentication with spring security, so 'am 
creating a configuration classes where i need to import this package
Example : the public ServiceProperties serviceProperties() that needsthe 
package org.springframework.security.cas.ServiceProperties; to be imported.

On Wednesday, May 24, 2023 at 9:11:24 PM UTC Ray Bon wrote:
You should not need to import those spring-security packages.

What are you trying to accomplish with those packages?

Ray

On Wed, 2023-05-24 at 04:42 -0700, fasr favk wrote:
Notice: This message was sent from outside the University of Victoria email 
system. Please be cautious with links and sensitive information.

Hello, I'am using the latest cas server + spring security and am having this 
error while importing org.springframework.security.cas.*;

Error : The import org.springframework.security.cas cannot be resolved
i tried  this commands but nothing worked :
gradle clean build
gradle clean build --refresh-dependencies

My build.gradle code :

import org.apache.tools.ant.taskdefs.condition.*
import org.gradle.internal.logging.text.*
import org.apereo.cas.metadata.*
import java.nio.file.*
import static org.gradle.internal.logging.text.StyledTextOutput.Style

buildscript {
    repositories {
        if (project.privateRepoUrl) {
          maven {
            url project.privateRepoUrl
            credentials {
              username = project.privateRepoUsername
              password = System.env.PRIVATE_REPO_TOKEN
            }
          }
        }
        mavenLocal()
        mavenCentral()
        gradlePluginPortal()
        maven {
            url 'https://oss.sonatype.org/content/repositories/snapshots'
            mavenContent { snapshotsOnly() }
        }
        maven {
            url "https://repo.spring.io/milestone";
            mavenContent { releasesOnly() }
        }
    }
    dependencies {
        classpath 
"org.springframework.boot:spring-boot-gradle-plugin:${project.springBootVersion}"
        classpath 
"io.freefair.gradle:maven-plugin:${project.gradleFreeFairPluginVersion}"
        classpath 
"io.freefair.gradle:lombok-plugin:${project.gradleFreeFairPluginVersion}"
        classpath 
"io.spring.gradle:dependency-management-plugin:${project.gradleDependencyManagementPluginVersion}"
        classpath 
"com.google.cloud.tools:jib-gradle-plugin:${project.jibVersion}"

        classpath 
"de.undercouch:gradle-download-task:${project.gradleDownloadTaskVersion}"
        classpath 
"org.apereo.cas:cas-server-core-api-configuration-model:${project.'cas.version'}"
        classpath 
"org.apereo.cas:cas-server-core-configuration-metadata-repository:${project.'cas.version'}"
    }
}

repositories {
    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://repository.apache.org/content/repositories/snapshots";
        mavenContent { snapshotsOnly() }
    }
    maven {
        url 'https://build.shibboleth.net/nexus/content/repositories/releases/'
        mavenContent { releasesOnly() }
    }
    maven {
        url "https://build.shibboleth.net/nexus/content/repositories/snapshots";
        mavenContent { snapshotsOnly() }
    }
    maven {
        url "https://repo.spring.io/milestone";
        mavenContent { releasesOnly() }
    }
    maven {
        url "https://jitpack.io";
        content {
            includeGroupByRegex ".*wss4j.*"
        }
        mavenContent { releasesOnly() }
    }
}

apply plugin: "io.freefair.war-overlay"
apply plugin: "war"
apply plugin: "org.springframework.boot"
apply plugin: "io.freefair.lombok"

apply from: rootProject.file("gradle/springboot.gradle")
apply from: rootProject.file("gradle/jib.gradle")
apply from: rootProject.file("gradle/tasks.gradle")


configurations.all {
    resolutionStrategy {
        cacheChangingModulesFor 0, "seconds"
        cacheDynamicVersionsFor 0, "seconds"
        preferProjectModules()
        def failIfConflict = project.hasProperty("failOnVersionConflict") && 
Boolean.valueOf(project.getProperty("failOnVersionConflict"))
        if (failIfConflict) {
            failOnVersionConflict()
        }
    }
    exclude(group: "cglib", module: "cglib")
    exclude(group: "cglib", module: "cglib-full")
    exclude(group: "org.slf4j", module: "slf4j-log4j12")
    exclude(group: "org.slf4j", module: "slf4j-simple")
    exclude(group: "org.slf4j", module: "jcl-over-slf4j")
    exclude(group: "org.apache.logging.log4j", module: "log4j-to-slf4j")
}

war {
    entryCompression = ZipEntryCompression.STORED
    enabled = false
}

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(project.targetCompatibility)
    }
}

bootBuildImage {
    imageName = 
"${project.'containerImageOrg'}/${project.'containerImageName'}:${project.version}"
}

dependencies {
    /**
    * Do NOT modify the lines below or else you will risk breaking dependency 
management.
    */
    implementation 
enforcedPlatform("org.apereo.cas:cas-server-support-bom:${project.'cas.version'}")
    implementation 
platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)

    implementation "org.springframework.security:spring-security-cas"
    implementation "org.springframework.security:spring-security-web"
    implementation "org.springframework.security:spring-security-config"


    implementation "org.apereo.cas:cas-server-core-api-configuration-model"
    implementation "org.apereo.cas:cas-server-webapp-init"

    if (project.hasProperty("casModules")) {
        def dependencies = project.getProperty("casModules").split(",")
        dependencies.each {
            def projectsToAdd = rootProject.subprojects.findAll {project ->
                project.name<http://project.name> == "cas-server-core-${it}" || 
project.name<http://project.name> == "cas-server-support-${it}"
            }
            projectsToAdd.each {implementation it}
        }
    }
    developmentOnly 
"org.springframework.boot:spring-boot-devtools:${project.springBootVersion}"
    testImplementation "org.springframework.boot:spring-boot-starter-test"
}



-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cas-user+unsubscr...@apereo.org.
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/eadd5425c2bda0f5cc22beab9795620b506f1207.camel%40uvic.ca.

Reply via email to