How to customize a theme using Flexmojos?

When compiling using flexmojos, I get a warning:

[WARNING] In a section or in any scope = "theme" dependencies, themes are not explicitly defined. Flexmojos is now trying to figure out which topics to include. (to avoid this warning, you must explicitly state your theme dependencies)

[WARNING] Adding a spark.css theme since spark.swc was included as a dependency

I tried to add:

<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 the error message:

com.adobe.flex.framework: spark: swc must be one of [compilation, runtime, system], but it is a "theme"

I just want to use the standard Spark theme.

thanks

+7
source share
3 answers

I had the same problem (theme added, but it causes ugly warnings). I fixed it by explicitly referencing the theme CSS file:

  • Add the following flexmojos configuration:

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

     <dependency> <groupId>com.adobe.flex.framework</groupId> <artifactId>spark-theme</artifactId> <version>${flex.sdk.version}</version> <type>css</type> </dependency> 
  • pull the dependency into your output directory. There are several ways to do this, including a simple copy of ant. I decided 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> 

After these steps, it copies the spark theme CSS file to the output directory (/ target / classes in most cases) and explicitly refers to the CSS file in the flexmojos configuration.

This completely saved me all the topic warnings for me. Hope this helps someone.

+2
source

I use Flex-Mojos 4.1 beta, and "just work" โ„ข themes I cannot vouch for earlier versions.

Taking an example, draw 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 the topic that I previously defined myself:

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

And the theme "spark" is applied, then redefined by the rules that I defined in my own theme swc. Do nothing else.

Using the subsection 'themes' 'plugin' โ†’ 'configuration' creates useless Null Pointer exceptions, for example:

  <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] 
0
source

Or, simpler with this answer (just think to declare it in your dependencies and tag dependencies of your pom

0
source

All Articles