Skip to content

Update to DependencyDownload 2.0.0 and implement cleaning the libraries directory#4242

Merged
AuroraLS3 merged 1 commit into
plan-player-analytics:masterfrom
Vankka:dependencydownload-v2
Aug 23, 2025
Merged

Update to DependencyDownload 2.0.0 and implement cleaning the libraries directory#4242
AuroraLS3 merged 1 commit into
plan-player-analytics:masterfrom
Vankka:dependencydownload-v2

Conversation

@Vankka

@Vankka Vankka commented Aug 23, 2025

Copy link
Copy Markdown
Contributor

Your checklist for this pull request

🚨 Please review the guidelines for contributing to this repository.

  • Make sure your name is added to Contributors file /Plan/common/src/main/java/com/djrapitops/plan/delivery/rendering/html/Contributors.java
  • If PR:ing locale changes also add a LangCode with your name /Plan/common/src/main/java/com/djrapitops/plan/settings/locale/LangCode.java

Description

Updates DependencyDownload 2.0.0 which consists mostly of renames. And adds ApplicationDependencyManager for keeping track of loaded dependencies and then cleaning up old dependencies (in practice: deleting jar files from the libraries directory that aren't included in the ApplicationDependencyManager when cleaning up)

Implements #3438

Comment on lines +200 to +205
try {
applicationDependencyManager.cleanupCacheDirectory();
} catch (IOException e) {
logger.warn("Failed to cleanup dependency cache directory", e);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right now I placed this in disable, as to avoid accidentally cleaning any dependencies that are loaded "late". As ApplicationDependencyManager will only know to keep files for dependencies that are included in it

@AuroraLS3 AuroraLS3 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Awesome, thanks! :)

At one point I was wondering if the new version supports one of the maven repositories going down - e.g. it stops responding or starts responding with 5xx errors? When paper changed their repository URL it killed Plan version 5.4 even though it had two repositories defined, so I'm asking in case that sort of thing happens again in the future

@AuroraLS3
AuroraLS3 merged commit 97216d3 into plan-player-analytics:master Aug 23, 2025
1 check passed
@Vankka

Vankka commented Aug 23, 2025

Copy link
Copy Markdown
Contributor Author

@AuroraLS3 In theory yes if there in a Exception on one of the repositories, it should try the next one (unless it threw a non-Exception throwable, which would be odd).

Do you have a error I could look at? Usually DependencyDownload's errors should have one suppressed exception per repository (if they all fail repositories to download the dependency) if the download fails entirely

@AuroraLS3

Copy link
Copy Markdown
Collaborator

@Vankka I only have been getting these as reports #4224, they are HikariCP thrown error about driver class not being found #4224

SQLite download failure is as cryptic as that one,

[20:31:23 INFO]: [Plan]   ██▌██▌██▌██▌  v5.4 build 1723
[20:31:23 INFO]: [Plan]
[20:31:23 INFO]: [Plan] Locale: 'English' by AuroraLS3
[20:31:23 INFO]: [Plan] Downloading SQLite Driver, this may take a while...
[20:31:24 ERROR]: [Plan] ----------------------------------------
[20:31:24 ERROR]: [Plan] Error: SQLite init failure: org.sqlite.jdbc4.JDBC4Connection
[20:31:24 ERROR]: [Plan] ----------------------------------------
[20:31:24 ERROR]: [Plan] Plugin Failed to Initialize Correctly. If this issue is caused by config settings you can use /plan reload

Likely this message is ClassNotFoundException#getMessage() which would be ClassNotFoundException: org.sqlite.jdbc4.JDBC4Connection

@Vankka

Vankka commented Aug 23, 2025

Copy link
Copy Markdown
Contributor Author

@AuroraLS3 Hmm, yeah seems in 5.4 build 1722 ignored the future from DependencyManager#download so it wasn't logged.

Perhaps the problem was actually resolved by this (since DependencyDownload previously didn't handle trailing slashes in the repository urls), Paper's repository was probably more lenient with double slashes, eg.
https://repo1.maven.org/maven2//dev/vankka/dependencydownload-runtime/maven-metadata.xml (doesn't work)
https://repo1.maven.org/maven2/dev/vankka/dependencydownload-runtime/maven-metadata.xml (works)

@AuroraLS3

Copy link
Copy Markdown
Collaborator

Ah I see, so it was a double whammy 😓 - Thanks for looking at it, that gives confidence that it won't break the same way in the future

VRXDev2 pushed a commit to VRXDev2/Plan that referenced this pull request Jan 5, 2026
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

Successfully merging this pull request may close these issues.

2 participants