我分析了我们的应用程序性能,发现我们打包Spring启动应用程序的方式存在问题(我们只是做--# sqlite3 --version
-- 3.13.0 ....
DROP TABLE IF EXISTS try;
CREATE TABLE try(
-- 'abc' should be null, when 'def' and 'xyz' are not null.
-- 'abc' should be not be null, when 'def' and 'xyz' are null.
-- 'def' and 'xyz' should be null, when 'abc' is not null.
-- 'def' and 'xyz' should be not be null, when 'abc' is null.
abc TEXT,
def TEXT,
xyz TEXT,
CONSTRAINT combo_1 UNIQUE(abc),
CONSTRAINT combo_2 UNIQUE(def, xyz)
);
INSERT into try(abc) VALUES("a1"); -- should succeed
INSERT into try(def, xyz) VALUES("d2", "x2"); -- should succeed
--
INSERT into try(abc) VALUES(null); -- should not be allowed
INSERT into try(abc, def) VALUES("a4", "d4"); -- should not be allowed
INSERT into try(abc, xyz) VALUES("a5", "x5"); -- should not be allowed
INSERT into try(abc, def, xyz) VALUES("a6", "d6", "x6"); -- should not be allowed
--
INSERT into try(def) VALUES(null); -- should not be allowed
INSERT into try(def) VALUES("d8"); -- should not be allowed
--
INSERT into try(xyz) VALUES(null); -- should not be allowed
INSERT into try(xyz) VALUES("x10"); -- should not be allowed
--
INSERT into try(def, xyz) VALUES(null, null); -- should not be allowed
INSERT into try(def, xyz) VALUES("d12", null); -- should not be allowed
INSERT into try(def, xyz) VALUES(null, "x13"); -- should not be allowed
INSERT into try(abc, def, xyz) VALUES(null, null, null); -- should not be allowed
.headers ON
select rowid,* from try;
.echo on
--
-- Only these 2 rows should be present:
-- 1|a1||
-- 2||d2|x2
--
)。
Sun WS实现认为从类路径中读取内容很便宜(他们不进行任何缓存!)和应用程序花费大量时间搜索和读取 zip中的资源的问题zip 档案。问题示例是spring-boot-starter-ws performance when run as jar
如何在不使用 jar in jar 的情况下打包Spring Boot应用程序?如何使用容器内的WAR文件制作扁平罐子或如何解压胖罐?
更新有一个选项gradle bootRepackage
,但需要提供依赖关系列表... https://docs.spring.io/spring-boot/docs/current/reference/html/build-tool-plugins-gradle-plugin.html