Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
huangbaixun committed May 27, 2018
1 parent 5dd1760 commit 7b45da3
Show file tree
Hide file tree
Showing 26 changed files with 242 additions and 134 deletions.
6 changes: 6 additions & 0 deletions .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8
5 changes: 5 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8
4 changes: 4 additions & 0 deletions .settings/org.eclipse.wst.common.project.facet.core.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="cloudfoundry.standalone.app" version="1.0"/>
</faceted-project>
16 changes: 8 additions & 8 deletions derby.log
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
----------------------------------------------------------------
Wed Apr 25 22:23:49 CST 2018:
Booting Derby version The Apache Software Foundation - Apache Derby - 10.13.1.1 - (1765088): instance a816c00e-0162-fd30-618b-00000ca12a28
----------------------------------------------------------------
Sun Apr 29 16:06:49 CST 2018:
Booting Derby version The Apache Software Foundation - Apache Derby - 10.13.1.1 - (1765088): instance a816c00e-0163-1070-a9c7-00000923aa58
on database directory memory:D:\workspace\course-api\testdb with class loader sun.misc.Launcher$AppClassLoader@73d16e93
Loaded from file:/C:/Users/Admin/.m2/repository/org/apache/derby/derby/10.13.1.1/derby-10.13.1.1.jar
Loaded from file:/C:/Users/Admin/.m2/repository/org/apache/derby/derby/10.13.1.1/derby-10.13.1.1.jar
java.vendor=Oracle Corporation
java.runtime.version=1.8.0_101-b13
user.dir=D:\workspace\course-api
user.dir=D:\workspace\course-api
os.name=Windows 10
os.arch=amd64
os.version=10.0
derby.system.home=null
Database Class Loader started - derby.database.classpath=''
os.version=10.0
derby.system.home=null
Database Class Loader started - derby.database.classpath=''
104 changes: 71 additions & 33 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,34 +1,72 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.huangbaixun.springbootquickstart</groupId>
<artifactId>course-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.1.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<properties>
<java.version>1.8</java.version>
</properties>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.huangbaixun.springbootquickstart</groupId>
<artifactId>course-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.1.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!--dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency-->
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<properties>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>io.huangbaixun.springbootstarter.CourseApiApp</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<imageName>io.huangbaixun.course-api</imageName>
<baseImage>java:8</baseImage>
<entryPoint>["java", "-jar", "/${project.build.finalName}.jar"]</entryPoint>
<!-- copy the service's jar file from target into the root directory
of the image -->
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
package io.huangbaixun.springbootstarter.hello;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

@RequestMapping("/hello")
public String SayHi()
{
return "Hi";
}
}
package io.huangbaixun.springbootstarter.hello;

import java.net.InetAddress;
import java.net.UnknownHostException;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

@RequestMapping("/hello")
public String SayHi()
{
String ip ="";
try {
InetAddress addr = InetAddress.getLocalHost();
ip= addr.getHostAddress();
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

return "Hi from "+ip;
}

}
24 changes: 12 additions & 12 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
server.port=80
debug = true
# ===============================
# = JPA / HIBERNATE
# ===============================
# Show or not log for each sql query
spring.jpa.show-sql=true
# Hibernate ddl auto (create, create-drop, update): with "create-drop" the database
# schema will be automatically created afresh for every start of application
spring.jpa.hibernate.ddl-auto=create-drop
# Allows Hibernate to generate SQL optimized for a particular DBMS
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.DerbyDialect
server.port=80
# debug = true
# ===============================
# = JPA / HIBERNATE
# ===============================
# Show or not log for each sql query
spring.jpa.show-sql=true
# Hibernate ddl auto (create, create-drop, update): with "create-drop" the database
# schema will be automatically created afresh for every start of application
spring.jpa.hibernate.ddl-auto=create-drop
# Allows Hibernate to generate SQL optimized for a particular DBMS
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.DerbyDialect
management.port=9090
21 changes: 11 additions & 10 deletions target/classes/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Manifest-Version: 1.0
Implementation-Title: course-api
Implementation-Version: 0.0.1-SNAPSHOT
Built-By: Admin
Implementation-Vendor-Id: io.huangbaixun.springbootquickstart
Build-Jdk: 1.8.0_101
Implementation-URL: http://projects.spring.io/spring-boot/course-api/
Created-By: Maven Integration for Eclipse
Implementation-Vendor: Pivotal Software, Inc.

