如何使用 Flexmojos 设置主题?
使用 flexmojos 进行编译时,我收到警告:
[警告] 该部分或任何 scope="theme" 依赖项中没有明确定义主题。 Flexmojos 现在正在尝试找出要包含哪些主题。 (为了避免此警告,您应该明确说明您的主题依赖项)
[警告]添加spark.css主题,因为spark.swc作为依赖项包含在内
我尝试添加:
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>spark</artifactId>
<type>swc</type>
<scope>theme</scope>
<version>${flex.sdk.version}</version>
</dependency>
但我只是得到错误:
com.adobe.flex.framework:spark:swc 必须是 [编译、运行时、系统] 之一,但是是“主题”
我只想使用标准 Spark 主题。
谢谢
When compiling using flexmojos I get the warning:
[WARNING] No themes are explicitly defined in the section or in any scope="theme" dependencies. Flexmojos is now attempting to figure out which themes to include. (to avoid this warning you should explicitly state your theme dependencies)
[WARNING] Adding spark.css theme because spark.swc was included as a dependency
I have tried adding:
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>spark</artifactId>
<type>swc</type>
<scope>theme</scope>
<version>${flex.sdk.version}</version>
</dependency>
But I just get an error:
com.adobe.flex.framework:spark:swc must be one of [compile, runtime, system] but is 'theme'
I just want to use the standard Spark theme.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我遇到了同样的问题(添加主题有效,但它会产生丑陋的警告)。我通过显式引用主题的 CSS 文件来修复此问题:
将以下内容添加到您的 Flexmojos 配置中:
<前><代码><主题>;
<主题>spark-theme-${flex.sdk.version}.css;
将主题添加为依赖项:
将依赖项拉入输出目录。有多种方法可以做到这一点,包括简单的蚂蚁复制。我选择使用maven依赖插件:
<前><代码><插件>;
org.apache.maven.plugins
maven-dependency-plugin ;
复制主题文件
${project.build.outputDirectory}
spark-theme
<处决>
<执行>
<阶段>流程资源
<目标>
<目标>复制依赖项
<配置>
按照以下步骤将 Spark 主题的 CSS 文件复制到输出目录(大多数情况下为 /target/classes),并在 flexmojos 配置中显式引用 CSS 文件。
这对我来说完全摆脱了所有主题警告。我希望这对某人有帮助。
I had the same issue (adding theme worked but it produces ugly warnings). I fixed it by explicitly referencing the theme's CSS file by:
Add the following to your flexmojos configuration:
Add the theme as a dependency:
pull the dependency in to your output directory. There are several ways to do this, including a simple ant copy. I chose to use the maven dependency plugin:
Following these steps copies the spark-theme's CSS file to the output directory (/target/classes in most cases) and explicitly refers to the CSS file in in the flexmojos configuration.
This completely got rid of all theme warnings for me. I hope this helps someone.
我正在使用 Flex-Mojos 4.1-beta,主题“正常工作”™ 我不能保证早期版本。
举个例子,拉入 Spark 主题(SDK 的一部分):
现在,拉入我之前定义的主题:
然后应用“spark”主题,然后由我定义的规则覆盖我自己的主题swc。没有其他事可做。
使用“插件”->“配置”的“主题”小节会创建无用的空指针异常,例如:
错误输出:
I am using Flex-Mojos 4.1-beta, and themes "just work" ™ I cannot vouch for earlier versions.
Taking an example, pull in the spark theme (part of the SDK):
Now, pull in the theme which I've earlier, myself defined:
And the 'spark' theme is applied, then overridden by the rules I've defined in my own theme swc. Nothing else to do.
Using the 'themes' subsection of 'plugin'->'configuration' creates unhelpful Null Pointer Exceptions, e.g:
Error output:
或者,更简单的这个答案(只需在您的dependencyManagement和中声明它即可pom 的>依赖项 标签
Or, more simple with this answer (just think to declare it in your dependencyManagement and dependencies tags of your pom