如何在 Maven 中定义一种新的作用域?

发布于 2024-12-12 12:55:06 字数 1114 浏览 0 评论 0原文

为了告诉 Flexmojo Maven 插件您的项目应该使用特定主题,有必要向您的项目添加范围“主题”依赖项,如下所示:

            <dependency>
                    <groupId>com.adobe.flex.framework</groupId>
                    <artifactId>spark</artifactId>
                    <version>4.1.0.16076</version>
                    <type>swc</type>
                    <scope>theme</scope>
            </dependency>

这工作正常,但会产生以下可怕的警告:

[WARNING] Some problems were encountered while building the effective
model for com.mycorp.core:myapp-core-flex-client:swf:1.0.0-SNAPSHOT
[WARNING] 'dependencies.dependency.scope' for
com.adobe.flex.framework:spark:swc must be one of [provided, compile,
runtime, test, system] but is 'theme'. @ line 48, column 11
[WARNING]
[WARNING] It is highly recommended to fix these problems because they
threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer
support building such malformed projects.

有没有办法将新类型的作用域添加到 Maven,以便它接受它为合法的?或者至少摆脱警告?

In order tell the Flexmojo Maven plugin that your project should use a particular theme, it is necessary to add a scope "theme" dependency to your project like this:

            <dependency>
                    <groupId>com.adobe.flex.framework</groupId>
                    <artifactId>spark</artifactId>
                    <version>4.1.0.16076</version>
                    <type>swc</type>
                    <scope>theme</scope>
            </dependency>

This works fine, but produces the following scary looking warning:

[WARNING] Some problems were encountered while building the effective
model for com.mycorp.core:myapp-core-flex-client:swf:1.0.0-SNAPSHOT
[WARNING] 'dependencies.dependency.scope' for
com.adobe.flex.framework:spark:swc must be one of [provided, compile,
runtime, test, system] but is 'theme'. @ line 48, column 11
[WARNING]
[WARNING] It is highly recommended to fix these problems because they
threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer
support building such malformed projects.

Is there a way to add the new type of scope to Maven so it accepts it as legitimate? Or at least get rid of the warning?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

活雷疯 2024-12-19 12:55:06

Maven 中的作用域数量是固定的,请参阅 POM 参考

The number of scopes in Maven is fixed, see the POM reference.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文