如何在Maven中定义一种新的范围?

时间:2011-10-27 15:54:12

标签: maven flex4 maven-plugin maven-3 flex-mojos

为了告诉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,以便它接受它是合法的?或者至少摆脱警告?

1 个答案:

答案 0 :(得分:1)

Maven中的范围数量是固定的,see the POM reference