sofastack / sofa-ark

SOFAArk is a light-weight,java based classloader isolation framework.
https://www.sofastack.tech/projects/sofa-boot/sofa-ark-readme/
Apache License 2.0
1.57k stars 500 forks source link

关于conf\ark\bootstrap.properties的格式问题 #238

Closed johnyannj closed 5 years ago

johnyannj commented 5 years ago

Your question

我尝试\sofa-ark-samples\sample-springboot-ark这个例子。 我打包后得到一个可执行jar包 sofa-ark-sample-springboot-ark-0.6.0-executable-ark.jar 我发现在这个包里conf\ark\bootstrap.properties 这个entry并没有像其他目录文件一样的路径:

conf/
conf/ark/
conf/ark/bootstrap.properties

而是仅仅有一个conf\ark\bootstrap.properties: 如下:

META-INF/
META-INF/MANIFEST.MF
conf\ark\bootstrap.properties
com/
com/alipay/
com/alipay/sofa/
com/alipay/sofa/ark/
com/alipay/sofa/ark/common/
com/alipay/sofa/ark/common/util/
com/alipay/sofa/ark/common/util/StringUtils.class
com/alipay/sofa/ark/common/util/AssertUtils.class

在调试到 com.alipay.sofa.ark.loader.ExecutableArkBizJar#getConfClasspath 的时候,发现它并未发现conf目录

public final static String CONF_BASE_DIR                              = "conf/";
....
    @Override
    public List<URL> getConfClasspath() throws Exception {
        List<Archive> archives = getNestedArchives(new EntryFilter() {
            @Override
            public boolean matches(Entry entry) {
                return entry.getName().startsWith(CONF_BASE_DIR) && entry.isDirectory();
            }
        });
        List<URL> urls = new ArrayList<>();
        for (Archive archive : archives) {
            urls.add(archive.getUrl());
        }
        return urls;
    }
}
QilongZhang commented 5 years ago

image

mac 上是可以的,你的是 windows 环境吗?

QilongZhang commented 5 years ago

和 #228 是类似的问题,可以先升级到 1.0.0-SNAPSHOT 版本。

johnyannj commented 5 years ago

@QilongZhang 是windows环境下打的包。 谢谢回复。