How to define a new kind of scope in Maven?

点点圈 提交于 2019-12-11 16:15:57

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/7918709/how-to-define-a-new-kind-of-scope-in-maven

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!