Commit 8c7e404f authored by 张永's avatar 张永

能运行的

parent bc68ed65
...@@ -11,110 +11,26 @@ ...@@ -11,110 +11,26 @@
<start-class>com.egolm.shop.ShopApplication</start-class> <start-class>com.egolm.shop.ShopApplication</start-class>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.build.timestamp>${maven.build.timestamp}</maven.build.timestamp>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
</properties> </properties>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.0.RELEASE</version> <version>2.1.0.RELEASE</version>
<relativePath />
</parent> </parent>
<distributionManagement>
<repository>
<id>user-releases</id>
<name>User Porject Snapshot</name>
<url>http://123.157.244.130:9003/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>user-snapshot</id>
<name>User Porject Snapshot</name>
<url>http://123.157.244.130:9003/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>my</id>
<name>my</name>
<url>http://123.157.244.130:9003/nexus/content/groups/public/</url>
</repository>
<repository>
<id>repo1</id>
<name>repo1</name>
<url>https://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>mvnrepository</id>
<name>mvnrepository</name>
<url>https://mvnrepository.com/</url>
</repository>
<repository>
<id>bintray-qcloud-maven-repo</id>
<name>qcloud-maven-repo</name>
<url>https://dl.bintray.com/qcloud/maven-repo/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<dependencies> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<!-- start 改为jetty 处理tomcat版本的 The valid characters are defined in RFC
7230 and RFC 3986 异常 -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
<!-- end 改为 jetty -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId> <artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.security</groupId> <groupId>org.springframework.security</groupId>
...@@ -129,26 +45,19 @@ ...@@ -129,26 +45,19 @@
<artifactId>druid-spring-boot-starter</artifactId> <artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.20</version> <version>1.1.20</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.microsoft.sqlserver</groupId> <groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId> <artifactId>mssql-jdbc</artifactId>
<version>9.4.0.jre8</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.alibaba</groupId> <groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
<version>2.0.10</version> <version>1.2.70</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.egolm</groupId> <groupId>com.egolm</groupId>
<artifactId>common</artifactId> <artifactId>common</artifactId>
<version>0.0.1-RELEASE</version> <version>0.0.1-RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>
...@@ -179,7 +88,11 @@ ...@@ -179,7 +88,11 @@
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId> <artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version> <version>2.9.2</version>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.apache.solr</groupId> <groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId> <artifactId>solr-solrj</artifactId>
...@@ -219,12 +132,12 @@ ...@@ -219,12 +132,12 @@
<dependency> <dependency>
<groupId>com.tencent.cloud</groupId> <groupId>com.tencent.cloud</groupId>
<artifactId>cos-sts-java</artifactId> <artifactId>cos-sts-java</artifactId>
<version>3.0.8</version> <version>3.0.4</version>
</dependency> </dependency>
<!-- 腾讯云 end --> <!-- 腾讯云 end -->
<!-- Aliyun LOG Producer start --> <!-- Aliyun LOG Producer start -->
<!-- <dependency> <!-- <dependency>
<groupId>com.aliyun.openservices</groupId> <groupId>com.aliyun.openservices</groupId>
<artifactId>aliyun-log-producer</artifactId> <artifactId>aliyun-log-producer</artifactId>
<version>0.3.0</version> <version>0.3.0</version>
...@@ -241,7 +154,7 @@ ...@@ -241,7 +154,7 @@
</dependency> --> </dependency> -->
<!-- Aliyun LOG Producer end --> <!-- Aliyun LOG Producer end -->
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
...@@ -285,4 +198,34 @@ ...@@ -285,4 +198,34 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<repositories>
<repository>
<id>my</id>
<name>my</name>
<url>http://123.157.244.130:9003/nexus/content/groups/public/</url>
</repository>
<repository>
<id>repo1</id>
<name>repo1</name>
<url>http://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>mvnrepository</id>
<name>mvnrepository</name>
<url>http://mvnrepository.com/</url>
</repository>
<repository>
<id>bintray-qcloud-maven-repo</id>
<name>qcloud-maven-repo</name>
<url>https://dl.bintray.com/qcloud/maven-repo/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project> </project>
\ No newline at end of file
...@@ -6,14 +6,13 @@ import org.slf4j.Logger; ...@@ -6,14 +6,13 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import springfox.documentation.swagger2.annotations.EnableSwagger2; import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EnableAsync(proxyTargetClass=true) @EnableAsync(proxyTargetClass=true)
...@@ -24,6 +23,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; ...@@ -24,6 +23,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EnableTransactionManagement @EnableTransactionManagement
public class ShopApplication { public class ShopApplication {
private static Logger logger = LoggerFactory.getLogger(ShopApplication.class); private static Logger logger = LoggerFactory.getLogger(ShopApplication.class);
private static ApplicationContext applicationContext; private static ApplicationContext applicationContext;
public static void main(String[] args) { public static void main(String[] args) {
...@@ -34,11 +34,11 @@ public class ShopApplication { ...@@ -34,11 +34,11 @@ public class ShopApplication {
System.setProperty("java.io.tmpdir", "/data/temp"); //容器内使用这种 System.setProperty("java.io.tmpdir", "/data/temp"); //容器内使用这种
}finally { }finally {
TimeZone.setDefault(TimeZone.getTimeZone("GMT+8")); TimeZone.setDefault(TimeZone.getTimeZone("GMT+8"));
applicationContext = SpringApplication.run(ApplicationContext.class, args); applicationContext = SpringApplication.run(ShopApplication.class, args);
} }
} }
public static ApplicationContext getApplicationContext() { public static ApplicationContext getApplicationContext() {
return applicationContext; return applicationContext;
} }
...@@ -50,8 +50,9 @@ public class ShopApplication { ...@@ -50,8 +50,9 @@ public class ShopApplication {
public static <T> T getBean(Class<T> clazz){ public static <T> T getBean(Class<T> clazz){
return getApplicationContext().getBean(clazz); return getApplicationContext().getBean(clazz);
} }
public static <T> T getBean(String name, Class<T> clazz){ public static <T> T getBean(String name, Class<T> clazz){
return getApplicationContext().getBean(name, clazz); return getApplicationContext().getBean(name, clazz);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment