Skip to content

Instantly share code, notes, and snippets.

View mickknutson's full-sized avatar

Mick Knutson mickknutson

View GitHub Profile
public class WebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
...
@Override
protected Class<?>[] getServletConfigClasses() {
return new Class[] { WebMvcConfig.class };
}
...
@Override
public void onStartup(final ServletContext servletContext) throws ServletException {
public class WebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Class<?>[] getRootConfigClasses() {
return new Class[] { JavaConfig.class,
DataSourceConfig.class,
SecurityConfig.class
};
}
...
@mickknutson
mickknutson / pom.xml
Created November 12, 2012 14:22 — forked from gordonad/pom.xml
Spring Best Practices Maven Pom
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.gordondickens.sample</groupId>
<artifactId>sample-parent</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
@mickknutson
mickknutson / file1.sh
Created February 25, 2012 18:05
gradle4
C:\>gradle -t -a
--- buildscript ---
versions: [root:1.0.0]
list1: [com.baselogic:common:1.0.0]
list2: [com.baselogic:extended:1.0.0]
--- allprojects ---
versions: [root:1.0.0]
list1: [com.baselogic:common:1.0.0]
list2: [com.baselogic:extended:1.0.0]
--- allprojects ---
@mickknutson
mickknutson / file1.sh
Created February 25, 2012 18:05
gradle4
C:\>gradle -t -a
--- buildscript ---
versions: [root:1.0.0]
list1: [com.baselogic:common:1.0.0]
list2: [com.baselogic:extended:1.0.0]
--- allprojects ---
versions: [root:1.0.0]
list1: [com.baselogic:common:1.0.0]
list2: [com.baselogic:extended:1.0.0]
--- allprojects ---
@mickknutson
mickknutson / file1.groovy
Created February 25, 2012 18:03
gradle3
buildscript {
versions = [root: "1.0.0"]
list1 = ["com.baselogic:common:${versions.root}"]
list2 = ["com.baselogic:extended:${versions.root}"]
println "--- buildscript ---"
println "versions: $versions"
println "list1: $list1"
println "list2: $list2"
@mickknutson
mickknutson / file1.groovy
Created February 25, 2012 18:03
gradle2
buildscript {
def versions = [root: "1.0.0"]
List list1 = ["com.baselogic:common:${versions.root}"]
List list2 = ["com.baselogic:extended:${versions.root}"]
println "--- buildscript ---"
println "versions: $versions"
println "list1: $list1"
println "list2: $list2"
@mickknutson
mickknutson / file1.groovy
Created February 25, 2012 18:02
gradle1
def versions = [root: "1.0.0"]
buildscript {
List list1 = ["com.baselogic:common:${versions.root}"]
List list2 = ["com.baselogic:extended:${versions.root}"]
println "--- buildscript ---"
println "versions: $versions"
println "list1: $list1"
@mickknutson
mickknutson / file1.groovy
Created February 12, 2012 13:48
new gradle repositories
repositories {
mavenLocal()
mavenCentral()
maven {url 'https://maven.java.net/content/groups/public/'}
maven {url 'http://maven.glassfish.org/content/repositories/eclipselink'}
maven {url 'http://nexus.openqa.org/content/repositories/releases/'}
maven {url 'http://scala-tools.org/repo-releases'}
maven {url 'http://repository.jboss.org/nexus/content/groups/public-jboss/'}
@mickknutson
mickknutson / file1.sh
Created February 12, 2012 13:44
gradle repositories error
08:42:13.083 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':ch01:compileJava'
08:42:13.094 [ERROR] [org.gradle.BuildExceptionReporter]
08:42:13.099 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
08:42:13.104 [ERROR] [org.gradle.BuildExceptionReporter]
08:42:13.108 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
08:42:13.112 [ERROR] [org.gradle.BuildExceptionReporter] Could not resolve all dependencies for configuration ':ch01:compile'.
08:42:13.118 [ERROR] [org.gradle.BuildExceptionReporter] Cause: You must specify a URL for a Maven repository.