Menu

Gradle 安装 + 配置 + 构建大型项目(CAS)

2017年12月18日 - SSO

Gradle 安装(Windows)

Gradle 配置(Windows)

org.gradle.jvmargs=-Xms1048m -Xmx4048m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.daemon=true

Gradle 在 IntelliJ IDEA 构建大型项目流程

设置项目的 Gradle 配置文件

distributionUrl=file:///D:/gradle/gradle-4.4-bin.zip
repositories {
    mavenLocal() 
    mavenCentral() 
    maven { url "https://maven.eveoh.nl/content/repositories/releases" }
    maven { url "https://plugins.gradle.org/m2/" }
    maven { url "https://repo.spring.io/plugins-release" }
    jcenter()
}
repositories {
    mavenLocal() 
    maven { url "http://maven.aliyun.com/nexus/content/groups/public/" } 
    mavenCentral() 
    maven { url "https://maven.eveoh.nl/content/repositories/releases" }
    maven { url "https://plugins.gradle.org/m2/" }
    maven { url "https://repo.spring.io/plugins-release" }
    jcenter()
}

配置 IntelliJ IDEA 的 VM

-Xms2028m
-Xmx8050m
-server
-Xms2g
-Xmx8g
-XX:NewRatio=3
-Xss16m
-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled
-XX:ConcGCThreads=4
-XX:ReservedCodeCacheSize=840m
-XX:+AlwaysPreTouch
-XX:+TieredCompilation
-XX:+UseCompressedOops
-XX:SoftRefLRUPolicyMSPerMB=50
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djsse.enableSNIExtension=false
-ea
-XX:MaxPermSize=512m
-XX:PermSize=512m
-Xverify:none

通过 IntelliJ IDEA 打开 CAS 项目

Gradle CAS

CAS 项目额外还可以继续优化的地方

rootProject.name = "cas-server"

include "api:cas-server-core-api-configuration"
include "api:cas-server-core-api-util"
include "api:cas-server-core-api-authentication"
include "api:cas-server-core-api-logout"
include "api:cas-server-core-api-monitor"
include "api:cas-server-core-api-services"
include "api:cas-server-core-api-ticket"
include "api:cas-server-core-api-validation"
include "api:cas-server-core-api-web"
include "api:cas-server-core-api"
include "api:cas-server-core-api-protocol"
include "api:cas-server-core-api-events"
include "api:cas-server-core-api-webflow"

include "core:cas-server-core-util-api"
include "core:cas-server-core-util"
include "core:cas-server-core-webflow-api"
include "core:cas-server-core-webflow"
include "core:cas-server-core-web-api"
include "core:cas-server-core-web"
include "core:cas-server-core-logging-config-cloudwatch"
include "core:cas-server-core-logging-config-splunk"
include "core:cas-server-core-logging-config"
include "core:cas-server-core-logging"
include "core:cas-server-core-logout-api"
include "core:cas-server-core-logout"
include "core:cas-server-core-monitor"
include "core:cas-server-core-services-api"
include "core:cas-server-core-services-authentication"
include "core:cas-server-core-services-registry"
include "core:cas-server-core-services"
include "core:cas-server-core-tickets-api"
include "core:cas-server-core-tickets"
include "core:cas-server-core-validation-api"
include "core:cas-server-core-validation"
include "core:cas-server-core-cookie-api"
include "core:cas-server-core-cookie"
include "core:cas-server-core-events"
include "core:cas-server-core-events-configuration"
include "core:cas-server-core-events-configuration-cloud-bus"
include "core:cas-server-core-audit"
include "core:cas-server-core-configuration-api"
include "core:cas-server-core-configuration"
include "core:cas-server-core-configuration-metadata-repository"
include "core:cas-server-core-configuration-cloud-azure-keyvault"
include "core:cas-server-core-configuration-cloud-jdbc"
include "core:cas-server-core-configuration-cloud-amqp"
include "core:cas-server-core-configuration-cloud-kafka"
include "core:cas-server-core-configuration-cloud-vault"
include "core:cas-server-core-configuration-cloud-mongo"
include "core:cas-server-core-configuration-cloud-dynamodb"
include "core:cas-server-core-configuration-cloud-zookeeper"
include "core:cas-server-core-authentication-attributes"
include "core:cas-server-core-authentication-api"
include "core:cas-server-core-authentication"
include "core:cas-server-core-authentication-mfa"
include "core:cas-server-core"

