如何在 Maven 中定义一种新的作用域?
为了告诉 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Maven 中的作用域数量是固定的,请参阅 POM 参考。
The number of scopes in Maven is fixed, see the POM reference.