如何在Maven中定义一种新的作用域? [英] How to define a new kind of scope in Maven?

查看:152
本文介绍了如何在Maven中定义一种新的作用域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了告诉Flexmojo 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.

是否有一种方法可以将新类型的作用域添加到Maven,使其接受为合法?还是至少摆脱了警告?

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?

推荐答案

Maven中的作用域数量是固定的,

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

这篇关于如何在Maven中定义一种新的作用域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