maven生成的war文件不包含scala库

发布于 2025-01-07 19:56:11 字数 494 浏览 2 评论 0原文

我创建了一个 Maven 项目,其中包含使用 Scala 编写的 JAX-RS Web 服务。但是,我发现生成的war文件不包含任何scala库。

我将其部署到Jboss并运行后,错误显示找不到Scala库。

我假设 maven 会自动将任何相关库打包到 WEB-INF\lib 但 scala 不是这样。

为了打包 scala 库,我需要添加任何特定配置吗?

或者我应该将 scala 放置到 JBoss AS 本地的任何地方吗?

非常感谢!

更新:

我实际上已经找到了为什么 scala 库没有包含在战争中。这是因为我为 scala 依赖项定义了“提供”范围。

但是,如果我在战争中包含 scala,则部署将失败并出现非法参数异常。

我记得我曾经配置 jboss 以使用 scala 库的本地副本,但我忘记了如何执行此操作。

有人对此有任何想法吗?

非常感谢

I have got a maven project created which contains a JAX-RS web service written using Scala. However, I found that the war file generated does not contain any scala libraries.

After I deployed it to Jboss and run, errors show that Scala libraries could not be found.

I assume maven will automatically pack any relevant libraries to WEB-INF\lib but scala is not the case.

Is there any specific configurations I need to add in order for the scala library to be packed?

Or shall I place scala to anywhere local to the JBoss AS?

Many thanks!

Update:

I actually have found out why the scala libraries are not included in the war. It was because I defined a "provided" scope for the scala dependency.

However, if I include scala in the war, the deployment will fail with an illegal argument exception.

I brief remember I used to config jboss to use local copy of scala library, but I forgot how to do this.

Does anyone have any idea about this?

Many thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文