Skip to content

Commit

Permalink
Init spring boot project
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangtle committed Nov 2, 2016
1 parent 2ea3d92 commit d63c992
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 0 deletions.
73 changes: 73 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<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.trhoanglee.expense</groupId>
<artifactId>team-expense-manager</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>team-expense-manager</name>
<!-- uncomment for WAR deployment <packaging>war</packaging> -->

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.1.RELEASE</version>
</parent>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- <dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency> -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope> </dependency> -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<app.version>${project.version}</app.version>
</properties>
</project>
24 changes: 24 additions & 0 deletions src/main/java/com/trhoanglee/expense/Application.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.trhoanglee.expense;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
* @author hoangtle
*/
@ComponentScan
@EnableAutoConfiguration
public class Application {
private static final Logger LOG = LoggerFactory.getLogger(Application.class.getCanonicalName());
public static void main(String... args) {
ApplicationContext appContext = SpringApplication.run(Application.class, args);

MemberService memberService = appContext.getBean(MemberService.class);
LOG.info(memberService.ping());
SpringApplication.exit(appContext);
}
}
10 changes: 10 additions & 0 deletions src/main/java/com/trhoanglee/expense/MemberService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.trhoanglee.expense;

import org.springframework.stereotype.Service;

@Service
public class MemberService {
public String ping() {
return "pong";
}
}
19 changes: 19 additions & 0 deletions src/test/java/com/trhoanglee/expense/ApplicationTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.trhoanglee.expense;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

public class ApplicationTest extends TestCase {
public ApplicationTest(String testName) {
super(testName);
}

public static Test suite() {
return new TestSuite(ApplicationTest.class);
}

public void testApp() {
assertTrue(true);
}
}

0 comments on commit d63c992

Please sign in to comment.