Hi Filip,

where is the css file located? If you are referencing it without a "/" at the 
beginning, it's expected to be in the same package ad the class referencing it.

Another thing that might be interesting: While in a html application a css file 
is a static resource, in flex it is usually compiled to ActionScript. So it 
needs to be added to the source-path and not the resource-path (At least I have 
the css files in my "src/main/flex" directory.

But judging from your last post on the other Thread (To start the weekend), I 
would assume you have the file in the correct directory, but you have added the 
source dir to the resources. So the flex compiler is currently expecting your 
flex code in "src/main/java" and treats everything else as static resource. 

If you need multiple source paths I would again recommend to have a look at the 
build-helper-plugin and to set the source path to "src/main/flex" and use the 
plugin to add the second directory.

Chris



________________________________________
Von: L'Hommelet Filip <Filip.L'[email protected]>
Gesendet: Dienstag, 26. Mai 2015 13:34
An: [email protected]
Betreff: Flexmojos7.1 / Flash SDK 4.14 / external CSS

How does flexmojos handle external CSS files?

Let me explain:

I have 2 projects:
One has my main app, the other is a library (which also contains a css file).

When with flexmojos3.8 and SDK 4.1, the whole pom setup worked and I could 
build my main app project with no issues at all.
Now however I get following error:

D:\I3G\git-workspaces\flex\wp-nato-47\FlexAppealApp\src\main\flex\FlexAppealApp.mxml(28):
 Error: Problem finding external stylesheet: buildingblocks2.css

    <fx:Style source="buildingblocks2.css"/>


The weird thing is, I didn't change anything to my poms.  So I guess something 
must have changed between flexmojos 3.8 and 7.1 in the way
that projects are coupled.

The poms:

"main app":

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
                <modelVersion>4.0.0</modelVersion>
                <parent>
                               <groupId>com.ilias.i3g.flex.pom</groupId>
                               <artifactId>flex</artifactId>
                               <version>FlexSDK4.X-SNAPSHOT</version>
                </parent>
                <groupId>com.ilias.i3g.flex.applications</groupId>
                <artifactId>FlexAppealApp</artifactId>
                <version>${FlexAppealApp.version}</version>
                <name>${project.groupId}.${project.artifactId}</name>
                <packaging>swf</packaging>
                <dependencies>
                               <!--
                                                               Flex Framework 
libraries overrules
                                 -->
                               <dependency>
                                               <optional>true</optional>
                                               
<groupId>org.apache.flex.framework.themes</groupId>
                                               <artifactId>spark</artifactId>
                                               
<version>${flex.version}</version>
                                               <type>swc</type>
                                               <scope>theme</scope>
                               </dependency>

                               <!--
                                                               Flex Appeal 
Framework Libraries : runtime shared libraries (in the
                                                               future) (change 
<scope>internal</scope> to <scope>rsl</scope>) NOTE:
                                                               The order of the 
rsl libraries is important!
                                 -->
                               <!-- 1. FlexAppeal3rdPartyLib -->
                               <dependency>
                                               
<groupId>com.ilias.i3g.flex.framework</groupId>
                                               
<artifactId>FlexAppeal3rdPartyLib</artifactId>
                                               <type>swc</type>
                                               <scope>rsl</scope>
                               </dependency>
                               <!-- 2. FlexAppealFrameworkLib -->
                               <dependency>
                                               
<groupId>com.ilias.i3g.flex.framework</groupId>
                                               
<artifactId>FlexAppealFrameworkSharedLib</artifactId>
                                               <type>swc</type>
                                               <scope>rsl</scope>
                               </dependency>
                               <dependency>
                                               
<groupId>com.ilias.i3g.flex.framework</groupId>
                                               
<artifactId>BuildingBlocks_1</artifactId>
                                               <type>swc</type>
                                               <scope>rsl</scope>
                               </dependency>
                               <dependency>
                                               
<groupId>com.ilias.i3g.flex.framework</groupId>
                                               
<artifactId>BuildingBlocks_2</artifactId>
                                               <type>swc</type>
                                               <scope>rsl</scope>
                               </dependency>
                               <dependency>
                                               
<groupId>com.ilias.i3g.flex.framework</groupId>
                                               
<artifactId>FlexAppealFrameworkLib</artifactId>
                                               <type>swc</type>
                                               <scope>rsl</scope>
                               </dependency>
                               <!--
                                                               3. The 
CoreFacade interfaces must be loaded first, because they are
                                                               referenced in 
the bootstraps of the domains
                                 -->
                               <dependency>
                                               
<groupId>com.ilias.i3g.flex.facades</groupId>
                                               
<artifactId>JobControlMgmtCoreFacadeLib</artifactId>
                                               <type>swc</type>
                                               <scope>rsl</scope>
                               </dependency>
                               <!-- 4. -->
                               <dependency>
                                               
<groupId>com.ilias.i3g.flex.facades</groupId>
                                               
<artifactId>ITServiceDeskCoreFacadeLib</artifactId>
                                               <type>swc</type>
                                               <scope>rsl</scope>
                               </dependency>
                               <!-- 5. -->
                               <dependency>
                                               
<groupId>com.ilias.i3g.flex.facades</groupId>
                                               
<artifactId>ParameterSetsAPILib</artifactId>
                                               <type>swc</type>
                                               <scope>rsl</scope>
                               </dependency>
                               <!-- 6. -->
                               <dependency>
                                               
<groupId>com.ilias.i3g.flex.facades</groupId>
                                               
<artifactId>Ilias2GAPILib</artifactId>
                                               <type>swc</type>
                                               <scope>rsl</scope>
                               </dependency>
                               <!-- 7. -->
                               <dependency>
                                               
<groupId>com.ilias.i3g.flex.modules</groupId>
                                               
<artifactId>WidgetsLib</artifactId>
                                               <type>swc</type>
                                               <scope>rsl</scope>
                               </dependency>

                               <!-- axiis -->
                               <dependency>
                                               <groupId>com.axiis</groupId>
                                               
<artifactId>degrafaFlex4</artifactId>
                                               <version>1.0</version>
                                               <type>swc</type>
                                               <scope>rsl</scope>
                               </dependency>
                               <dependency>
                                               
<groupId>com.ilias.i3g.flex.framework</groupId>
                                               <artifactId>axiis</artifactId>
                                               
<version>${Axiis.trunk.version}</version>
                                               <scope>rsl</scope>
                                               <type>swc</type>
                               </dependency>


                               <!-- need to be here to let the 
copy-resources.xml Ant script work in the Module projects.
                                 This script uses the profile 
copy-theme-dependency which can be found in our parent.-->
                               <dependency>
                                               
<groupId>com.ilias.i3g.flex.applications</groupId>
                                               
<artifactId>FlexAppealTheme</artifactId>
      <version>${FlexAppealTheme.trunk.version}</version>
                                               <type>swf</type>
                                               <scope>external</scope>
                               </dependency>

                               <!-- Defined here so they will be present in the 
FlexAppealWebFlex WAR
                                 See FlexAppealWeb/pom.xml -->
<!--                        <dependency>
                                               
<groupId>org.apache.flex</groupId>
                                               
<artifactId>framework</artifactId>
                                               
<version>${flex.version}</version>
                                               <type>swz</type>
                               </dependency> -->
                </dependencies>
                <build>
                               <resources>
            <resource>
                <directory>src/main/flex</directory>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
                               <plugins>
                                               <plugin>
                                                               
<groupId>net.flexmojos.oss</groupId>
                                                               
<artifactId>flexmojos-maven-plugin</artifactId>
                                                               
<extensions>true</extensions>
                                                               <configuration>
                                                                              
<rslUrls>
                                                                                
              <!-- maven-extract-rsl-plugin extracts with an _ sign  -->
                                                                                
              <url>./rsls/{artifactId}_{version}.{extension}</url>
                                                                              
</rslUrls>
                                                                              
<policyFileUrls>
                                                                                
              <url>/</url>
                                                                              
</policyFileUrls>
                                                                              
<verifyDigests>false</verifyDigests>
                                                                              
<keepGeneratedActionscript>false</keepGeneratedActionscript>
                                                                              
<definesDeclaration>
                                                                                
              <property>
                                                                                
                              <name>CONFIG::debugging</name>
                                                                                
                              <value>${flex.debug}</value>
                                                                                
              </property>
                                                                              
</definesDeclaration>
                                                               </configuration>
                                               </plugin>
                                               <plugin>
                                                               
<groupId>org.apache.maven.plugins</groupId>
                                                               
<artifactId>maven-assembly-plugin</artifactId>
                                               </plugin>
                               </plugins>
                </build>
                <profiles>
                               <profile>
                                               <id>flexdebug</id>
                                               <dependencies>
                                                               <dependency>
                                                                              
<groupId>com.ilias.i3g.flex.framework</groupId>
                                                                              
<artifactId>FlexSpyTestLib</artifactId>
                                                                              
<type>swc</type>
                                                                              
<scope>rsl</scope>
                                                               </dependency>
                                               </dependencies>
                               </profile>
                </profiles>
</project>



BuildingBlocks (with the css)

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
                xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
                <modelVersion>4.0.0</modelVersion>
                <parent>
                               <groupId>com.ilias.i3g.flex.pom</groupId>
                               <artifactId>flex</artifactId>
                               <version>branch-SDK4.6-SNAPSHOT</version>
                </parent>
                <groupId>com.ilias.i3g.flex.framework</groupId>
                <artifactId>BuildingBlocks_2</artifactId>
                <version>${BuildingBlocks_2.trunk.version}</version>
                <name>${project.groupId}.${project.artifactId}</name>
                <packaging>swc</packaging>
                <properties>
                               <cilistener.port>13542</cilistener.port>
                               <!-- <cilistener.port>14799</cilistener.port> -->
                               
<flex.sdk.version>${flex.version}</flex.sdk.version>
                </properties>

   <dependencies>
      <dependency>
         <groupId>com.ilias.i3g.flex.framework</groupId>
         <artifactId>FlexAppealFrameworkSharedLib</artifactId>
         <version>${FlexAppealFrameworkSharedLib.trunk.version}</version>
         <type>swc</type>
         <scope>external</scope>
      </dependency>

      <dependency>
         <groupId>com.ilias.i3g.flex.framework</groupId>
         <artifactId>FlexAppeal3rdPartyLib</artifactId>
         <version>${FlexAppeal3rdPartyLib.version}</version>
         <type>swc</type>
         <scope>external</scope>
      </dependency>

      <!-- TEST dependencies -->
      <dependency>
         <groupId>com.ilias.i3g.flex.framework</groupId>
         <artifactId>FlexAppealTestFrameworkLib</artifactId>
         <version>${FlexAppealFrameworkLib.trunk.version}</version>
         <type>swc</type>
         <scope>test</scope>
         <exclusions>
            <exclusion>
               <groupId>org.springextensions.actionscript</groupId>
               <artifactId>spring-actionscript-test</artifactId>
            </exclusion>
            <exclusion>
               <groupId>org.springextensions.actionscript</groupId>
               <artifactId>spring-actionscript-core</artifactId>
            </exclusion>
            <exclusion>
               <groupId>com.adobe.flexunit</groupId>
               <artifactId>all</artifactId>
            </exclusion>
            <exclusion>
               <groupId>com.ilias.i3g.flex.framework</groupId>
               <artifactId>FlexSpyTestLib</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>org.flexunit</groupId>
         <artifactId>flexunit</artifactId>
         <version>4.1.0</version>
         <classifier>flex4</classifier>
         <type>swc</type>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.mockito</groupId>
         <artifactId>mockito</artifactId>
         <version>1.4M4</version>
         <type>swc</type>
         <!-- TODO Why is scope-test not working here ??? -->
         <!-- <scope>test</scope> -->
      </dependency>
   </dependencies>
   <build>
      <plugins>
         <plugin>
            <groupId>net.flexmojos.oss</groupId>
            <artifactId>flexmojos-maven-plugin</artifactId>
            <executions>
               <execution>
                  <id>default-compile-swc</id>
                  <phase>compile</phase>
                  <goals>
                     <goal>compile-swc</goal>
                  </goals>
                  <configuration>
                     <debug>${flex.debug}</debug>
                     <optimize>${flex.optimize}</optimize>
                     <namespaces>
                        <namespace>
                           <uri>library://ilias-solutions.com/mxml</uri>
                           <manifest>target/manifest.xml</manifest>
                        </namespace>
                     </namespaces>
                     <includeNamespaces>
                        
<namespace>library://ilias-solutions.com/mxml</namespace>
                     </includeNamespaces>
                     <includeFiles>
                        <include>${basedir}/src/main/flex/design.xml</include>
                        
<include>${basedir}/src/main/resources/buildingblocks2.css</include>
                     </includeFiles>
                  </configuration>
               </execution>
               <execution>
                  <phase>validate</phase>
                  <goals>
                     <goal>manifest</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>
</project>


Any ideas/suggestions are welcome.

Kr,
Filip

Reply via email to