include "docs:cas-server-documentation"
include "docs:cas-server-documentation-swagger"

include "support:cas-server-support-bom"
include "support:cas-server-support-discovery-profile"
include "support:cas-server-support-person-directory"
include "support:cas-server-support-bootadmin-client"
include "support:cas-server-support-jdbc-drivers"
include "support:cas-server-support-metrics"
include "support:cas-server-support-audit-mongo"
include "support:cas-server-support-audit-jdbc"
include "support:cas-server-support-influxdb-core"
include "support:cas-server-support-cosmosdb-core"
include "support:cas-server-support-eureka-client"
include "support:cas-server-support-consul-client"
include "support:cas-server-support-generic"
include "support:cas-server-support-generic-remote-webflow"
include "support:cas-server-support-jdbc-authentication"
include "support:cas-server-support-jdbc"
include "support:cas-server-support-configuration"
include "support:cas-server-support-jpa-util"
include "support:cas-server-support-geolocation"
include "support:cas-server-support-geolocation-googlemaps"
include "support:cas-server-support-geolocation-maxmind"
include "support:cas-server-support-ldap"
include "support:cas-server-support-ldap-core"
include "support:cas-server-support-token-core"
include "support:cas-server-support-token-authentication"
include "support:cas-server-support-token-tickets"
include "support:cas-server-support-token-webflow"
include "support:cas-server-support-trusted-mfa"
include "support:cas-server-support-oauth-api"
include "support:cas-server-support-oauth-core"
include "support:cas-server-support-oauth-services"
include "support:cas-server-support-oauth"
include "support:cas-server-support-oauth-webflow"
include "support:cas-server-support-pac4j-core-clients"
include "support:cas-server-support-pac4j"
include "support:cas-server-support-pac4j-webflow"
include "support:cas-server-support-mongo-core"
include "support:cas-server-support-mongo"
include "support:cas-server-support-saml-core"
include "support:cas-server-support-saml"
include "support:cas-server-support-saml-idp-core"
include "support:cas-server-support-saml-idp"
include "support:cas-server-support-saml-idp-metadata-mongo"
include "support:cas-server-support-saml-idp-metadata-jpa"
include "support:cas-server-support-saml-googleapps-core"
include "support:cas-server-support-saml-googleapps"
include "support:cas-server-support-saml-mdui-core"
include "support:cas-server-support-saml-mdui"
include "support:cas-server-support-saml-sp-integrations"
include "support:cas-server-support-memcached-core"
include "support:cas-server-support-redis-core"
include "support:cas-server-support-pac4j-authentication"
include "support:cas-server-support-pac4j-core"
include "support:cas-server-support-captcha"
include "support:cas-server-support-rest"
include "support:cas-server-support-rest-tokens"
include "support:cas-server-support-rest-services"
include "support:cas-server-support-rest-authentication"
include "support:cas-server-support-hazelcast-core"
include "support:cas-server-support-reports"
include "support:cas-server-support-themes"
include "support:cas-server-support-throttle-core"
include "support:cas-server-support-throttle"
include "support:cas-server-support-throttle-jdbc"
include "support:cas-server-support-validation"
include "support:cas-server-support-actions"
//include "support:cas-server-support-electrofence"
//include "support:cas-server-support-sentry"
//include "support:cas-server-support-sleuth"
//include "support:cas-server-support-cloud-directory-authentication"
//include "support:cas-server-support-interrupt-api"
//include "support:cas-server-support-interrupt-core"
//include "support:cas-server-support-interrupt-webflow"
//include "support:cas-server-support-openid"
//include "support:cas-server-support-openid-webflow"
//include "support:cas-server-support-wsfederation"
//include "support:cas-server-support-wsfederation-webflow"
//include "support:cas-server-support-sms-twilio"
//include "support:cas-server-support-sms-textmagic"
//include "support:cas-server-support-sms-clickatell"
//include "support:cas-server-support-fortress"
//include "support:cas-server-support-basic"
//include "support:cas-server-support-scim"
//include "support:cas-server-support-gua"
//include "support:cas-server-support-spnego"
//include "support:cas-server-support-spnego-webflow"
//include "support:cas-server-support-trusted-mfa-jdbc"
//include "support:cas-server-support-trusted-mfa-mongo"
//include "support:cas-server-support-trusted-mfa-rest"
//include "support:cas-server-support-trusted"
//include "support:cas-server-support-trusted-webflow"
//include "support:cas-server-support-digest-authentication"
//include "support:cas-server-support-x509"
//include "support:cas-server-support-x509-core"
//include "support:cas-server-support-x509-webflow"
//include "support:cas-server-support-oidc-core"
//include "support:cas-server-support-oidc-services"
//include "support:cas-server-support-oidc"
//include "support:cas-server-support-cassandra-core"
//include "support:cas-server-support-cassandra-authentication"
//include "support:cas-server-support-couchbase-core"
//include "support:cas-server-support-couchbase-authentication"
//include "support:cas-server-support-ws-sts"
//include "support:cas-server-support-ws-idp-api"
//include "support:cas-server-support-ws-idp"
//include "support:cas-server-support-shibboleth"
//include "support:cas-server-support-otp-mfa"
//include "support:cas-server-support-grouper-core"
//include "support:cas-server-support-grouper"
//include "support:cas-server-support-shell"
//include "support:cas-server-support-rest-x509"
//include "support:cas-server-support-aup-core"
//include "support:cas-server-support-aup-mongo"
//include "support:cas-server-support-aup-jdbc"
//include "support:cas-server-support-aup-rest"
//include "support:cas-server-support-aup-ldap"
//include "support:cas-server-support-aup-webflow"

/*Multifactor Authentication start*/
//include "support:cas-server-support-yubikey-core"
//include "support:cas-server-support-yubikey-core-mfa"
//include "support:cas-server-support-yubikey-jpa"
//include "support:cas-server-support-yubikey-mongo"
//include "support:cas-server-support-yubikey"
//include "support:cas-server-support-duo-core-mfa"
//include "support:cas-server-support-duo-core"
//include "support:cas-server-support-duo"
//include "support:cas-server-support-authy-core"
//include "support:cas-server-support-authy"
//include "support:cas-server-support-swivel-core"
//include "support:cas-server-support-swivel"
//include "support:cas-server-support-azure-core"
//include "support:cas-server-support-azure"
//include "support:cas-server-support-azure-ad-authentication"
//include "support:cas-server-support-gauth-core-mfa"
//include "support:cas-server-support-gauth-core"
//include "support:cas-server-support-gauth"
//include "support:cas-server-support-gauth-jpa"
//include "support:cas-server-support-gauth-mongo"
//include "support:cas-server-support-radius-core"
//include "support:cas-server-support-radius"
//include "support:cas-server-support-radius-core-mfa"
//include "support:cas-server-support-radius-mfa"
//include "support:cas-server-support-u2f-core"
//include "support:cas-server-support-u2f"
//include "support:cas-server-support-u2f-jpa"
//include "support:cas-server-support-u2f-mongo"
/*Multifactor Authentication start*/


/*Service Registry start*/
include "support:cas-server-support-mongo-service-registry"
include "support:cas-server-support-json-service-registry"
include "support:cas-server-support-jpa-service-registry"
//include "support:cas-server-support-rest-service-registry"
//include "support:cas-server-support-yaml-service-registry"
//include "support:cas-server-support-cosmosdb-service-registry"
//include "support:cas-server-support-dynamodb-service-registry"
//include "support:cas-server-support-service-registry-stream"
//include "support:cas-server-support-service-registry-stream-hazelcast"
//include "support:cas-server-support-ldap-service-registry"
//include "support:cas-server-support-redis-service-registry"
//include "support:cas-server-support-couchbase-service-registry"
/*Service Registry end*/

