Created
June 18, 2014 15:15
-
-
Save jrgleason/1e23b694e0facc123caa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.test.itext; | |
import java.util.Arrays; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | |
import org.springframework.context.ApplicationContext; | |
import org.springframework.context.annotation.ComponentScan; | |
import org.springframework.context.annotation.Configuration; | |
@Configuration | |
@EnableAutoConfiguration | |
@ComponentScan | |
public class Application { | |
public static void main(String[] args) { | |
ApplicationContext ctx = SpringApplication.run(Application.class, args); | |
System.out.println("Let's inspect the beans provided by Spring Boot:"); | |
String[] beanNames = ctx.getBeanDefinitionNames(); | |
Arrays.sort(beanNames); | |
for (String beanName : beanNames) { | |
System.out.println(beanName); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
maven { url "http://repo.spring.io/libs-release" } | |
mavenLocal() | |
mavenCentral() | |
jcenter() | |
} | |
dependencies { | |
classpath 'org.gradle.api.plugins:gradle-tomcat-plugin:1.2.3' | |
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.1.1.RELEASE' | |
} | |
} | |
apply plugin: 'war' | |
apply plugin: 'spring-boot' | |
apply plugin: 'tomcat' | |
war { baseName='itext' } | |
repositories { | |
mavenLocal() | |
mavenCentral() | |
maven { url "http://repo.spring.io/libs-release" } | |
} | |
dependencies { | |
def tomcatVersion = '7.0.42' | |
tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}", | |
"org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}" | |
tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") { | |
exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj' | |
} | |
compile("org.springframework.boot:spring-boot-starter-web") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.test.itext.controllers; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
@RestController | |
public class GreetingController { | |
@RequestMapping("/") | |
public String test(){ | |
System.out.println("Test"); | |
return "Test"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment