Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set default extPlugin path to relative path. #5632

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2ee61d0
set default extPlugin path to relative path.
initialdmg Aug 27, 2024
ad986c8
Merge branch 'master' into fix-ext-plugin-path
Aias00 Aug 30, 2024
d875a8b
Merge branch 'master' into fix-ext-plugin-path
Aias00 Aug 30, 2024
b6da1cb
Merge branch 'master' into fix-ext-plugin-path
Aias00 Aug 31, 2024
70cc777
Merge branch 'master' into fix-ext-plugin-path
Aias00 Aug 31, 2024
1654e78
Merge branch 'master' into fix-ext-plugin-path
Aias00 Sep 2, 2024
bd11e0b
Merge branch 'master' into fix-ext-plugin-path
Aias00 Sep 3, 2024
2449607
Merge branch 'master' into fix-ext-plugin-path
Aias00 Sep 4, 2024
66095d0
Merge branch 'master' into fix-ext-plugin-path
Aias00 Sep 5, 2024
2ccf980
Merge branch 'master' into fix-ext-plugin-path
Aias00 Sep 7, 2024
2d06f9b
Merge branch 'master' into fix-ext-plugin-path
Aias00 Sep 9, 2024
629e3a6
Merge branch 'master' into fix-ext-plugin-path
Aias00 Sep 13, 2024
880957e
Merge branch 'master' into fix-ext-plugin-path
Aias00 Sep 19, 2024
32061c2
Merge branch 'master' into fix-ext-plugin-path
Aias00 Sep 23, 2024
f5d1436
Merge branch 'master' into fix-ext-plugin-path
Aias00 Oct 10, 2024
ea57bb5
Merge branch 'master' into fix-ext-plugin-path
Aias00 Oct 15, 2024
0ca5ace
Merge branch 'master' into fix-ext-plugin-path
Aias00 Oct 16, 2024
02d7d26
Merge branch 'master' into fix-ext-plugin-path
Aias00 Oct 17, 2024
5c68c1b
Merge branch 'master' into fix-ext-plugin-path
Aias00 Oct 23, 2024
490cab9
Merge branch 'master' into fix-ext-plugin-path
Aias00 Oct 24, 2024
80e19fa
Merge branch 'master' into fix-ext-plugin-path
Aias00 Oct 25, 2024
e3cda82
Merge branch 'master' into fix-ext-plugin-path
Aias00 Oct 26, 2024
fcb5776
Merge branch 'master' into fix-ext-plugin-path
yu199195 Oct 26, 2024
a797878
Merge branch 'master' into fix-ext-plugin-path
Aias00 Oct 27, 2024
37216a5
Merge branch 'master' into fix-ext-plugin-path
Aias00 Oct 29, 2024
e3e9029
Merge branch 'master' into fix-ext-plugin-path
Aias00 Oct 29, 2024
4f45e94
Merge branch 'master' into fix-ext-plugin-path
Aias00 Oct 31, 2024
3105042
Merge branch 'master' into fix-ext-plugin-path
Aias00 Nov 3, 2024
a06d195
Merge branch 'master' into fix-ext-plugin-path
Aias00 Nov 4, 2024
e446f07
Merge branch 'master' into fix-ext-plugin-path
Aias00 Nov 4, 2024
625cac6
Merge branch 'master' into fix-ext-plugin-path
Aias00 Nov 5, 2024
2d0de2b
Merge branch 'master' into fix-ext-plugin-path
Aias00 Nov 5, 2024
09d3c91
Merge branch 'master' into fix-ext-plugin-path
Aias00 Nov 5, 2024
4aa1c8f
Merge branch 'master' into fix-ext-plugin-path
Aias00 Nov 6, 2024
51342f8
Merge branch 'master' into fix-ext-plugin-path
Aias00 Nov 6, 2024
a2bc0eb
Merge branch 'master' into fix-ext-plugin-path
Aias00 Nov 7, 2024
a9dcd28
Merge branch 'master' into fix-ext-plugin-path
Aias00 Nov 7, 2024
fe58ad2
Merge branch 'master' into fix-ext-plugin-path
Aias00 Nov 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
@echo off & setlocal enabledelayedexpansion

cd %~dp0
cd ..

set LOG_HOME=%~dp0/../logs
set LOG_HOME=./logs

set SERVER_NAME=ShenYu-Admin

set CLASS_PATH=".;..\conf;..\lib\*;..\ext-lib\*"
set CLASS_PATH=".;.\conf;.\lib\*;.\ext-lib\*"

set JAVA_OPTS=-server -Xmx2g -Xms2g -Xmn1g -Xss256k -XX:+DisableExplicitGC -XX:LargePageSizeInBytes=128m
for /f tokens^=2-5^ delims^=^" %%j in ('java -fullversion 2^>^&1') do set "version=%%j"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
@echo off & setlocal enabledelayedexpansion

cd %~dp0
cd ..

set LOG_HOME=%~dp0/../logs
set LOG_HOME=./logs

set SERVER_NAME=ShenYu-Bootstrap

set CLASS_PATH=".;..\conf;..\lib\*;..\ext-lib\*"
set CLASS_PATH=".;.\conf;.\lib\*;.\ext-lib\*"

set JAVA_OPTS=-server -Xmx4g -Xms4g -Xmn1g -Xss256k -XX:+DisableExplicitGC -XX:LargePageSizeInBytes=128m
for /f tokens^=2-5^ delims^=^" %%j in ('java -fullversion 2^>^&1') do set "version=%%j"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
Expand Down Expand Up @@ -63,6 +64,9 @@ public ShenyuLoaderService(final ShenyuWebHandler webHandler, final CommonPlugin
this.shenyuConfig = shenyuConfig;
ExtPlugin config = shenyuConfig.getExtPlugin();
if (config.getEnabled()) {
File extPluginPathDir = ShenyuPluginPathBuilder.getPluginFile(shenyuConfig.getExtPlugin().getPath());
LOG.info("shenyu extPlugin path: {}", extPluginPathDir.getAbsolutePath());

ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(config.getThreads(), ShenyuThreadFactory.create("plugin-ext-loader", true));
executor.scheduleAtFixedRate(() -> loadExtOrUploadPlugins(null), config.getScheduleDelay(), config.getScheduleTime(), TimeUnit.SECONDS);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public final class ShenyuPluginPathBuilder {

private static final String PLUGIN_PATH = "plugin-ext";

private static final String DEFAULT_EXT_PLUGIN_PATH = "/ext-lib/";
private static final String DEFAULT_EXT_PLUGIN_PATH = "ext-lib/";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't use '/ ' at the beginning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The absolute path of /ext-lib/ is not in the deployment directory. On Linux, it's just pointing to the /ext-lib folder. On Windows it is in the root of the deployment driver. A log point added to confirm this. We can find this in test case too:

* test for plugin-ext.
* -Dplugin-ext=D:\testUrl
*/
@Test
public void testGetPluginPathByPluginExt() {
System.setProperty("plugin-ext", "/testUrl");
File jarFile = ShenyuPluginPathBuilder.getPluginFile("");
assertNotNull(jarFile);


private ShenyuPluginPathBuilder() {
}
Expand Down
Loading