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

Relocating packages is also changing properties #917

Open
sorin-florea opened this issue Apr 23, 2024 · 2 comments
Open

Relocating packages is also changing properties #917

sorin-florea opened this issue Apr 23, 2024 · 2 comments

Comments

@sorin-florea
Copy link

Shadow Version

8.1.1

Gradle Version

8.8

Actual Behavior

I am trying to shadow oshi and relocate it, for example to com.relocated. The root package of oshi is oshi, which is also used in property names (e.g. oshi.util.proc.path)

https://github.com/ektaarora3501/oshi/blob/b9ccae3c9072996e6a07286c19503c9e5dc44199/oshi-core/src/main/java/oshi/util/platform/linux/ProcUtil.java#L45

String str = GlobalConfig.get("oshi.util.proc.path", "/proc");

will be rewritten to

String str = GlobalConfig.get("com.relocated.oshi.util.proc.path", "/proc");

Expected Behavior

The above code is wrong since the names of properties in property files will not be changed.

@vyazelenko
Copy link
Contributor

I was just hit by the same issue.

vyazelenko added a commit to real-logic/aeron that referenced this issue May 15, 2024
@virustotalop
Copy link

virustotalop commented May 22, 2024

You can try using a workaround like this https://github.com/Bastian/bstats-metrics/blob/master/base/src/main/java/org/bstats/MetricsBase.java#L241-L248 if you fork or otherwise control the code. Doesn't look like this will work for op's use-case but may work for others. I've had success using it in the past as seen here https://github.com/ClubObsidian/DynamicGui/blob/a9775fddbde9ef4620143fbb793003656d5a4ae8/bukkit/src/main/java/com/clubobsidian/dynamicgui/bukkit/entity/BukkitPlayerWrapper.java#L200-L204

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants