7

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

chris
  • 1,731
  • 4
  • 26
  • 33
  • [WARNING] Adding spark.css theme because spark.swc was included as a dependency - it's said, that spark theme will be used. Isn't it used? [About scopes](http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope) – Timofei Davydik Oct 05 '11 at 20:07
  • Indeed it does, and it is. However, I want to get rid of all unnecessary build warnings so that any real warnings are more obvious – chris Oct 06 '11 at 09:17

3 Answers3

2

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.

gMale
  • 17,147
  • 17
  • 91
  • 116
0

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

Community
  • 1
  • 1
LE GALL Benoît
  • 7,159
  • 1
  • 36
  • 48
0

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]
Bryan Hunt
  • 3,685
  • 2
  • 24
  • 36
  • Unfortunately, that fix generates more build warnings. – Naftuli Kay Jan 03 '13 at 21:24
  • I gave up using flex-mojo's about 8 months ago, they added very little to my product stability, and cost me an awful lot of time. My advice for developing Flex applications is now. 1) Use Intellij 2) Don't waste time on flex-mojos 3) Check the binary libs into git (or whatever you use) – Bryan Hunt Jan 04 '13 at 15:49