@ladislavGazo
gazo@seges.sk
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.8.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
package hello;
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.stereotype.*;
import org.springframework.web.bind.annotation.*;
@Controller
@EnableAutoConfiguration
public class SampleController {
@RequestMapping("/")
@ResponseBody
String home() {
return "Hello World!";
}
public static void main(String[] args) throws Exception {
SpringApplication.run(SampleController.class, args);
}
}
<profiles>
<profile>
<id>reloaded</id>
<dependencies>
<dependency>
<groupId>io.github.jhipster.loaded</groupId>
<artifactId>agent</artifactId>
<version>0.12</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
http.authorizeRequests().antMatchers("/identity/login", "/page/**", "/client/**", "/user/**").permitAll().anyRequest().authenticated();
http.csrf().disable();
http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
http.addFilterBefore(new AuthenticationTokenFilter(identityService), AnonymousAuthenticationFilter.class);
http.exceptionHandling().authenticationEntryPoint(new UnauthorizedEntryPoint());
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId> <artifactId>h2</artifactId> </dependency>
<dependency>
<groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> </dependency>
spring.datasource.url: jdbc:postgresql://localhost/mydb
spring.datasource.username: myuser
spring.datasource.password: mypass
spring.datasource.driverClassName: org.postgresql.Driver
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
@Component
@ConfigurationProperties(prefix="connection")
public class ConnectionSettings {
private String username;
private InetAddress remoteAddress;
// ... getters and setters
}
# application.yml
connection:
username: admin
remoteAddress: 192.168.1.1
curl https://raw.githubusercontent.com/n8han/conscript/master/setup.sh | sh
# add to your path ~/bin cs n8han/giter8 g8 lgazo/scala-boot