Skip to content

Commit

Permalink
springboot迁移
Browse files Browse the repository at this point in the history
  • Loading branch information
datageartech committed Oct 29, 2020
1 parent b4c49ec commit 9a46f26
Show file tree
Hide file tree
Showing 307 changed files with 112 additions and 86 deletions.
3 changes: 0 additions & 3 deletions datagear-analysis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand All @@ -32,7 +31,6 @@
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>${freemarker.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand All @@ -57,7 +55,6 @@
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.4.0</version>
</dependency>
</dependencies>

Expand Down
1 change: 0 additions & 1 deletion datagear-connection/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>${DBCP.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand Down
4 changes: 0 additions & 4 deletions datagear-management/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand All @@ -56,13 +54,11 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
3 changes: 0 additions & 3 deletions datagear-persistence/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,14 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.14</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
13 changes: 13 additions & 0 deletions datagear-web/derby.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
----------------------------------------------------------------
Thu Oct 29 21:20:35 CST 2020:
Booting Derby version The Apache Software Foundation - Apache Derby - 10.14.2.0 - (1828579): instance a816c00e-0175-7484-6424-00000f098960
on database directory F:\Users\zangzf\.datagear\derby with class loader sun.misc.Launcher$AppClassLoader@73d16e93
Loaded from file:/D:/.m2/org/apache/derby/derby/10.14.2.0/derby-10.14.2.0.jar
java.vendor=Oracle Corporation
java.runtime.version=1.8.0_201-b09
user.dir=E:\zzf\workspace-datagear\datagear\datagear-web
os.name=Windows 10
os.arch=amd64
os.version=10.0
derby.system.home=null
Database Class Loader started - derby.database.classpath=''
74 changes: 32 additions & 42 deletions datagear-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

<artifactId>datagear-web</artifactId>
<name>datagear-web</name>
<packaging>war</packaging>

<properties>
<dist.log4j.rootLogger>INFO, A1</dist.log4j.rootLogger>
Expand Down Expand Up @@ -45,76 +46,61 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>${javax.json.version}</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>${javax.json.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${spring.security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring.security.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.5.4</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.12.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>${DBCP.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j-log4j12.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
Expand All @@ -124,17 +110,15 @@
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>${quartz.version}</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>${freemarker.version}</version>
</dependency>
<dependency>
<groupId>org.cometd.java</groupId>
<artifactId>cometd-java-server</artifactId>
<version>2.9.1</version>
<version>4.0.9</version>
</dependency>
</dependencies>

Expand All @@ -144,20 +128,25 @@
<resource>
<directory>src/main/resources</directory>
<includes>
<include>org/datagear/web/datagear-version.properties</include>
<include>datagear-version.properties</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>org/datagear/web/datagear-version.properties</exclude>
<exclude>datagear-version.properties</exclude>
</excludes>
<filtering>false</filtering>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
Expand All @@ -172,7 +161,7 @@
</goals>
<configuration>
<tasks>
<replace file="${project.build.outputDirectory}/org/datagear/web/log4j.properties"
<replace file="${project.build.outputDirectory}/log4j.properties"
token="DEBUG, A0" value="${dist.log4j.rootLogger}" />
</tasks>
</configuration>
Expand Down Expand Up @@ -215,7 +204,8 @@
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<!-- This plugin's configuration is used to store Eclipse m2e settings only.
It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.datagear.web;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DataGearApplication
{
public static void main(String[] args)
{
SpringApplication.run(DataGearApplication.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.datagear.web;

import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

public class DataGearServletInitializer extends SpringBootServletInitializer
{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
{
return application.sources(DataGearApplication.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.io.InputStream;
import java.io.Reader;
import java.text.ParseException;
import java.util.List;

import org.cometd.bayeux.server.ServerMessage.Mutable;
import org.cometd.common.JSONContext;
Expand Down Expand Up @@ -125,7 +126,7 @@ public String generate(Mutable message)
}

@Override
public String generate(Mutable[] messages)
public String generate(List<Mutable> messages)
{
return toJsonString(messages);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ResourceBundleMessageSource;
import org.springframework.core.env.Environment;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.format.support.FormattingConversionServiceFactoryBean;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.scheduling.quartz.CronTriggerFactoryBean;
Expand Down Expand Up @@ -259,7 +259,7 @@ protected File createDirectory(String directoryName, boolean createIfInexistence
{
bean.init();
}
catch(IOException e)
catch (IOException e)
{
throw new BeanInitializationException("Init directory [" + directoryName + "] failed", e);
}
Expand All @@ -284,16 +284,17 @@ public PlatformTransactionManager transactionManager()
@Bean
public SqlSessionFactory sqlSessionFactory()
{
SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
bean.setDataSource(this.dataSourceConfiguration.dataSource());
bean.setMapperLocations(
new Resource[] { new ClassPathResource("classpath*:org/datagear/management/mapper/*.xml") });

try
{
PathMatchingResourcePatternResolver pathResolver = new PathMatchingResourcePatternResolver();
Resource[] mapperResources = pathResolver.getResources("classpath*:org/datagear/management/mapper/*.xml");

SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
bean.setDataSource(this.dataSourceConfiguration.dataSource());
bean.setMapperLocations(mapperResources);
return bean.getObject();
}
catch(Exception e)
catch (Exception e)
{
throw new BeanInitializationException("Init " + SqlSessionFactory.class + " failed", e);
}
Expand Down Expand Up @@ -420,9 +421,8 @@ public RoleUserService roleUserService()
@Bean
public DataSetEntityService dataSetEntityService()
{
DataSetEntityServiceImpl bean = new DataSetEntityServiceImpl(this.sqlSessionFactory(),
this.connectionSource(), this.schemaService(), this.authorizationService(), this.dataSetRootDirectory(),
this.httpClient());
DataSetEntityServiceImpl bean = new DataSetEntityServiceImpl(this.sqlSessionFactory(), this.connectionSource(),
this.schemaService(), this.authorizationService(), this.dataSetRootDirectory(), this.httpClient());
return bean;
}

Expand Down Expand Up @@ -452,9 +452,8 @@ public DirectoryHtmlChartPluginManagerInitializer directoryHtmlChartPluginManage
@Bean
public HtmlChartWidgetEntityService htmlChartWidgetEntityService()
{
HtmlChartWidgetEntityServiceImpl bean = new HtmlChartWidgetEntityServiceImpl(
this.sqlSessionFactory(), this.directoryHtmlChartPluginManager(),
this.dataSetEntityService(), this.authorizationService());
HtmlChartWidgetEntityServiceImpl bean = new HtmlChartWidgetEntityServiceImpl(this.sqlSessionFactory(),
this.directoryHtmlChartPluginManager(), this.dataSetEntityService(), this.authorizationService());

return bean;
}
Expand Down Expand Up @@ -568,8 +567,7 @@ protected TemplateImportHtmlChartPluginVarNameResolver buildHtmlTplDashboardWidg
public HtmlTplDashboardWidgetEntityService htmlTplDashboardWidgetEntityService()
{
HtmlTplDashboardWidgetEntityServiceImpl bean = new HtmlTplDashboardWidgetEntityServiceImpl(
this.sqlSessionFactory(), this.htmlTplDashboardWidgetRenderer(),
this.authorizationService());
this.sqlSessionFactory(), this.htmlTplDashboardWidgetRenderer(), this.authorizationService());

return bean;
}
Expand Down
Loading

0 comments on commit 9a46f26

Please sign in to comment.