From fbcc1a9b07be7c15090b16e1ed52898db9e1c9d8 Mon Sep 17 00:00:00 2001 From: Mattias Hellborg Arthursson Date: Thu, 7 Nov 2013 14:44:53 +0100 Subject: [PATCH] LDAP-279: Fiddling with logging dependencies. --- gradle/maven-deployment.gradle | 2 +- samples/odm/build.gradle | 7 +++-- samples/odm/{readme.txt => readme.md} | 2 +- .../odm/src/main/resources/log4j.properties | 7 ----- samples/odm/src/main/resources/logback.xml | 14 ++++++++++ samples/plain/{readme.txt => readme.md} | 2 +- samples/user-admin/pom.xml | 14 +++++----- samples/user-admin/readme.md | 26 ++++++++++++------- test-support/build.gradle | 8 ++++-- 9 files changed, 49 insertions(+), 33 deletions(-) rename samples/odm/{readme.txt => readme.md} (82%) delete mode 100644 samples/odm/src/main/resources/log4j.properties create mode 100644 samples/odm/src/main/resources/logback.xml rename samples/plain/{readme.txt => readme.md} (80%) diff --git a/gradle/maven-deployment.gradle b/gradle/maven-deployment.gradle index 8317ffb8..4c105de8 100644 --- a/gradle/maven-deployment.gradle +++ b/gradle/maven-deployment.gradle @@ -108,7 +108,7 @@ def customizePom(pom, gradleProject) { version = '8.1.14.v20131031' configuration { webAppConfig { - contextPath = projectName + contextPath = "/" + projectName } } } diff --git a/samples/odm/build.gradle b/samples/odm/build.gradle index c3f27017..87635a77 100644 --- a/samples/odm/build.gradle +++ b/samples/odm/build.gradle @@ -1,16 +1,15 @@ -apply from: JAVA_SCRIPT -apply plugin: 'war' -apply plugin: 'jetty' +apply from: SAMPLE_WAR_GRADLE dependencies { compile project(':spring-ldap-test'), - 'log4j:log4j:1.2.9', 'javax.servlet:jstl:1.2', "org.springframework:spring-context:$springVersion", "org.springframework:spring-webmvc:$springVersion" provided "javax.servlet:servlet-api:2.5" + runtime 'ch.qos.logback:logback-classic:1.0.13' + testCompile "org.springframework:spring-test:$springVersion", "junit:junit:$junitVersion" } \ No newline at end of file diff --git a/samples/odm/readme.txt b/samples/odm/readme.md similarity index 82% rename from samples/odm/readme.txt rename to samples/odm/readme.md index 18109c42..c479f35e 100644 --- a/samples/odm/readme.txt +++ b/samples/odm/readme.md @@ -6,4 +6,4 @@ The core Spring application context of the sample is defined in resources/applic This ApplicationContext will start an in-process Apache Directory Server instance, automatically populated with some test data. The data will be reset every time the application is restarted. -To run the example, do 'gradle jettyRun', and then navigate to http://localhost:8080/spring-ldap-plain-sample +To run the example, do `gradle jettyRun` or `mvn jetty:run`, and then navigate to `http://localhost:8080/spring-ldap-plain-sample` diff --git a/samples/odm/src/main/resources/log4j.properties b/samples/odm/src/main/resources/log4j.properties deleted file mode 100644 index 5ce7a3ee..00000000 --- a/samples/odm/src/main/resources/log4j.properties +++ /dev/null @@ -1,7 +0,0 @@ -log4j.rootCategory=INFO, stdout - -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n - -log4j.logger.org.apache.directory=ERROR \ No newline at end of file diff --git a/samples/odm/src/main/resources/logback.xml b/samples/odm/src/main/resources/logback.xml new file mode 100644 index 00000000..afaebf8e --- /dev/null +++ b/samples/odm/src/main/resources/logback.xml @@ -0,0 +1,14 @@ + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + \ No newline at end of file diff --git a/samples/plain/readme.txt b/samples/plain/readme.md similarity index 80% rename from samples/plain/readme.txt rename to samples/plain/readme.md index 00f58319..1c3ff08a 100644 --- a/samples/plain/readme.txt +++ b/samples/plain/readme.md @@ -6,4 +6,4 @@ The core Spring application context of the sample is defined in resources/applic This ApplicationContext will start an in-process Apache Directory Server instance, automatically populated with some test data. The data will be reset every time the application is restarted. -To run the example, do 'gradle jettyRun', and then navigate to http://localhost:8080/spring-ldap-plain-sample +To run the example, do `gradle jettyRun` or `mvn jetty:run`, and then navigate to `http://localhost:8080/spring-ldap-plain-sample` diff --git a/samples/user-admin/pom.xml b/samples/user-admin/pom.xml index a4f875cc..55f5dd91 100644 --- a/samples/user-admin/pom.xml +++ b/samples/user-admin/pom.xml @@ -88,7 +88,7 @@ 8.1.14.v20131031 - spring-ldap-user-admin-sample + /spring-ldap-user-admin-sample @@ -101,18 +101,18 @@ - - ch.qos.logback - logback-classic - 1.0.13 - runtime - org.springframework.ldap spring-ldap-test 2.0.0.CI-SNAPSHOT compile + + ch.qos.logback + logback-classic + 1.0.13 + runtime + com.fasterxml.jackson.core jackson-databind diff --git a/samples/user-admin/readme.md b/samples/user-admin/readme.md index c17d18d4..1352f300 100644 --- a/samples/user-admin/readme.md +++ b/samples/user-admin/readme.md @@ -8,20 +8,26 @@ The core Spring application context of the sample is defined in resources/applic By default this ApplicationContext will start an in-process Apache Directory Server instance, automatically populated with some test data. The data will be reset every time the application is restarted. -To run the example, do 'gradle jettyRun', and then navigate to http://localhost:8080/spring-ldap-user-admin-sample +To run the example, do `gradle jettyRun`, or `mvn jetty:run`, and then navigate to `http://localhost:8080/spring-ldap-user-admin-sample` It is also possible to run this sample application against a remote LDAP server as opposed to starting an in-process LDAP server. To do this, use the following system properties: -* spring.profiles.active - set this to `no-apacheds` to prevent the in-process ApacheDs to be launched -* sample.ldap.url - the URL of the target LDAP server -* sample.ldap.userDn - principal to use for authentication against the LDAP server -* sample.ldap.password - authentication password -* sample.ldap.base - the directory root to use - note that by default all data under this node will be deleted and replaced with test data -* sample.ldap.clean - set this property to false to *not* clear the root node -* sample.ldap.directory.type - NORMAL or AD. Specify AD if running against Active Directory in order to enable some particular AD tweaks +* `spring.profiles.active` - set this to `no-apacheds` to prevent the in-process ApacheDs to be launched +* `sample.ldap.url` - the URL of the target LDAP server +* `sample.ldap.userDn` - principal to use for authentication against the LDAP server +* `sample.ldap.password` - authentication password +* `sample.ldap.base` - the directory root to use - note that by default all data under this node will be deleted and replaced with test data +* `sample.ldap.clean` - set this property to false to *not* clear the root node +* `sample.ldap.directory.type` - NORMAL or AD. Specify AD if running against Active Directory in order to enable some particular AD tweaks Example: -`gradle jettyRun -Dspring.profiles.active=no-apacheds -Dsample.ldap.url=ldaps://127.0.0.1:636 -Dsample.ldap.userDn=CN=ldaptest,CN=Users,DC=261consulting,DC=local -Dsample.ldap.password=secret -Dsample.ldap.base=ou=test,dc=261consulting,dc=local -Dsample.ldap.directory.type=AD` +`gradle jettyRun -Dspring.profiles.active=no-apacheds -Dsample.ldap.url=ldaps://127.0.0.1:636 \ + -Dsample.ldap.userDn=CN=ldaptest,CN=Users,DC=261consulting,DC=local -Dsample.ldap.password=secret \ + -Dsample.ldap.base=ou=test,dc=261consulting,dc=local -Dsample.ldap.directory.type=AD` -This sample includes Bootstrap - copyright 2013 Twitter, Inc; distributed under the Apache 2 License. \ No newline at end of file +`mvn jetty:run -Dspring.profiles.active=no-apacheds -Dsample.ldap.url=ldaps://127.0.0.1:636 \ + -Dsample.ldap.userDn=CN=ldaptest,CN=Users,DC=261consulting,DC=local -Dsample.ldap.password=secret \ + -Dsample.ldap.base=ou=test,dc=261consulting,dc=local -Dsample.ldap.directory.type=AD` + +This sample uses Bootstrap to present a decent web design - copyright 2013 Twitter, Inc; distributed under the Apache 2 License. \ No newline at end of file diff --git a/test-support/build.gradle b/test-support/build.gradle index 7552ab64..6e3e61c4 100644 --- a/test-support/build.gradle +++ b/test-support/build.gradle @@ -11,8 +11,12 @@ dependencies { "org.springframework:spring-core:$springVersion", "org.springframework:spring-beans:$springVersion", "org.springframework:spring-context:$springVersion", - "org.springframework:spring-test:$springVersion", - "org.apache.directory.server:apacheds-all:1.5.5" + "org.springframework:spring-test:$springVersion" + + + compile("org.apache.directory.server:apacheds-all:1.5.5") { + exclude group: "org.slf4j", module: "slf4j-api" + } provided "junit:junit:$junitVersion" } \ No newline at end of file