BAEL-2000 - Shreyas Mahajan - Adding a project for demonstrating Spring Boot Jib Maven Plugin (#5375)

* BAEL-2000 - Shreyas Mahajan - Adding a project for demonstrating Spring Boot Jib Maven Plugin

* BAEL-2000 - Shreyas Mahajan - Incorporating the changes

* BAEL-2000 - Shreyas Mahajan - Renaming the module from spring-boot-jib to jib
This commit is contained in:
shreyasm
2018-10-17 19:39:26 +05:30
committed by Eugen
parent 2f01b43056
commit 6cabd68be5
4 changed files with 109 additions and 0 deletions
@@ -0,0 +1,12 @@
package com.baeldung;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
@@ -0,0 +1,20 @@
package com.baeldung;
public class Greeting {
private final long id;
private final String content;
public Greeting(long id, String content) {
this.id = id;
this.content = content;
}
public long getId() {
return id;
}
public String getContent() {
return content;
}
}
@@ -0,0 +1,20 @@
package com.baeldung;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.atomic.AtomicLong;
@RestController
public class GreetingController {
private static final String template = "Hello Docker, %s!";
private final AtomicLong counter = new AtomicLong();
@GetMapping("/greeting")
public Greeting greeting(@RequestParam(value="name", defaultValue="World") String name) {
return new Greeting(counter.incrementAndGet(),
String.format(template, name));
}
}