<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[如何在载入插件之前加载第三方依赖]]></title><description><![CDATA[<p dir="auto"><strong>打个比方</strong>，我要用 scala 开发插件<br />
那么运行时肯定得有 scala 运行库 —— 否则会报错</p>
<p dir="auto">很简单的方法就是给插件打包的时候带上 scala 运行库<br />
但是这样会导致 jar 体积过大（（（</p>
<p dir="auto">我看到 mirai 主目录下有一个 <code>libs</code> 文件夹里面都是 mirai 的库，而且貌似可以通过 <code>confing.json</code> 那个配置来修改<br />
我在想能不能通过这个让他自动下载依赖然后就不需要打包插件的时候带上完整的运行库了</p>
<p dir="auto">不过自己改了发现貌似 8 太行<br />
<img src="https://img1.imgtp.com/2022/02/04/QDOGhFWO.png" alt="1643942125405.png" class=" img-responsive img-markdown" /></p>
<p dir="auto">完整日志及 <code>config.json</code> 见 <a href="https://pastebin.com/ty3W80JT" target="_blank" rel="noopener noreferrer nofollow ugc">pastebin</a></p>
]]></description><link>https://mirai.mamoe.net/topic/967/如何在载入插件之前加载第三方依赖</link><generator>RSS for Node</generator><lastBuildDate>Thu, 12 Mar 2026 19:51:34 GMT</lastBuildDate><atom:link href="https://mirai.mamoe.net/topic/967.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 04 Feb 2022 02:39:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 如何在载入插件之前加载第三方依赖 on Fri, 04 Feb 2022 06:44:29 GMT]]></title><description><![CDATA[<p dir="auto">config.json直接写依赖，mcl会尝试去从 mirai-repo 获取版本信息，然而你的库在 mirai-repo 不存在，目前可用方法是直接把你的依赖直接扔进 plugins, 更好的依赖解决模式目前还未完成，见 <a href="https://github.com/mamoe/mirai/pull/1842" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/mamoe/mirai/pull/1842</a></p>
<div class="row github-embeds-container">
    
    
        <div class="col-md-6">
            <div class="github-embed panel panel-default">
                <div class="panel-body">
                    <div class="meta">
                        <img class="author-picture not-responsive" src="https://avatars.githubusercontent.com/u/30070303?v=4" title="Karlatemp" />
                        <a href="https://github.com/Karlatemp"><span class="username">Karlatemp</span></a> created this issue <span class="timeago" title="2022-01-20T14:24:11Z"></span> in <a href="//github.com/mamoe/mirai">mamoe/mirai</a>
                    </div>
                    <h3>
                        <span class="label label-default closed pull-right">closed</span>
                        <a href="https://github.com/mamoe/mirai/pull/1842">Redesign console plugin loading system</a>
                        <span class="number">#1842</span>
                    </h3>
                </div>
            </div>
        </div>
    
    
    
</div>]]></description><link>https://mirai.mamoe.net/post/8334</link><guid isPermaLink="true">https://mirai.mamoe.net/post/8334</guid><dc:creator><![CDATA[Karlatemp]]></dc:creator><pubDate>Fri, 04 Feb 2022 06:44:29 GMT</pubDate></item><item><title><![CDATA[Reply to 如何在载入插件之前加载第三方依赖 on Fri, 04 Feb 2022 05:01:36 GMT]]></title><description><![CDATA[<p dir="auto">scala 开发插件还是第一次见（</p>
]]></description><link>https://mirai.mamoe.net/post/8331</link><guid isPermaLink="true">https://mirai.mamoe.net/post/8331</guid><dc:creator><![CDATA[tsudzuki]]></dc:creator><pubDate>Fri, 04 Feb 2022 05:01:36 GMT</pubDate></item></channel></rss>