/*Ticket Registry start*/
include "support:cas-server-support-redis-ticket-registry"
include "support:cas-server-support-memcached-ticket-registry"
//include "support:cas-server-support-dynamodb-ticket-registry"
//include "support:cas-server-support-jms-ticket-registry"
//include "support:cas-server-support-jpa-ticket-registry"
//include "support:cas-server-support-mongo-ticket-registry"
//include "support:cas-server-support-couchbase-ticket-registry"
//include "support:cas-server-support-ignite-ticket-registry"
//include "support:cas-server-support-infinispan-ticket-registry"
//include "support:cas-server-support-ehcache-ticket-registry"
//include "support:cas-server-support-hazelcast-ticket-registry"
/*Ticket Registry end*/

/*Monitoring start*/
//include "support:cas-server-support-jdbc-monitor"
//include "support:cas-server-support-ldap-monitor"
//include "support:cas-server-support-mongo-monitor"
//include "support:cas-server-support-memcached-monitor"
//include "support:cas-server-support-ehcache-monitor"
//include "support:cas-server-support-hazelcast-monitor"
/*Monitoring end*/

/*events start*/
//include "support:cas-server-support-events-mongo"
//include "support:cas-server-support-events-jpa"
//include "support:cas-server-support-events-memory"
//include "support:cas-server-support-events-influxdb"
/*events end*/

/*Attribute Consent start*/
//include "support:cas-server-support-consent-api"
//include "support:cas-server-support-consent-core"
//include "support:cas-server-support-consent-jdbc"
//include "support:cas-server-support-consent-ldap"
//include "support:cas-server-support-consent-rest"
//include "support:cas-server-support-consent-webflow"
//include "support:cas-server-support-consent-mongo"
/*Attribute Consent end*/

/*Surrogate Authentication start*/
//include "support:cas-server-support-surrogate-api"
//include "support:cas-server-support-surrogate-authentication"
//include "support:cas-server-support-surrogate-authentication-ldap"
//include "support:cas-server-support-surrogate-authentication-jdbc"
//include "support:cas-server-support-surrogate-authentication-rest"
//include "support:cas-server-support-surrogate-webflow"
/*Surrogate Authentication end*/

/*Password Management start*/
include "support:cas-server-support-pm"
include "support:cas-server-support-pm-webflow"
//include "support:cas-server-support-pm-jdbc"
//include "support:cas-server-support-pm-ldap"
//include "support:cas-server-support-pm-rest"
/*Password Management end*/

include "webapp:cas-server-webapp-init"
include "webapp:cas-server-webapp-session-redis"
include "webapp:cas-server-webapp-session-hazelcast"
include "webapp:cas-server-webapp-session-mongo"
include "webapp:cas-server-webapp-config"
include "webapp:cas-server-webapp-config-security"
include "webapp:cas-server-webapp"
include "webapp:cas-server-webapp-config-server"
include "webapp:cas-server-webapp-eureka-server"
include "webapp:cas-server-webapp-bootadmin-server"
include "webapp:cas-server-webapp-tomcat"
include "webapp:cas-server-webapp-jetty"
include "webapp:cas-server-webapp-undertow"
//implementation project(":support:cas-server-support-oidc-services")
//implementation project(":support:cas-server-support-oidc-core")
//implementation project(":support:cas-server-support-ws-idp-api")

//implementation project(":support:cas-server-support-authy-core")
//implementation project(":support:cas-server-support-azure-core")
//implementation project(":support:cas-server-support-u2f-core")
//implementation project(":support:cas-server-support-swivel-core")
//implementation project(":support:cas-server-support-gauth-core-mfa")
//implementation project(":support:cas-server-support-duo-core-mfa")
//implementation project(":support:cas-server-support-yubikey-core-mfa")
//implementation project(":support:cas-server-support-radius-core-mfa")
标签:,