如何使用 Flexmojos 设置主题?

发布于 2024-12-07 23:34:30 字数 646 浏览 5 评论 0原文

使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

宁愿没拥抱 2024-12-14 23:34:31

我遇到了同样的问题(添加主题有效,但它会产生丑陋的警告)。我通过显式引用主题的 CSS 文件来修复此问题:

  1. 将以下内容添加到您的 Flexmojos 配置中:

    <前><代码><主题>;
    <主题>spark-theme-${flex.sdk.version}.css;

  2. 将主题添加为依赖项:

    <依赖>;
        com.adobe.flex.framework;
        spark-theme;
        <版本>${flex.sdk.version}
        <类型>CSS
    
    
  3. 将依赖项拉入输出目录。有多种方法可以做到这一点,包括简单的蚂蚁复制。我选择使用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:

  1. Add the following to your flexmojos configuration:

    <themes>
        <theme>spark-theme-${flex.sdk.version}.css</theme>
    </themes>
    
  2. Add the theme as a dependency:

    <dependency>
        <groupId>com.adobe.flex.framework</groupId>
        <artifactId>spark-theme</artifactId>
        <version>${flex.sdk.version}</version>
        <type>css</type>
    </dependency>
    
  3. 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:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
            <execution>
                <id>copy-theme-file</id>
                <phase>process-resources</phase>
                <goals>
                    <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                    <outputDirectory>${project.build.outputDirectory}</outputDirectory>
                    <includeArtifactIds>spark-theme</includeArtifactIds>
                </configuration>
            </execution>
        </executions>
    </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.

胡大本事 2024-12-14 23:34:31

我正在使用 Flex-Mojos 4.1-beta,主题“正常工作”™ 我不能保证早期版本。

举个例子,拉入 Spark 主题(SDK 的一部分):

   <dependency>
        <groupId>com.adobe.flex.framework</groupId>
        <artifactId>spark</artifactId>
        <version>${flex.version}</version>
        <scope>theme</scope>
        <type>swc</type>
    </dependency>

现在,拉入我之前定义的主题:

    <dependency>
        <groupId>ie.hunt</groupId>
        <artifactId>theme-library</artifactId>
        <version>1.0-SNAPSHOT</version>
        <type>swc</type>
        <scope>theme</scope>
    </dependency>

然后应用“spark”主题,然后由我定义的规则覆盖我自己的主题swc。没有其他事可做。

使用“插件”->“配置”的“主题”小节会创建无用的空指针异常,例如:

 <configuration>
 <themes>
  <theme>spark.css</theme>
 <themes>
 ...
 </configuration>

错误输出:

 [ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:4.1-beta:compile-swc (default-compile-swc) on project theme-library: java.lang.NullPointerException -> [Help 1]

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):

   <dependency>
        <groupId>com.adobe.flex.framework</groupId>
        <artifactId>spark</artifactId>
        <version>${flex.version}</version>
        <scope>theme</scope>
        <type>swc</type>
    </dependency>

Now, pull in the theme which I've earlier, myself defined:

    <dependency>
        <groupId>ie.hunt</groupId>
        <artifactId>theme-library</artifactId>
        <version>1.0-SNAPSHOT</version>
        <type>swc</type>
        <scope>theme</scope>
    </dependency>

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:

 <configuration>
 <themes>
  <theme>spark.css</theme>
 <themes>
 ...
 </configuration>

Error output:

 [ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:4.1-beta:compile-swc (default-compile-swc) on project theme-library: java.lang.NullPointerException -> [Help 1]
厌味 2024-12-14 23:34:31

或者,更简单的这个答案(只需在您的dependencyManagement中声明它即可pom 的>依赖项 标签

Or, more simple with this answer (just think to declare it in your dependencyManagement and dependencies tags of your pom

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文