Manifest-Version: 1.0
Implementation-Title: course-api
Implementation-Version: 0.0.1-SNAPSHOT
Built-By: Admin
Implementation-Vendor-Id: io.huangbaixun.springbootquickstart
Build-Jdk: 1.8.0_101
Implementation-URL: http://projects.spring.io/spring-boot/course-api/
Created-By: Maven Integration for Eclipse
Implementation-Vendor: Pivotal Software, Inc.
Main-Class: io.huangbaixun.springbootstarter.CourseApiApp

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Generated by Maven Integration for Eclipse
#Wed Apr 25 22:19:13 CST 2018
version=0.0.1-SNAPSHOT
groupId=io.huangbaixun.springbootquickstart
m2e.projectName=course-api
m2e.projectLocation=D\:\\workspace\\course-api
artifactId=course-api
#Generated by Maven Integration for Eclipse
#Sun May 27 11:47:44 CST 2018
version=0.0.1-SNAPSHOT
groupId=io.huangbaixun.springbootquickstart
m2e.projectName=course-api
m2e.projectLocation=D\:\\workspace\\course-api
artifactId=course-api
Original file line number Diff line number Diff line change
@@ -1,34 +1,72 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.huangbaixun.springbootquickstart</groupId>
<artifactId>course-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.1.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<properties>
<java.version>1.8</java.version>
</properties>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.huangbaixun.springbootquickstart</groupId>
<artifactId>course-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.1.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!--dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency-->
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<properties>
<java.version>1.8</java.version>
</properties>
<build>
<plugins>

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>io.huangbaixun.springbootstarter.CourseApiApp</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<imageName>io.huangbaixun.course-api</imageName>
<baseImage>java:8</baseImage>
<entryPoint>["java", "-jar", "/${project.build.finalName}.jar"]</entryPoint>
<!-- copy the service's jar file from target into the root directory
of the image -->
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
</project>
24 changes: 12 additions & 12 deletions target/classes/application.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
server.port=80
debug = true
# ===============================
# = JPA / HIBERNATE
# ===============================
# Show or not log for each sql query
spring.jpa.show-sql=true
# Hibernate ddl auto (create, create-drop, update): with "create-drop" the database
# schema will be automatically created afresh for every start of application
spring.jpa.hibernate.ddl-auto=create-drop
# Allows Hibernate to generate SQL optimized for a particular DBMS
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.DerbyDialect
server.port=80
# debug = true
# ===============================
# = JPA / HIBERNATE
# ===============================
# Show or not log for each sql query
spring.jpa.show-sql=true
# Hibernate ddl auto (create, create-drop, update): with "create-drop" the database
# schema will be automatically created afresh for every start of application
spring.jpa.hibernate.ddl-auto=create-drop
# Allows Hibernate to generate SQL optimized for a particular DBMS
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.DerbyDialect
management.port=9090
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified target/course-api-0.0.1-SNAPSHOT.jar
Binary file not shown.
Binary file added target/course-api-0.0.1-SNAPSHOT.jar.original
Binary file not shown.
3 changes: 3 additions & 0 deletions target/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM java:8
ADD /course-api-0.0.1-SNAPSHOT.jar //
ENTRYPOINT ["java", "-jar", "/course-api-0.0.1-SNAPSHOT.jar"]
Binary file added target/docker/course-api-0.0.1-SNAPSHOT.jar
Binary file not shown.
Loading

0 comments on commit 7b45da3

Please sign in to comment.